File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
hub/hub-device-android/src/main/java/com/tencent/iot/hub/device/android/core/mqtt Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,11 @@ public void start() {
66
66
String action = TAG + TXMqttConstants .PING_SENDER + mComms .getClient ().getClientId ();
67
67
TXLog .d (TAG , "Register alarmreceiver to Context " + action );
68
68
if (mContext != null && mAlarmReceiver != null ) {
69
- mContext .registerReceiver (mAlarmReceiver , new IntentFilter (action ), RECEIVER_NOT_EXPORTED );
69
+ if (android .os .Build .VERSION .SDK_INT >= android .os .Build .VERSION_CODES .S ) {
70
+ mContext .registerReceiver (mAlarmReceiver , new IntentFilter (action ), RECEIVER_NOT_EXPORTED );
71
+ } else {
72
+ mContext .registerReceiver (mAlarmReceiver , new IntentFilter (action ));
73
+ }
70
74
}
71
75
72
76
int flags = PendingIntent .FLAG_UPDATE_CURRENT ;
You can’t perform that action at this time.
0 commit comments