Fix IllegalArgumentException from ending user switch watching
@@ -513,7 +513,10 @@ public abstract class CycledLeScanner {
}
protected void cleanupCancelAlarmOnUserSwitch() {
if (mCancelAlarmOnUserSwitchBroadcastReceiver != null) {
+ try {
mContext.unregisterReceiver(mCancelAlarmOnUserSwitchBroadcastReceiver);
+ }
+ catch (IllegalArgumentException e) {} // thrown if OS does not think it was registered
mCancelAlarmOnUserSwitchBroadcastReceiver = null;
}
}
