Skip to content

Commit 61c0fc4

Browse files
Matthew Xiejason-simmons
authored andcommitted
DO NOT MERGE - cherry pick a Bluetooth property fix from master
Check nullpointer of discoverableTimeout in initBluetoothAfterTurningOn. When we fail to get the property, print out warning message, turn Discoverable off. Bug 6302990 Change-Id: Ie21aa2a89050c74d99d9ee521a95ffa822114757
1 parent 8f267c4 commit 61c0fc4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/java/android/server/BluetoothService.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,11 @@ private synchronized void updateSdpRecords() {
611611
/*package*/ void initBluetoothAfterTurningOn() {
612612
String discoverable = getProperty("Discoverable", false);
613613
String timeout = getProperty("DiscoverableTimeout", false);
614+
if (timeout == null) {
615+
Log.w(TAG, "Null DiscoverableTimeout property");
616+
// assign a number, anything not 0
617+
timeout = "1";
618+
}
614619
if (discoverable.equals("true") && Integer.valueOf(timeout) != 0) {
615620
setAdapterPropertyBooleanNative("Discoverable", 0);
616621
}

0 commit comments

Comments
 (0)