BLuetooth Discoverable timer not correctly cleared

Changing the discoverable timer from 2min to infinity before the 2min timer
has passed will not clear the 2min timer.
This fix handles this case.

Bug: 12220031
Change-Id: I8794eda353c74e46b09e15ee9a7a491658e7b5cd
This commit is contained in:
Kim Schulz
2013-12-19 10:03:11 +01:00
committed by Zhihai Xu
parent 8dd9b71f7c
commit 54313d7d66

View File

@@ -143,7 +143,10 @@ final class BluetoothDiscoverableEnabler implements Preference.OnPreferenceClick
if (timeout > 0) {
BluetoothDiscoverableTimeoutReceiver.setDiscoverableAlarm(mContext, endTimestamp);
} else {
BluetoothDiscoverableTimeoutReceiver.cancelDiscoverableAlarm(mContext);
}
} else {
mLocalAdapter.setScanMode(BluetoothAdapter.SCAN_MODE_CONNECTABLE);
BluetoothDiscoverableTimeoutReceiver.cancelDiscoverableAlarm(mContext);