Do not allow apps to cause Bluetooth to be discoverable forever

Trying to set a discoverable timout of 0 for Bluetooth will now
not allow bluetooth to be discoverable forever.

Bug: 28177801
Change-Id: Icfa03e2100f8e7f31415ebab39889b9ec32e6c77
This commit is contained in:
Ajay Panicker
2016-08-18 13:17:19 -07:00
parent 8d9ade8b9c
commit 6dcab67c0c

View File

@@ -267,7 +267,7 @@ public class RequestPermissionActivity extends Activity implements
Log.d(TAG, "Setting Bluetooth Discoverable Timeout = " + mTimeout);
if (mTimeout < 0 || mTimeout > MAX_DISCOVERABLE_TIMEOUT) {
if (mTimeout < 1 || mTimeout > MAX_DISCOVERABLE_TIMEOUT) {
mTimeout = BluetoothDiscoverableEnabler.DEFAULT_DISCOVERABLE_TIMEOUT;
}
} else {