Merge "Add action for Bluetooth tethering state changed" am: cf44a015e8 am: 773810d198
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1422889 Change-Id: I899bd778c56b32139405636dc5c434e4138f1c1e
This commit is contained in:
@@ -1578,12 +1578,16 @@ package android.bluetooth {
|
|||||||
method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public void setBluetoothTethering(boolean);
|
method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public void setBluetoothTethering(boolean);
|
||||||
method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
|
method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
|
||||||
field public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.pan.profile.action.CONNECTION_STATE_CHANGED";
|
field public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.pan.profile.action.CONNECTION_STATE_CHANGED";
|
||||||
|
field public static final String ACTION_TETHERING_STATE_CHANGED = "android.bluetooth.action.TETHERING_STATE_CHANGED";
|
||||||
field public static final String EXTRA_LOCAL_ROLE = "android.bluetooth.pan.extra.LOCAL_ROLE";
|
field public static final String EXTRA_LOCAL_ROLE = "android.bluetooth.pan.extra.LOCAL_ROLE";
|
||||||
|
field public static final String EXTRA_TETHERING_STATE = "android.bluetooth.extra.TETHERING_STATE";
|
||||||
field public static final int LOCAL_NAP_ROLE = 1; // 0x1
|
field public static final int LOCAL_NAP_ROLE = 1; // 0x1
|
||||||
field public static final int LOCAL_PANU_ROLE = 2; // 0x2
|
field public static final int LOCAL_PANU_ROLE = 2; // 0x2
|
||||||
field public static final int PAN_ROLE_NONE = 0; // 0x0
|
field public static final int PAN_ROLE_NONE = 0; // 0x0
|
||||||
field public static final int REMOTE_NAP_ROLE = 1; // 0x1
|
field public static final int REMOTE_NAP_ROLE = 1; // 0x1
|
||||||
field public static final int REMOTE_PANU_ROLE = 2; // 0x2
|
field public static final int REMOTE_PANU_ROLE = 2; // 0x2
|
||||||
|
field public static final int TETHERING_STATE_OFF = 1; // 0x1
|
||||||
|
field public static final int TETHERING_STATE_ON = 2; // 0x2
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BluetoothPbap implements android.bluetooth.BluetoothProfile {
|
public class BluetoothPbap implements android.bluetooth.BluetoothProfile {
|
||||||
|
|||||||
@@ -89,6 +89,33 @@ public final class BluetoothPan implements BluetoothProfile {
|
|||||||
@SuppressLint("ActionValue")
|
@SuppressLint("ActionValue")
|
||||||
public static final String EXTRA_LOCAL_ROLE = "android.bluetooth.pan.extra.LOCAL_ROLE";
|
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 */
|
/** @hide */
|
||||||
@IntDef({PAN_ROLE_NONE, LOCAL_NAP_ROLE, LOCAL_PANU_ROLE})
|
@IntDef({PAN_ROLE_NONE, LOCAL_NAP_ROLE, LOCAL_PANU_ROLE})
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
@@ -114,6 +141,14 @@ public final class BluetoothPan implements BluetoothProfile {
|
|||||||
|
|
||||||
public static final int REMOTE_PANU_ROLE = 2;
|
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.
|
* Return codes for the connect and disconnect Bluez / Dbus calls.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -236,6 +236,8 @@
|
|||||||
android:name="com.android.bluetooth.BluetoothMapContentObserver.action.MESSAGE_DELIVERY" />
|
android:name="com.android.bluetooth.BluetoothMapContentObserver.action.MESSAGE_DELIVERY" />
|
||||||
<protected-broadcast
|
<protected-broadcast
|
||||||
android:name="android.bluetooth.pan.profile.action.CONNECTION_STATE_CHANGED" />
|
android:name="android.bluetooth.pan.profile.action.CONNECTION_STATE_CHANGED" />
|
||||||
|
<protected-broadcast
|
||||||
|
android:name="android.bluetooth.action.TETHERING_STATE_CHANGED" />
|
||||||
<protected-broadcast android:name="android.bluetooth.pbap.profile.action.CONNECTION_STATE_CHANGED" />
|
<protected-broadcast android:name="android.bluetooth.pbap.profile.action.CONNECTION_STATE_CHANGED" />
|
||||||
<protected-broadcast android:name="android.bluetooth.pbapclient.profile.action.CONNECTION_STATE_CHANGED" />
|
<protected-broadcast android:name="android.bluetooth.pbapclient.profile.action.CONNECTION_STATE_CHANGED" />
|
||||||
<protected-broadcast android:name="android.bluetooth.sap.profile.action.CONNECTION_STATE_CHANGED" />
|
<protected-broadcast android:name="android.bluetooth.sap.profile.action.CONNECTION_STATE_CHANGED" />
|
||||||
|
|||||||
@@ -1526,12 +1526,16 @@ package android.bluetooth {
|
|||||||
method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public void setBluetoothTethering(boolean);
|
method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public void setBluetoothTethering(boolean);
|
||||||
method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
|
method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
|
||||||
field public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.pan.profile.action.CONNECTION_STATE_CHANGED";
|
field public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.pan.profile.action.CONNECTION_STATE_CHANGED";
|
||||||
|
field public static final String ACTION_TETHERING_STATE_CHANGED = "android.bluetooth.action.TETHERING_STATE_CHANGED";
|
||||||
field public static final String EXTRA_LOCAL_ROLE = "android.bluetooth.pan.extra.LOCAL_ROLE";
|
field public static final String EXTRA_LOCAL_ROLE = "android.bluetooth.pan.extra.LOCAL_ROLE";
|
||||||
|
field public static final String EXTRA_TETHERING_STATE = "android.bluetooth.extra.TETHERING_STATE";
|
||||||
field public static final int LOCAL_NAP_ROLE = 1; // 0x1
|
field public static final int LOCAL_NAP_ROLE = 1; // 0x1
|
||||||
field public static final int LOCAL_PANU_ROLE = 2; // 0x2
|
field public static final int LOCAL_PANU_ROLE = 2; // 0x2
|
||||||
field public static final int PAN_ROLE_NONE = 0; // 0x0
|
field public static final int PAN_ROLE_NONE = 0; // 0x0
|
||||||
field public static final int REMOTE_NAP_ROLE = 1; // 0x1
|
field public static final int REMOTE_NAP_ROLE = 1; // 0x1
|
||||||
field public static final int REMOTE_PANU_ROLE = 2; // 0x2
|
field public static final int REMOTE_PANU_ROLE = 2; // 0x2
|
||||||
|
field public static final int TETHERING_STATE_OFF = 1; // 0x1
|
||||||
|
field public static final int TETHERING_STATE_ON = 2; // 0x2
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BluetoothPbap implements android.bluetooth.BluetoothProfile {
|
public class BluetoothPbap implements android.bluetooth.BluetoothProfile {
|
||||||
|
|||||||
Reference in New Issue
Block a user