b/2142065 Added Bluetooth API to allow developer to request the user's permission to enable discovery mode.
Change-Id: I6da1598661ad05b4cfd2b7cc81e05d3053df5777
This commit is contained in:
@@ -39,9 +39,9 @@ public class BluetoothDiscoverableEnabler implements Preference.OnPreferenceChan
|
||||
|
||||
private static final String SYSTEM_PROPERTY_DISCOVERABLE_TIMEOUT =
|
||||
"debug.bt.discoverable_time";
|
||||
private static final int DISCOVERABLE_TIMEOUT = 120;
|
||||
/* package */ static final int DEFAULT_DISCOVERABLE_TIMEOUT = 120;
|
||||
|
||||
private static final String SHARED_PREFERENCES_KEY_DISCOVERABLE_END_TIMESTAMP =
|
||||
/* package */ static final String SHARED_PREFERENCES_KEY_DISCOVERABLE_END_TIMESTAMP =
|
||||
"discoverable_end_timestamp";
|
||||
|
||||
private final Context mContext;
|
||||
@@ -135,7 +135,7 @@ public class BluetoothDiscoverableEnabler implements Preference.OnPreferenceChan
|
||||
private int getDiscoverableTimeout() {
|
||||
int timeout = SystemProperties.getInt(SYSTEM_PROPERTY_DISCOVERABLE_TIMEOUT, -1);
|
||||
if (timeout <= 0) {
|
||||
timeout = DISCOVERABLE_TIMEOUT;
|
||||
timeout = DEFAULT_DISCOVERABLE_TIMEOUT;
|
||||
}
|
||||
|
||||
return timeout;
|
||||
|
Reference in New Issue
Block a user