Skip to content

Commit

Permalink
Update targetSdk to 33 (#918)
Browse files Browse the repository at this point in the history
Some failing tests (round*), but seems they always fail?
  • Loading branch information
ithinkihaveacat authored Oct 3, 2023
1 parent fbb5d8d commit 3a2dfc0
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 24 deletions.
2 changes: 1 addition & 1 deletion AlwaysOnKotlin/compose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ android {
versionName "1.0"
minSdk 26
//noinspection ExpiredTargetSdkVersion
targetSdk 30
targetSdk 33

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
1 change: 0 additions & 1 deletion AlwaysOnKotlin/compose/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
<uses-feature android:name="android.hardware.type.watch" />

<application
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.DeviceDefault">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.util.Log
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.LaunchedEffect
Expand Down Expand Up @@ -63,6 +64,8 @@ val AMBIENT_INTERVAL: Duration = Duration.ofSeconds(10)

const val AMBIENT_UPDATE_ACTION = "com.example.android.wearable.wear.alwayson.action.AMBIENT_UPDATE"

const val TAG = "AlwaysOnApp"

/**
* Create a PendingIntent which we'll give to the AlarmManager to send ambient mode updates
* on an interval which we've define.
Expand Down Expand Up @@ -157,6 +160,7 @@ fun AlwaysOnApp(
}
}
}

AmbientState.Interactive -> Unit
}

Expand All @@ -173,12 +177,23 @@ fun AlwaysOnApp(
val triggerTime = currentInstant.getNextInstantWithInterval(
AMBIENT_INTERVAL
)
ambientUpdateAlarmManager.setExact(
AlarmManager.RTC_WAKEUP,
triggerTime.toEpochMilli(),
ambientUpdatePendingIntent
)
try {
ambientUpdateAlarmManager.setExact(
AlarmManager.RTC_WAKEUP,
triggerTime.toEpochMilli(),
ambientUpdatePendingIntent
)
} catch (_: SecurityException) {
Log.d(
TAG,
arrayOf(
"SecurityException when calling setExact(),",
"screen will not be refreshed"
).joinToString(" ")
)
}
}

AmbientState.Interactive -> {
val delay = currentInstant.getDelayToNextInstantWithInterval(
ACTIVE_INTERVAL
Expand Down
2 changes: 1 addition & 1 deletion AlwaysOnKotlin/views/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ android {
versionCode 1
versionName "1.0"
minSdk 26
targetSdk 30
targetSdk 33

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,18 @@ class MainActivity : FragmentActivity() {
if (ambientCallbackState.isAmbient) {
val triggerTime = instant.getNextInstantWithInterval(AMBIENT_INTERVAL)
if (Build.VERSION.SDK_INT < 33) {
ambientUpdateAlarmManager.setExact(
AlarmManager.RTC_WAKEUP,
triggerTime.toEpochMilli(),
ambientUpdatePendingIntent
)
try {
ambientUpdateAlarmManager.setExact(
AlarmManager.RTC_WAKEUP,
triggerTime.toEpochMilli(),
ambientUpdatePendingIntent
)
} catch (_: SecurityException) {
Log.d(
TAG,
"SecurityException when calling setExact(), screen will not be refreshed"
)
}
}
} else {
Log.d(TAG, "!isAmbient")
Expand Down
2 changes: 1 addition & 1 deletion ComposeAdvanced/benchmark/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ android {

defaultConfig {
minSdk 29
targetSdk 30
targetSdk 33

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
4 changes: 2 additions & 2 deletions DataLayer/Application/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ plugins {
}

android {
compileSdkVersion 34
compileSdk 34

namespace "com.example.android.wearable.datalayer"

Expand All @@ -30,7 +30,7 @@ android {
versionCode 1
versionName "1.0"
minSdk 21
targetSdk 32
targetSdk 33

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
4 changes: 2 additions & 2 deletions DataLayer/Wearable/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ plugins {
}

android {
compileSdkVersion 34
compileSdk 34

namespace "com.example.android.wearable.datalayer"

Expand All @@ -30,7 +30,7 @@ android {
versionName "1.0"

minSdk 26
targetSdk 30
targetSdk 33
}

lintOptions {
Expand Down
4 changes: 2 additions & 2 deletions RuntimePermissionsWear/Wearable/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ plugins {
}

android {
compileSdkVersion 34
compileSdk 34

namespace "com.example.android.wearable.runtimepermissions"

Expand All @@ -30,7 +30,7 @@ android {
versionCode 1
versionName "1.0"
minSdkVersion 26
targetSdk 30
targetSdk 33

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
android:name=".MainWearActivity"
android:launchMode="singleInstance"
android:taskAffinity=".main"
android:exported="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
2 changes: 1 addition & 1 deletion WatchFaceKotlin/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ android {
defaultConfig {
applicationId "com.example.android.wearable.alpha"
minSdk 28
targetSdk 30
targetSdk 33
versionCode 1
versionName "1.0"
}
Expand Down
2 changes: 1 addition & 1 deletion WearStandaloneGoogleSignIn/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ android {
versionName "1.0"

minSdk 26
targetSdk 30
targetSdk 33
}

lintOptions {
Expand Down
2 changes: 1 addition & 1 deletion WearVerifyRemoteApp/Application/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ android {
versionCode 1
versionName "1.0"
minSdk 23
targetSdk 32
targetSdk 33
}

compileOptions {
Expand Down
2 changes: 1 addition & 1 deletion WearVerifyRemoteApp/Wearable/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ android {
versionCode 1
versionName "1.0"
minSdk 26
targetSdk 30
targetSdk 33
}

compileOptions {
Expand Down

0 comments on commit 3a2dfc0

Please sign in to comment.