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 c2adc49e..04fbf454 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 @@ -66,7 +66,11 @@ public void start() { String action = TAG + TXMqttConstants.PING_SENDER + mComms.getClient().getClientId(); TXLog.d(TAG, "Register alarmreceiver to Context " + action); if (mContext != null && mAlarmReceiver != null) { - mContext.registerReceiver(mAlarmReceiver, new IntentFilter(action), RECEIVER_NOT_EXPORTED); + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) { + mContext.registerReceiver(mAlarmReceiver, new IntentFilter(action), RECEIVER_NOT_EXPORTED); + } else { + mContext.registerReceiver(mAlarmReceiver, new IntentFilter(action)); + } } int flags = PendingIntent.FLAG_UPDATE_CURRENT;