diff options
| author | Nick Pelly <npelly@google.com> | 2009-09-28 10:33:55 -0700 |
|---|---|---|
| committer | Nick Pelly <npelly@google.com> | 2009-09-28 11:04:00 -0700 |
| commit | 1acdcc1a508c00dc31751a2a2eef539a59cb21ce (patch) | |
| tree | 066d38ac9413b08e592e0ba239a14e131e615514 /core/java/android/bluetooth/BluetoothAdapter.java | |
| parent | b19774d520bde5bb12d80417788d9a773e123c14 (diff) | |
Add an API to request a system activity to turn on Bluetooth.
Change-Id: I2fca33ad27017ea4e2ecba37854b749682d07672
Diffstat (limited to 'core/java/android/bluetooth/BluetoothAdapter.java')
| -rw-r--r-- | core/java/android/bluetooth/BluetoothAdapter.java | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java index 3aaed385dfa7..7d9455428650 100644 --- a/core/java/android/bluetooth/BluetoothAdapter.java +++ b/core/java/android/bluetooth/BluetoothAdapter.java @@ -105,6 +105,8 @@ public final class BluetoothAdapter { /** * Activity Action: Show a system activity that requests discoverable mode. + * <p>This activity will also request the user to turn on Bluetooth if it + * is not currently enabled. * <p>Discoverable mode is equivalent to {@link * #SCAN_MODE_CONNECTABLE_DISCOVERABLE}. It allows remote devices to see * this Bluetooth adapter when they perform a discovery. @@ -120,7 +122,7 @@ public final class BluetoothAdapter { * value if the user rejected discoverability. * <p>Applications can also listen for {@link #ACTION_SCAN_MODE_CHANGED} * for global notification whenever the scan mode changes. - * <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN} + * <p>Requires {@link android.Manifest.permission#BLUETOOTH} */ @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) public static final String ACTION_REQUEST_DISCOVERABLE = @@ -136,6 +138,24 @@ public final class BluetoothAdapter { "android.bluetooth.adapter.extra.DISCOVERABLE_DURATION"; /** + * Activity Action: Show a system activity that allows the user to turn on + * Bluetooth. + * <p>This system activity will return once Bluetooth has completed turning + * on, or the user has decided not to turn Bluetooth on. + * <p>Notification of the result of this activity is posted using the + * {@link android.app.Activity#onActivityResult} callback. The + * <code>resultCode</code> + * will be negative if the user did not turn on Bluetooth, and non-negative + * if Bluetooth has been turned on. + * <p>Applications can also listen for {@link #ACTION_STATE_CHANGED} + * for global notification whenever Bluetooth is turned on or off. + * <p>Requires {@link android.Manifest.permission#BLUETOOTH} + */ + @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) + public static final String ACTION_REQUEST_ENABLE = + "android.bluetooth.adapter.action.REQUEST_ENABLE"; + + /** * Broadcast Action: Indicates the Bluetooth scan mode of the local Adapter * has changed. * <p>Always contains the extra fields {@link #EXTRA_SCAN_MODE} and {@link |
