Skip to content

Commit

Permalink
Bump targetSDK to 33 for Google policy compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
growse committed Aug 23, 2023
1 parent f984043 commit 3b6cd66
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 19 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Version 2.4.11

- Bumped targetSdk to 33 to comply with Google Play Store policies

## Version 2.4.10

### New features
Expand Down
16 changes: 8 additions & 8 deletions project/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,20 @@ jacoco {
toolVersion = rootJacocoVersion
}


val gmsImplementation: Configuration by configurations.creating
val numShards = System.getenv("CIRCLE_NODE_TOTAL") ?: "0"
val shardIndex = System.getenv("CIRCLE_NODE_INDEX") ?: "0"

android {
compileSdk = 31
compileSdk = 33

defaultConfig {
applicationId = "org.owntracks.android"
minSdk = 21
targetSdk = 31
targetSdk = 33

versionCode = 20410000
versionName = "2.4.10"
versionCode = 420411000
versionName = "2.4.11"

val locales = listOf("en", "de", "fr", "es", "ru", "ca", "pl", "cs", "ja", "pt", "zh", "da")
buildConfigField(
Expand Down Expand Up @@ -244,7 +243,6 @@ dependencies {
androidTestUtil(libs.bundles.androidx.test.util)
}


// Publishing
val serviceAccountCredentials = file("owntracks-android-gcloud-creds.json")

Expand Down Expand Up @@ -272,8 +270,10 @@ androidComponents {
val minusOne = System.getenv("MAKE_APK_SAME_VERSION_CODE_AS_GOOGLE_PLAY")
if (!minusOne.isNullOrEmpty()) {
for (output in variant.outputs) {
output.versionCode.set(codesTask.flatMap { it.outCode }
.map { it.asFile.readText().toInt() })
output.versionCode.set(
codesTask.flatMap { it.outCode }
.map { it.asFile.readText().toInt() }
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package org.owntracks.android.geocoding

import android.content.Context
import android.location.Address
import java.math.BigDecimal
import java.util.*
import org.threeten.bp.Instant
import org.threeten.bp.temporal.ChronoUnit
import timber.log.Timber
import java.math.BigDecimal
import java.util.*

class DeviceGeocoder internal constructor(context: Context?) : CachingGeocoder() {
class DeviceGeocoder internal constructor(context: Context) : CachingGeocoder() {
private val geocoder: android.location.Geocoder =
android.location.Geocoder(context, Locale.getDefault())
private var tripResetTimestamp: Instant = Instant.MIN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.snackbar.Snackbar
import dagger.hilt.android.AndroidEntryPoint
import dagger.hilt.android.EntryPointAccessors
import javax.inject.Inject
import kotlinx.coroutines.launch
import org.owntracks.android.BR
import org.owntracks.android.R
import org.owntracks.android.data.repos.LocationRepo
import org.owntracks.android.databinding.UiMapBinding
import org.owntracks.android.geocoding.GeocoderProvider
import org.owntracks.android.location.toLatLng
import org.owntracks.android.model.FusedContact
import org.owntracks.android.services.BackgroundService
import org.owntracks.android.services.BackgroundService.BACKGROUND_LOCATION_RESTRICTION_NOTIFICATION_TAG
Expand All @@ -54,7 +54,6 @@ import org.owntracks.android.ui.mixins.ServiceStarter
import org.owntracks.android.ui.mixins.WorkManagerInitExceptionNotifier
import org.owntracks.android.ui.welcome.WelcomeActivity
import timber.log.Timber
import javax.inject.Inject

@AndroidEntryPoint
class MapActivity :
Expand Down Expand Up @@ -228,8 +227,12 @@ class MapActivity :
.setIcon(R.drawable.ic_baseline_location_disabled_24)
.setTitle(getString(R.string.deviceLocationDisabledDialogTitle))
.setMessage(getString(R.string.deviceLocationDisabledDialogMessage))
.setPositiveButton(getString(R.string.deviceLocationDisabledDialogPositiveButtonLabel)) { _, _ ->
locationServicesLauncher.launch(Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS))
.setPositiveButton(
getString(R.string.deviceLocationDisabledDialogPositiveButtonLabel)
) { _, _ ->
locationServicesLauncher.launch(
Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS)
)
}
.setNegativeButton(android.R.string.cancel) { _, _ ->
preferences.userDeclinedEnableLocationServices = true
Expand Down Expand Up @@ -262,7 +265,9 @@ class MapActivity :
MaterialAlertDialogBuilder(this)
.setCancelable(true)
.setIcon(R.drawable.ic_baseline_location_disabled_24)
.setTitle(getString(R.string.locationPermissionRequestDialogTitle))
.setTitle(
getString(R.string.locationPermissionRequestDialogTitle)
)
.setMessage(R.string.locationPermissionRequestDialogMessage)
.setPositiveButton(
android.R.string.ok
Expand Down Expand Up @@ -458,14 +463,14 @@ class MapActivity :
private fun disableLocationMenus() {
binding?.fabMyLocation?.isEnabled = false
menu?.run {
findItem(R.id.menu_report).setEnabled(false).icon.alpha = 128
findItem(R.id.menu_report).setEnabled(false).icon?.alpha = 128
}
}

private fun enableLocationMenus() {
binding?.fabMyLocation?.isEnabled = true
menu?.run {
findItem(R.id.menu_report).setEnabled(true).icon.alpha = 255
findItem(R.id.menu_report).setEnabled(true).icon?.alpha = 255
}
}

Expand Down
2 changes: 1 addition & 1 deletion project/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ org.gradle.caching=true
android.nonTransitiveRClass=true
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M" -XX\:MaxPermSize\=256m -XX\:+HeapDumpOnOutOfMemoryError -Dfile.encoding\=UTF-8 -XX\:+UseParallelGC
org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M" -XX\:+HeapDumpOnOutOfMemoryError -Dfile.encoding\=UTF-8 -XX\:+UseParallelGC
android.useAndroidX=true
android.enableJetifier=true
org.gradle.vfs.watch=true
Expand Down

0 comments on commit 3b6cd66

Please sign in to comment.