Skip to content

Commit

Permalink
Bugfix: ThrowInvalidMutabilityException in previousAuthorizationStatu…
Browse files Browse the repository at this point in the history
…s. (#8)

* Bugfix: ThrowInvalidMutabilityException in previousAuthorizationStatus.

* Apply: PR Comment(var to val type).

Co-authored-by: HanPro <sjin.han@navercorp.com>
  • Loading branch information
HanSJin and HanPro authored Dec 1, 2021
1 parent c21c20b commit aa4e784
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import org.jetbrains.kotlin.cli.common.toBooleanLenient
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget

val isSnapshotUpload = System.getProperty("snapshot").toBooleanLenient() ?: false
val libVersion = "0.2.7"
val libVersion = "0.2.8"
val gitName = "abc-${project.name}"

buildscript {
Expand Down
2 changes: 1 addition & 1 deletion kmm_location.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'kmm_location'
spec.version = '0.2.7'
spec.version = '0.2.8'
spec.homepage = ''
spec.source = { :git => "Not Published", :tag => "Cocoapods/#{spec.name}/#{spec.version}" }
spec.authors = ''
Expand Down
2 changes: 1 addition & 1 deletion sample/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
kotlin("native.cocoapods")
}

val abcLocationLib = "com.linecorp.abc:kmm-location:0.2.6"
val abcLocationLib = "com.linecorp.abc:kmm-location:0.2.8"

version = "1.0"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal actual class LocationManager {
actual fun startLocationUpdating() = when (authorizationStatus) {
LocationAuthorizationStatus.AuthorizedAlways -> startUpdating()
LocationAuthorizationStatus.AuthorizedWhenInUse -> if (isRequiredAllowAlways) {
if (previousAuthorizationStatus == LocationAuthorizationStatus.AuthorizedWhenInUse) {
if (previousAuthorizationStatus.value == LocationAuthorizationStatus.AuthorizedWhenInUse) {
notifyOnAlwaysAllowsPermissionRequired()
} else {
requestPermission()
Expand All @@ -59,7 +59,7 @@ internal actual class LocationManager {
// -------------------------------------------------------------------------------------------

var requiredPermission = LocationAuthorizationStatus.AuthorizedAlways
var previousAuthorizationStatus = LocationAuthorizationStatus.NotSet
val previousAuthorizationStatus = NativeAtomicReference(LocationAuthorizationStatus.NotSet)

fun onAlwaysAllowsPermissionRequired(
target: Any,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ fun ABCLocation.Companion.removeOnAlwaysAllowsPermissionRequired(target: Any) =
locationManager.removeOnAlwaysAllowsPermissionRequired(target)

internal var ABCLocation.Companion.previousAuthorizationStatus: LocationAuthorizationStatus
get() = locationManager.previousAuthorizationStatus
set(value) { locationManager.previousAuthorizationStatus = value }
get() = locationManager.previousAuthorizationStatus.value
set(value) { locationManager.previousAuthorizationStatus.value = value }

0 comments on commit aa4e784

Please sign in to comment.