diff options
author | Ted Wang <tedwang@google.com> | 2020-08-27 18:22:41 +0800 |
---|---|---|
committer | Ted Wang <tedwang@google.com> | 2020-09-16 10:31:25 +0800 |
commit | bd5a867727010fa04efe63096d7b00b547baec6e (patch) | |
tree | 67493002a684a069e666685d42812739e408678a /framework/java | |
parent | d43da5a27805e51d4a99f96e7be376bd9ab3e5a1 (diff) |
Add action for Bluetooth tethering state changed
Add new action for Bluetooth tethering state changed and extra for
broadcasting Bluetooth tethering state changed.
Tag: #feature
Bug: 138688805
Test: Manual
Change-Id: Ie0f848448f9717a6a1233d0dbb0785da7d30dc81
Diffstat (limited to 'framework/java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothPan.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothPan.java b/framework/java/android/bluetooth/BluetoothPan.java index bfc28fae6e..4698b077ff 100644 --- a/framework/java/android/bluetooth/BluetoothPan.java +++ b/framework/java/android/bluetooth/BluetoothPan.java @@ -89,6 +89,33 @@ public final class BluetoothPan implements BluetoothProfile { @SuppressLint("ActionValue") public static final String EXTRA_LOCAL_ROLE = "android.bluetooth.pan.extra.LOCAL_ROLE"; + /** + * Intent used to broadcast the change in tethering state of the Pan + * Profile + * + * <p>This intent will have 1 extra: + * <ul> + * <li> {@link #EXTRA_TETHERING_STATE} - The current state of Bluetooth + * tethering. </li> + * </ul> + * + * <p> {@link #EXTRA_TETHERING_STATE} can be any of {@link #TETHERING_STATE_OFF} or + * {@link #TETHERING_STATE_ON} + * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission to + * receive. + */ + @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + public static final String ACTION_TETHERING_STATE_CHANGED = + "android.bluetooth.action.TETHERING_STATE_CHANGED"; + + /** + * Extra for {@link #ACTION_TETHERING_STATE_CHANGED} intent + * The tethering state of the PAN profile. + * It can be one of {@link #TETHERING_STATE_OFF} or {@link #TETHERING_STATE_ON}. + */ + public static final String EXTRA_TETHERING_STATE = + "android.bluetooth.extra.TETHERING_STATE"; + /** @hide */ @IntDef({PAN_ROLE_NONE, LOCAL_NAP_ROLE, LOCAL_PANU_ROLE}) @Retention(RetentionPolicy.SOURCE) @@ -114,6 +141,14 @@ public final class BluetoothPan implements BluetoothProfile { public static final int REMOTE_PANU_ROLE = 2; + /** @hide **/ + @IntDef({TETHERING_STATE_OFF, TETHERING_STATE_ON}) + @Retention(RetentionPolicy.SOURCE) + public @interface TetheringState{} + + public static final int TETHERING_STATE_OFF = 1; + + public static final int TETHERING_STATE_ON = 2; /** * Return codes for the connect and disconnect Bluez / Dbus calls. * |