Loading play-services-base/core/src/main/kotlin/org/microg/gms/settings/SettingsContract.kt +5 −1 Original line number Diff line number Diff line Loading @@ -152,12 +152,16 @@ object SettingsContract { const val WIFI_MLS = "location_wifi_mls" const val WIFI_MOVING = "location_wifi_moving" const val WIFI_LEARNING = "location_wifi_learning" const val CELL_MLS = "location_cell_mls" const val CELL_LEARNING = "location_cell_learning" val PROJECTION = arrayOf( WIFI_MLS, WIFI_MOVING, CELL_MLS WIFI_LEARNING, CELL_MLS, CELL_LEARNING, ) } Loading play-services-base/core/src/main/kotlin/org/microg/gms/settings/SettingsProvider.kt +4 −0 Original line number Diff line number Diff line Loading @@ -295,7 +295,9 @@ class SettingsProvider : ContentProvider() { when (key) { Location.WIFI_MLS -> getSettingsBoolean(key, true) Location.WIFI_MOVING -> getSettingsBoolean(key, true) Location.WIFI_LEARNING -> getSettingsBoolean(key, true) Location.CELL_MLS -> getSettingsBoolean(key, true) Location.CELL_LEARNING -> getSettingsBoolean(key, true) else -> throw IllegalArgumentException("Unknown key: $key") } } Loading @@ -307,7 +309,9 @@ class SettingsProvider : ContentProvider() { when (key) { Location.WIFI_MLS -> editor.putBoolean(key, value as Boolean) Location.WIFI_MOVING -> editor.putBoolean(key, value as Boolean) Location.WIFI_LEARNING -> editor.putBoolean(key, value as Boolean) Location.CELL_MLS -> editor.putBoolean(key, value as Boolean) Location.CELL_LEARNING -> editor.putBoolean(key, value as Boolean) else -> throw IllegalArgumentException("Unknown key: $key") } } Loading play-services-location/core/src/main/kotlin/org/microg/gms/location/LocationSettings.kt +16 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,14 @@ class LocationSettings(private val context: Context) { SettingsContract.setSettings(context, SettingsContract.Location.getContentUri(context)) { put(SettingsContract.Location.WIFI_MOVING, value)} } var wifiLearning: Boolean get() = SettingsContract.getSettings(context, SettingsContract.Location.getContentUri(context), arrayOf(SettingsContract.Location.WIFI_LEARNING)) { c -> c.getInt(0) != 0 } set(value) { SettingsContract.setSettings(context, SettingsContract.Location.getContentUri(context)) { put(SettingsContract.Location.WIFI_LEARNING, value)} } var cellMls : Boolean get() = SettingsContract.getSettings(context, SettingsContract.Location.getContentUri(context), arrayOf(SettingsContract.Location.CELL_MLS)) { c -> c.getInt(0) != 0 Loading @@ -32,4 +40,12 @@ class LocationSettings(private val context: Context) { set(value) { SettingsContract.setSettings(context, SettingsContract.Location.getContentUri(context)) { put(SettingsContract.Location.CELL_MLS, value)} } var cellLearning: Boolean get() = SettingsContract.getSettings(context, SettingsContract.Location.getContentUri(context), arrayOf(SettingsContract.Location.CELL_LEARNING)) { c -> c.getInt(0) != 0 } set(value) { SettingsContract.setSettings(context, SettingsContract.Location.getContentUri(context)) { put(SettingsContract.Location.CELL_LEARNING, value)} } } No newline at end of file play-services-location/core/src/main/kotlin/org/microg/gms/location/extensions.kt +1 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ internal val FEATURES = arrayOf( Feature("use_safe_parcelable_in_intents", 1) ) internal fun Long.formatRealtime(): CharSequence = DateUtils.getRelativeTimeSpanString((this - SystemClock.elapsedRealtime()) + System.currentTimeMillis(), System.currentTimeMillis(), 0) internal fun Long.formatRealtime(): CharSequence = if (this <= 0) "n/a" else DateUtils.getRelativeTimeSpanString((this - SystemClock.elapsedRealtime()) + System.currentTimeMillis(), System.currentTimeMillis(), 0) internal fun Long.formatDuration(): CharSequence { if (this == 0L) return "0ms" if (this > 315360000000L /* ten years */) return "\u221e" Loading play-services-location/core/src/main/kotlin/org/microg/gms/location/manager/LocationAppsDatabase.kt +0 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,6 @@ class LocationAppsDatabase(context: Context) : SQLiteOpenHelper(context, "geoapp fun noteAppLocation(packageName: String, location: Location?) { noteAppUsage(packageName) Log.d(TAG, "Note app $packageName @ $location") if (location == null) return val values = contentValuesOf( FIELD_PACKAGE to packageName, Loading Loading
play-services-base/core/src/main/kotlin/org/microg/gms/settings/SettingsContract.kt +5 −1 Original line number Diff line number Diff line Loading @@ -152,12 +152,16 @@ object SettingsContract { const val WIFI_MLS = "location_wifi_mls" const val WIFI_MOVING = "location_wifi_moving" const val WIFI_LEARNING = "location_wifi_learning" const val CELL_MLS = "location_cell_mls" const val CELL_LEARNING = "location_cell_learning" val PROJECTION = arrayOf( WIFI_MLS, WIFI_MOVING, CELL_MLS WIFI_LEARNING, CELL_MLS, CELL_LEARNING, ) } Loading
play-services-base/core/src/main/kotlin/org/microg/gms/settings/SettingsProvider.kt +4 −0 Original line number Diff line number Diff line Loading @@ -295,7 +295,9 @@ class SettingsProvider : ContentProvider() { when (key) { Location.WIFI_MLS -> getSettingsBoolean(key, true) Location.WIFI_MOVING -> getSettingsBoolean(key, true) Location.WIFI_LEARNING -> getSettingsBoolean(key, true) Location.CELL_MLS -> getSettingsBoolean(key, true) Location.CELL_LEARNING -> getSettingsBoolean(key, true) else -> throw IllegalArgumentException("Unknown key: $key") } } Loading @@ -307,7 +309,9 @@ class SettingsProvider : ContentProvider() { when (key) { Location.WIFI_MLS -> editor.putBoolean(key, value as Boolean) Location.WIFI_MOVING -> editor.putBoolean(key, value as Boolean) Location.WIFI_LEARNING -> editor.putBoolean(key, value as Boolean) Location.CELL_MLS -> editor.putBoolean(key, value as Boolean) Location.CELL_LEARNING -> editor.putBoolean(key, value as Boolean) else -> throw IllegalArgumentException("Unknown key: $key") } } Loading
play-services-location/core/src/main/kotlin/org/microg/gms/location/LocationSettings.kt +16 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,14 @@ class LocationSettings(private val context: Context) { SettingsContract.setSettings(context, SettingsContract.Location.getContentUri(context)) { put(SettingsContract.Location.WIFI_MOVING, value)} } var wifiLearning: Boolean get() = SettingsContract.getSettings(context, SettingsContract.Location.getContentUri(context), arrayOf(SettingsContract.Location.WIFI_LEARNING)) { c -> c.getInt(0) != 0 } set(value) { SettingsContract.setSettings(context, SettingsContract.Location.getContentUri(context)) { put(SettingsContract.Location.WIFI_LEARNING, value)} } var cellMls : Boolean get() = SettingsContract.getSettings(context, SettingsContract.Location.getContentUri(context), arrayOf(SettingsContract.Location.CELL_MLS)) { c -> c.getInt(0) != 0 Loading @@ -32,4 +40,12 @@ class LocationSettings(private val context: Context) { set(value) { SettingsContract.setSettings(context, SettingsContract.Location.getContentUri(context)) { put(SettingsContract.Location.CELL_MLS, value)} } var cellLearning: Boolean get() = SettingsContract.getSettings(context, SettingsContract.Location.getContentUri(context), arrayOf(SettingsContract.Location.CELL_LEARNING)) { c -> c.getInt(0) != 0 } set(value) { SettingsContract.setSettings(context, SettingsContract.Location.getContentUri(context)) { put(SettingsContract.Location.CELL_LEARNING, value)} } } No newline at end of file
play-services-location/core/src/main/kotlin/org/microg/gms/location/extensions.kt +1 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ internal val FEATURES = arrayOf( Feature("use_safe_parcelable_in_intents", 1) ) internal fun Long.formatRealtime(): CharSequence = DateUtils.getRelativeTimeSpanString((this - SystemClock.elapsedRealtime()) + System.currentTimeMillis(), System.currentTimeMillis(), 0) internal fun Long.formatRealtime(): CharSequence = if (this <= 0) "n/a" else DateUtils.getRelativeTimeSpanString((this - SystemClock.elapsedRealtime()) + System.currentTimeMillis(), System.currentTimeMillis(), 0) internal fun Long.formatDuration(): CharSequence { if (this == 0L) return "0ms" if (this > 315360000000L /* ten years */) return "\u221e" Loading
play-services-location/core/src/main/kotlin/org/microg/gms/location/manager/LocationAppsDatabase.kt +0 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,6 @@ class LocationAppsDatabase(context: Context) : SQLiteOpenHelper(context, "geoapp fun noteAppLocation(packageName: String, location: Location?) { noteAppUsage(packageName) Log.d(TAG, "Note app $packageName @ $location") if (location == null) return val values = contentValuesOf( FIELD_PACKAGE to packageName, Loading