Merge "Make BluetoothHeadset APIs used by Telecom into System APIs" am: c3c651dd07
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1932883 Change-Id: I6357b00fff28a1c00796d16c9717f990686fe27d
This commit is contained in:
commit
9a9f985fd2
@ -274,6 +274,7 @@ applications that come with the platform
|
||||
<privapp-permissions package="com.android.server.telecom">
|
||||
<permission name="android.permission.BIND_CONNECTION_SERVICE"/>
|
||||
<permission name="android.permission.BIND_INCALL_SERVICE"/>
|
||||
<permission name="android.permission.BLUETOOTH_PRIVILEGED"/>
|
||||
<permission name="android.permission.CALL_PRIVILEGED"/>
|
||||
<permission name="android.permission.HANDLE_CAR_MODE_CHANGES"/>
|
||||
<permission name="android.permission.INTERACT_ACROSS_USERS"/>
|
||||
|
@ -140,13 +140,6 @@ public class HeadsetProfile implements LocalBluetoothProfile {
|
||||
return (activeDevices.size() > 0) ? activeDevices.get(0) : null;
|
||||
}
|
||||
|
||||
public boolean isAudioOn() {
|
||||
if (mService == null) {
|
||||
return false;
|
||||
}
|
||||
return mService.isAudioOn();
|
||||
}
|
||||
|
||||
public int getAudioState(BluetoothDevice device) {
|
||||
if (mService == null) {
|
||||
return BluetoothHeadset.STATE_AUDIO_DISCONNECTED;
|
||||
|
@ -54,15 +54,6 @@ public class HeadsetProfileTest {
|
||||
mServiceListener.onServiceConnected(BluetoothProfile.HEADSET, mService);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void bluetoothProfile_shouldReturnTheAudioStatusFromBlueToothHeadsetService() {
|
||||
when(mService.isAudioOn()).thenReturn(true);
|
||||
assertThat(mProfile.isAudioOn()).isTrue();
|
||||
|
||||
when(mService.isAudioOn()).thenReturn(false);
|
||||
assertThat(mProfile.isAudioOn()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHeadsetProfile_shouldReturnAudioState() {
|
||||
when(mService.getAudioState(mBluetoothDevice)).
|
||||
|
@ -102,8 +102,6 @@ public class BtHelper {
|
||||
/*package*/ static final int SCO_MODE_UNDEFINED = -1;
|
||||
// SCO audio mode is virtual voice call (BluetoothHeadset.startScoUsingVirtualVoiceCall())
|
||||
/*package*/ static final int SCO_MODE_VIRTUAL_CALL = 0;
|
||||
// SCO audio mode is raw audio (BluetoothHeadset.connectAudio())
|
||||
private static final int SCO_MODE_RAW = 1;
|
||||
// SCO audio mode is Voice Recognition (BluetoothHeadset.startVoiceRecognition())
|
||||
private static final int SCO_MODE_VR = 2;
|
||||
// max valid SCO audio mode values
|
||||
@ -122,8 +120,6 @@ public class BtHelper {
|
||||
return "SCO_MODE_UNDEFINED";
|
||||
case SCO_MODE_VIRTUAL_CALL:
|
||||
return "SCO_MODE_VIRTUAL_CALL";
|
||||
case SCO_MODE_RAW:
|
||||
return "SCO_MODE_RAW";
|
||||
case SCO_MODE_VR:
|
||||
return "SCO_MODE_VR";
|
||||
default:
|
||||
@ -814,8 +810,6 @@ public class BtHelper {
|
||||
private static boolean disconnectBluetoothScoAudioHelper(BluetoothHeadset bluetoothHeadset,
|
||||
BluetoothDevice device, int scoAudioMode) {
|
||||
switch (scoAudioMode) {
|
||||
case SCO_MODE_RAW:
|
||||
return bluetoothHeadset.disconnectAudio();
|
||||
case SCO_MODE_VIRTUAL_CALL:
|
||||
return bluetoothHeadset.stopScoUsingVirtualVoiceCall();
|
||||
case SCO_MODE_VR:
|
||||
@ -828,8 +822,6 @@ public class BtHelper {
|
||||
private static boolean connectBluetoothScoAudioHelper(BluetoothHeadset bluetoothHeadset,
|
||||
BluetoothDevice device, int scoAudioMode) {
|
||||
switch (scoAudioMode) {
|
||||
case SCO_MODE_RAW:
|
||||
return bluetoothHeadset.connectAudio();
|
||||
case SCO_MODE_VIRTUAL_CALL:
|
||||
return bluetoothHeadset.startScoUsingVirtualVoiceCall();
|
||||
case SCO_MODE_VR:
|
||||
|
Loading…
x
Reference in New Issue
Block a user