From a56b4a29eabdb90534f0fa306b5581100c61f1c8 Mon Sep 17 00:00:00 2001 From: WhalenSun Date: Wed, 22 May 2024 19:40:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9compileSdkVersion=E5=92=8Ctar?= =?UTF-8?q?getSdkVersion=E4=B8=BA31?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- explorer/device-android-demo/build.gradle | 4 ++-- explorer/explorer-device-android/build.gradle | 4 ++-- explorer/explorer-device-broadcast/build.gradle | 4 ++-- explorer/explorer-device-central/build.gradle | 4 ++-- explorer/explorer-device-face/build.gradle | 4 ++-- explorer/explorer-device-rtc/build.gradle | 4 ++-- explorer/explorer-device-tme/build.gradle | 4 ++-- explorer/explorer-device-video/build.gradle | 4 ++-- explorer/explorer-media-common/build.gradle | 4 ++-- hub/hub-android-demo/build.gradle | 4 ++-- hub/hub-device-android/build.gradle | 4 ++-- .../iot/hub/device/android/core/mqtt/TXAlarmPingSender.java | 6 +++++- 12 files changed, 27 insertions(+), 23 deletions(-) diff --git a/explorer/device-android-demo/build.gradle b/explorer/device-android-demo/build.gradle index 5fed622a5..e4efd900a 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 73e08fd4a..9a28b6735 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 4839e8f9c..f99a25804 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 10c3eddf1..602eeebd5 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 c0e22b188..d60272611 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 c6aa14d22..f44532caf 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 70124590d..fa9339455 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 63b53ce66..c4a5af620 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 7d5c798dd..59c9354c7 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 431cd3a55..3acc22d99 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 555b29369..b956a9367 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 d1744fa32..262e0b9ac 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;