diff --git a/explorer/device-android-demo/build.gradle b/explorer/device-android-demo/build.gradle index 5fed622a..e4efd900 100644 --- a/explorer/device-android-demo/build.gradle +++ b/explorer/device-android-demo/build.gradle @@ -8,12 +8,12 @@ rootProject.ext.configPath = "./src/main/assets/app-config.json" apply from: "../../parse_json.gradle" android { - compileSdkVersion 28 + compileSdkVersion 31 buildToolsVersion "26.0.3" defaultConfig { applicationId "com.tencent.iot.explorer.device.android.app" minSdkVersion 19 - targetSdkVersion 28 + targetSdkVersion 31 versionCode 1 versionName rootProject.ext.sdk.sdkdemoVersion testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' diff --git a/explorer/explorer-device-android/build.gradle b/explorer/explorer-device-android/build.gradle index 73e08fd4..9a28b673 100644 --- a/explorer/explorer-device-android/build.gradle +++ b/explorer/explorer-device-android/build.gradle @@ -6,12 +6,12 @@ apply plugin: 'kotlin-android-extensions' android { - compileSdkVersion 29 + compileSdkVersion 31 buildToolsVersion "26.0.3" defaultConfig { minSdkVersion 15 - targetSdkVersion 29 + targetSdkVersion 31 versionCode 1 versionName "1.0" testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' diff --git a/explorer/explorer-device-broadcast/build.gradle b/explorer/explorer-device-broadcast/build.gradle index 4839e8f9..f99a2580 100644 --- a/explorer/explorer-device-broadcast/build.gradle +++ b/explorer/explorer-device-broadcast/build.gradle @@ -3,12 +3,12 @@ apply plugin: 'maven-publish' apply plugin: 'signing' android { - compileSdkVersion 29 + compileSdkVersion 31 buildToolsVersion "26.0.3" defaultConfig { minSdkVersion 16 - targetSdkVersion 29 + targetSdkVersion 31 versionCode 1 versionName "1.0" diff --git a/explorer/explorer-device-central/build.gradle b/explorer/explorer-device-central/build.gradle index 10c3eddf..602eeebd 100644 --- a/explorer/explorer-device-central/build.gradle +++ b/explorer/explorer-device-central/build.gradle @@ -7,12 +7,12 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { - compileSdkVersion 29 + compileSdkVersion 31 buildToolsVersion "26.0.3" defaultConfig { minSdkVersion 18 - targetSdkVersion 29 + targetSdkVersion 31 versionCode 1 versionName "1.0" diff --git a/explorer/explorer-device-face/build.gradle b/explorer/explorer-device-face/build.gradle index c0e22b18..d6027261 100644 --- a/explorer/explorer-device-face/build.gradle +++ b/explorer/explorer-device-face/build.gradle @@ -3,12 +3,12 @@ apply plugin: 'maven-publish' apply plugin: 'signing' android { - compileSdkVersion 29 + compileSdkVersion 31 buildToolsVersion "26.0.3" defaultConfig { minSdkVersion 19 - targetSdkVersion 29 + targetSdkVersion 31 versionCode 1 versionName "1.0" diff --git a/explorer/explorer-device-rtc/build.gradle b/explorer/explorer-device-rtc/build.gradle index c6aa14d2..f44532ca 100644 --- a/explorer/explorer-device-rtc/build.gradle +++ b/explorer/explorer-device-rtc/build.gradle @@ -3,12 +3,12 @@ apply plugin: 'maven-publish' apply plugin: 'signing' android { - compileSdkVersion 29 + compileSdkVersion 31 buildToolsVersion "26.0.3" defaultConfig { minSdkVersion 16 - targetSdkVersion 29 + targetSdkVersion 31 versionCode 1 versionName "1.0" diff --git a/explorer/explorer-device-tme/build.gradle b/explorer/explorer-device-tme/build.gradle index 70124590..fa933945 100644 --- a/explorer/explorer-device-tme/build.gradle +++ b/explorer/explorer-device-tme/build.gradle @@ -3,12 +3,12 @@ plugins { } android { - compileSdkVersion 30 + compileSdkVersion 31 buildToolsVersion "30.0.3" defaultConfig { minSdkVersion 16 - targetSdkVersion 30 + targetSdkVersion 31 versionCode 1 versionName "1.0" diff --git a/explorer/explorer-device-video/build.gradle b/explorer/explorer-device-video/build.gradle index 63b53ce6..c4a5af62 100644 --- a/explorer/explorer-device-video/build.gradle +++ b/explorer/explorer-device-video/build.gradle @@ -7,12 +7,12 @@ apply plugin: 'kotlin-android-extensions' apply plugin: 'com.kezong.fat-aar' android { - compileSdkVersion 29 + compileSdkVersion 31 buildToolsVersion "26.0.3" defaultConfig { minSdkVersion 18 - targetSdkVersion 29 + targetSdkVersion 31 versionCode 1 versionName "1.0" diff --git a/explorer/explorer-media-common/build.gradle b/explorer/explorer-media-common/build.gradle index 7d5c798d..59c9354c 100644 --- a/explorer/explorer-media-common/build.gradle +++ b/explorer/explorer-media-common/build.gradle @@ -3,12 +3,12 @@ plugins { } android { - compileSdkVersion 29 + compileSdkVersion 31 buildToolsVersion '26.0.3' defaultConfig { minSdkVersion 16 - targetSdkVersion 29 + targetSdkVersion 31 versionCode 1 versionName "1.0" diff --git a/hub/hub-android-demo/build.gradle b/hub/hub-android-demo/build.gradle index 431cd3a5..3acc22d9 100644 --- a/hub/hub-android-demo/build.gradle +++ b/hub/hub-android-demo/build.gradle @@ -5,12 +5,12 @@ rootProject.ext.configPath = "./src/main/assets/app-config.json" apply from: "../../parse_json.gradle" android { - compileSdkVersion 29 + compileSdkVersion 31 buildToolsVersion "26.0.0" defaultConfig { applicationId "com.tencent.iot.hub.device.android.app" minSdkVersion 16 - targetSdkVersion 29 + targetSdkVersion 31 versionCode 1 versionName rootProject.ext.sdk.sdkdemoVersion testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' diff --git a/hub/hub-device-android/build.gradle b/hub/hub-device-android/build.gradle index 555b2936..b956a936 100644 --- a/hub/hub-device-android/build.gradle +++ b/hub/hub-device-android/build.gradle @@ -4,12 +4,12 @@ apply plugin: 'signing' android { - compileSdkVersion 29 + compileSdkVersion 31 buildToolsVersion "26.0.3" defaultConfig { minSdkVersion 16 - targetSdkVersion 25 + targetSdkVersion 31 versionCode 2 versionName "1.1" diff --git a/hub/hub-device-android/src/main/java/com/tencent/iot/hub/device/android/core/mqtt/TXAlarmPingSender.java b/hub/hub-device-android/src/main/java/com/tencent/iot/hub/device/android/core/mqtt/TXAlarmPingSender.java index d1744fa3..262e0b9a 100644 --- a/hub/hub-device-android/src/main/java/com/tencent/iot/hub/device/android/core/mqtt/TXAlarmPingSender.java +++ b/hub/hub-device-android/src/main/java/com/tencent/iot/hub/device/android/core/mqtt/TXAlarmPingSender.java @@ -67,7 +67,11 @@ public void start() { mContext.registerReceiver(mAlarmReceiver, new IntentFilter(action)); } - pendingIntent = PendingIntent.getBroadcast(mContext, 0, new Intent(action), PendingIntent.FLAG_UPDATE_CURRENT); + int flags = PendingIntent.FLAG_UPDATE_CURRENT; + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) { + flags |= PendingIntent.FLAG_IMMUTABLE; + } + pendingIntent = PendingIntent.getBroadcast(mContext, 0, new Intent(action), flags); schedule(mComms.getKeepAlive()); hasStarted = true;