Merge "Bluetooth: fix comments on Volume Control Profile review" into sc-dev-plus-aosp
This commit is contained in:
committed by
Android (Google) Code Review
commit
8776aff8ee
@@ -9460,7 +9460,6 @@ package android.bluetooth {
|
|||||||
field public static final int STATE_CONNECTING = 1; // 0x1
|
field public static final int STATE_CONNECTING = 1; // 0x1
|
||||||
field public static final int STATE_DISCONNECTED = 0; // 0x0
|
field public static final int STATE_DISCONNECTED = 0; // 0x0
|
||||||
field public static final int STATE_DISCONNECTING = 3; // 0x3
|
field public static final int STATE_DISCONNECTING = 3; // 0x3
|
||||||
field public static final int VOLUME_CONTROL = 23; // 0x17
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static interface BluetoothProfile.ServiceListener {
|
public static interface BluetoothProfile.ServiceListener {
|
||||||
|
|||||||
@@ -2087,6 +2087,7 @@ package android.bluetooth {
|
|||||||
field public static final int PBAP_CLIENT = 17; // 0x11
|
field public static final int PBAP_CLIENT = 17; // 0x11
|
||||||
field @Deprecated public static final int PRIORITY_OFF = 0; // 0x0
|
field @Deprecated public static final int PRIORITY_OFF = 0; // 0x0
|
||||||
field @Deprecated public static final int PRIORITY_ON = 100; // 0x64
|
field @Deprecated public static final int PRIORITY_ON = 100; // 0x64
|
||||||
|
field public static final int VOLUME_CONTROL = 23; // 0x17
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class BluetoothStatusCodes {
|
public final class BluetoothStatusCodes {
|
||||||
|
|||||||
@@ -214,7 +214,9 @@ public interface BluetoothProfile {
|
|||||||
/**
|
/**
|
||||||
* Volume Control profile
|
* Volume Control profile
|
||||||
*
|
*
|
||||||
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@SystemApi
|
||||||
int VOLUME_CONTROL = 23;
|
int VOLUME_CONTROL = 23;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -113,7 +113,6 @@ public final class BluetoothVolumeControl implements BluetoothProfile, AutoClose
|
|||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*package*/
|
|
||||||
@RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
|
@RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
|
||||||
public void close() {
|
public void close() {
|
||||||
mProfileConnector.disconnect();
|
mProfileConnector.disconnect();
|
||||||
@@ -230,27 +229,6 @@ public final class BluetoothVolumeControl implements BluetoothProfile, AutoClose
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set priority of the profile
|
|
||||||
*
|
|
||||||
* <p> The device should already be paired.
|
|
||||||
* Priority can be one of {@link #PRIORITY_ON} or {@link #PRIORITY_OFF},
|
|
||||||
*
|
|
||||||
* @param device Paired bluetooth device
|
|
||||||
* @param priority
|
|
||||||
* @return true if priority is set, false on error
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
@RequiresBluetoothConnectPermission
|
|
||||||
@RequiresPermission(allOf = {
|
|
||||||
android.Manifest.permission.BLUETOOTH_CONNECT,
|
|
||||||
android.Manifest.permission.BLUETOOTH_PRIVILEGED,
|
|
||||||
})
|
|
||||||
public boolean setPriority(BluetoothDevice device, int priority) {
|
|
||||||
if (DBG) log("setPriority(" + device + ", " + priority + ")");
|
|
||||||
return setConnectionPolicy(device, BluetoothAdapter.priorityToConnectionPolicy(priority));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set connection policy of the profile
|
* Set connection policy of the profile
|
||||||
*
|
*
|
||||||
@@ -289,26 +267,6 @@ public final class BluetoothVolumeControl implements BluetoothProfile, AutoClose
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the priority of the profile.
|
|
||||||
*
|
|
||||||
* <p> The priority can be any of:
|
|
||||||
* {@link #PRIORITY_OFF}, {@link #PRIORITY_ON}, {@link #PRIORITY_UNDEFINED}
|
|
||||||
*
|
|
||||||
* @param device Bluetooth device
|
|
||||||
* @return priority of the device
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
@RequiresBluetoothConnectPermission
|
|
||||||
@RequiresPermission(allOf = {
|
|
||||||
android.Manifest.permission.BLUETOOTH_CONNECT,
|
|
||||||
android.Manifest.permission.BLUETOOTH_PRIVILEGED,
|
|
||||||
})
|
|
||||||
public int getPriority(BluetoothDevice device) {
|
|
||||||
if (VDBG) log("getPriority(" + device + ")");
|
|
||||||
return BluetoothAdapter.connectionPolicyToPriority(getConnectionPolicy(device));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the connection policy of the profile.
|
* Get the connection policy of the profile.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user