From 6dcab67c0ccf5d9a644059260a16f46a07043eee Mon Sep 17 00:00:00 2001 From: Ajay Panicker Date: Thu, 18 Aug 2016 13:17:19 -0700 Subject: [PATCH] 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 --- .../android/settings/bluetooth/RequestPermissionActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/bluetooth/RequestPermissionActivity.java b/src/com/android/settings/bluetooth/RequestPermissionActivity.java index 9ce332d1eb6..3148aedca58 100644 --- a/src/com/android/settings/bluetooth/RequestPermissionActivity.java +++ b/src/com/android/settings/bluetooth/RequestPermissionActivity.java @@ -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 {