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:
Michael Chan
2009-09-26 06:16:17 -07:00
parent c63742c8fa
commit e1089ad338
6 changed files with 518 additions and 3 deletions

View File

@@ -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;