Merge changes I81bda912,I5ed93786 into udc-dev am: 9ccb30e3ae am: ee7697fe0c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23154100 Change-Id: Ic609127e2455c6e3a22eefc0856396009333cca4 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -3730,12 +3730,7 @@ public class AudioManager {
|
|||||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||||
@RequiresPermission(Manifest.permission.BLUETOOTH_STACK)
|
@RequiresPermission(Manifest.permission.BLUETOOTH_STACK)
|
||||||
public void setA2dpSuspended(boolean enable) {
|
public void setA2dpSuspended(boolean enable) {
|
||||||
final IAudioService service = getService();
|
AudioSystem.setParameters("A2dpSuspended=" + enable);
|
||||||
try {
|
|
||||||
service.setA2dpSuspended(enable);
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
throw e.rethrowFromSystemServer();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -3748,12 +3743,7 @@ public class AudioManager {
|
|||||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||||
@RequiresPermission(Manifest.permission.BLUETOOTH_STACK)
|
@RequiresPermission(Manifest.permission.BLUETOOTH_STACK)
|
||||||
public void setLeAudioSuspended(boolean enable) {
|
public void setLeAudioSuspended(boolean enable) {
|
||||||
final IAudioService service = getService();
|
AudioSystem.setParameters("LeAudioSuspended=" + enable);
|
||||||
try {
|
|
||||||
service.setLeAudioSuspended(enable);
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
throw e.rethrowFromSystemServer();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -231,12 +231,6 @@ interface IAudioService {
|
|||||||
|
|
||||||
void setBluetoothScoOn(boolean on);
|
void setBluetoothScoOn(boolean on);
|
||||||
|
|
||||||
@EnforcePermission("BLUETOOTH_STACK")
|
|
||||||
void setA2dpSuspended(boolean on);
|
|
||||||
|
|
||||||
@EnforcePermission("BLUETOOTH_STACK")
|
|
||||||
void setLeAudioSuspended(boolean enable);
|
|
||||||
|
|
||||||
boolean isBluetoothScoOn();
|
boolean isBluetoothScoOn();
|
||||||
|
|
||||||
void setBluetoothA2dpOn(boolean on);
|
void setBluetoothA2dpOn(boolean on);
|
||||||
|
|||||||
@@ -209,7 +209,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
private void init() {
|
private void init() {
|
||||||
setupMessaging(mContext);
|
setupMessaging(mContext);
|
||||||
|
|
||||||
initAudioHalBluetoothState();
|
|
||||||
initRoutingStrategyIds();
|
initRoutingStrategyIds();
|
||||||
mPreferredCommunicationDevice = null;
|
mPreferredCommunicationDevice = null;
|
||||||
updateActiveCommunicationDevice();
|
updateActiveCommunicationDevice();
|
||||||
@@ -865,100 +864,10 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Current Bluetooth SCO audio active state indicated by BtHelper via setBluetoothScoOn().
|
/**
|
||||||
@GuardedBy("mDeviceStateLock")
|
* Current Bluetooth SCO audio active state indicated by BtHelper via setBluetoothScoOn().
|
||||||
|
*/
|
||||||
private boolean mBluetoothScoOn;
|
private boolean mBluetoothScoOn;
|
||||||
// value of BT_SCO parameter currently applied to audio HAL.
|
|
||||||
@GuardedBy("mDeviceStateLock")
|
|
||||||
private boolean mBluetoothScoOnApplied;
|
|
||||||
|
|
||||||
// A2DP suspend state requested by AudioManager.setA2dpSuspended() API.
|
|
||||||
@GuardedBy("mDeviceStateLock")
|
|
||||||
private boolean mBluetoothA2dpSuspendedExt;
|
|
||||||
// A2DP suspend state requested by AudioDeviceInventory.
|
|
||||||
@GuardedBy("mDeviceStateLock")
|
|
||||||
private boolean mBluetoothA2dpSuspendedInt;
|
|
||||||
// value of BT_A2dpSuspendedSCO parameter currently applied to audio HAL.
|
|
||||||
@GuardedBy("mDeviceStateLock")
|
|
||||||
private boolean mBluetoothA2dpSuspendedApplied;
|
|
||||||
|
|
||||||
// LE Audio suspend state requested by AudioManager.setLeAudioSuspended() API.
|
|
||||||
@GuardedBy("mDeviceStateLock")
|
|
||||||
private boolean mBluetoothLeSuspendedExt;
|
|
||||||
// LE Audio suspend state requested by AudioDeviceInventory.
|
|
||||||
@GuardedBy("mDeviceStateLock")
|
|
||||||
private boolean mBluetoothLeSuspendedInt;
|
|
||||||
// value of LeAudioSuspended parameter currently applied to audio HAL.
|
|
||||||
@GuardedBy("mDeviceStateLock")
|
|
||||||
private boolean mBluetoothLeSuspendedApplied;
|
|
||||||
|
|
||||||
private void initAudioHalBluetoothState() {
|
|
||||||
mBluetoothScoOnApplied = false;
|
|
||||||
AudioSystem.setParameters("BT_SCO=off");
|
|
||||||
mBluetoothA2dpSuspendedApplied = false;
|
|
||||||
AudioSystem.setParameters("A2dpSuspended=false");
|
|
||||||
mBluetoothLeSuspendedApplied = false;
|
|
||||||
AudioSystem.setParameters("LeAudioSuspended=false");
|
|
||||||
}
|
|
||||||
|
|
||||||
@GuardedBy("mDeviceStateLock")
|
|
||||||
private void updateAudioHalBluetoothState() {
|
|
||||||
if (mBluetoothScoOn != mBluetoothScoOnApplied) {
|
|
||||||
if (AudioService.DEBUG_COMM_RTE) {
|
|
||||||
Log.v(TAG, "updateAudioHalBluetoothState() mBluetoothScoOn: "
|
|
||||||
+ mBluetoothScoOn + ", mBluetoothScoOnApplied: " + mBluetoothScoOnApplied);
|
|
||||||
}
|
|
||||||
if (mBluetoothScoOn) {
|
|
||||||
if (!mBluetoothA2dpSuspendedApplied) {
|
|
||||||
AudioSystem.setParameters("A2dpSuspended=true");
|
|
||||||
mBluetoothA2dpSuspendedApplied = true;
|
|
||||||
}
|
|
||||||
if (!mBluetoothLeSuspendedApplied) {
|
|
||||||
AudioSystem.setParameters("LeAudioSuspended=true");
|
|
||||||
mBluetoothLeSuspendedApplied = true;
|
|
||||||
}
|
|
||||||
AudioSystem.setParameters("BT_SCO=on");
|
|
||||||
} else {
|
|
||||||
AudioSystem.setParameters("BT_SCO=off");
|
|
||||||
}
|
|
||||||
mBluetoothScoOnApplied = mBluetoothScoOn;
|
|
||||||
}
|
|
||||||
if (!mBluetoothScoOnApplied) {
|
|
||||||
if ((mBluetoothA2dpSuspendedExt || mBluetoothA2dpSuspendedInt)
|
|
||||||
!= mBluetoothA2dpSuspendedApplied) {
|
|
||||||
if (AudioService.DEBUG_COMM_RTE) {
|
|
||||||
Log.v(TAG, "updateAudioHalBluetoothState() mBluetoothA2dpSuspendedExt: "
|
|
||||||
+ mBluetoothA2dpSuspendedExt
|
|
||||||
+ ", mBluetoothA2dpSuspendedInt: " + mBluetoothA2dpSuspendedInt
|
|
||||||
+ ", mBluetoothA2dpSuspendedApplied: "
|
|
||||||
+ mBluetoothA2dpSuspendedApplied);
|
|
||||||
}
|
|
||||||
mBluetoothA2dpSuspendedApplied =
|
|
||||||
mBluetoothA2dpSuspendedExt || mBluetoothA2dpSuspendedInt;
|
|
||||||
if (mBluetoothA2dpSuspendedApplied) {
|
|
||||||
AudioSystem.setParameters("A2dpSuspended=true");
|
|
||||||
} else {
|
|
||||||
AudioSystem.setParameters("A2dpSuspended=false");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((mBluetoothLeSuspendedExt || mBluetoothLeSuspendedInt)
|
|
||||||
!= mBluetoothLeSuspendedApplied) {
|
|
||||||
if (AudioService.DEBUG_COMM_RTE) {
|
|
||||||
Log.v(TAG, "updateAudioHalBluetoothState() mBluetoothLeSuspendedExt: "
|
|
||||||
+ mBluetoothLeSuspendedExt
|
|
||||||
+ ", mBluetoothLeSuspendedInt: " + mBluetoothLeSuspendedInt
|
|
||||||
+ ", mBluetoothLeSuspendedApplied: " + mBluetoothLeSuspendedApplied);
|
|
||||||
}
|
|
||||||
mBluetoothLeSuspendedApplied =
|
|
||||||
mBluetoothLeSuspendedExt || mBluetoothLeSuspendedInt;
|
|
||||||
if (mBluetoothLeSuspendedApplied) {
|
|
||||||
AudioSystem.setParameters("LeAudioSuspended=true");
|
|
||||||
} else {
|
|
||||||
AudioSystem.setParameters("LeAudioSuspended=false");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*package*/ void setBluetoothScoOn(boolean on, String eventSource) {
|
/*package*/ void setBluetoothScoOn(boolean on, String eventSource) {
|
||||||
if (AudioService.DEBUG_COMM_RTE) {
|
if (AudioService.DEBUG_COMM_RTE) {
|
||||||
@@ -966,76 +875,10 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
}
|
}
|
||||||
synchronized (mDeviceStateLock) {
|
synchronized (mDeviceStateLock) {
|
||||||
mBluetoothScoOn = on;
|
mBluetoothScoOn = on;
|
||||||
updateAudioHalBluetoothState();
|
|
||||||
postUpdateCommunicationRouteClient(eventSource);
|
postUpdateCommunicationRouteClient(eventSource);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*package*/ void postSetA2dpSuspended(boolean enable, String eventSource) {
|
|
||||||
sendILMsgNoDelay(MSG_IL_SET_A2DP_SUSPENDED, SENDMSG_QUEUE, (enable ? 1 : 0), eventSource);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*package*/ void setA2dpSuspended(boolean enable, boolean internal, String eventSource) {
|
|
||||||
if (AudioService.DEBUG_COMM_RTE) {
|
|
||||||
Log.v(TAG, "setA2dpSuspended source: " + eventSource + ", enable: "
|
|
||||||
+ enable + ", internal: " + internal
|
|
||||||
+ ", mBluetoothA2dpSuspendedInt: " + mBluetoothA2dpSuspendedInt
|
|
||||||
+ ", mBluetoothA2dpSuspendedExt: " + mBluetoothA2dpSuspendedExt);
|
|
||||||
}
|
|
||||||
synchronized (mDeviceStateLock) {
|
|
||||||
if (internal) {
|
|
||||||
mBluetoothA2dpSuspendedInt = enable;
|
|
||||||
} else {
|
|
||||||
mBluetoothA2dpSuspendedExt = enable;
|
|
||||||
}
|
|
||||||
updateAudioHalBluetoothState();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*package*/ void clearA2dpSuspended() {
|
|
||||||
if (AudioService.DEBUG_COMM_RTE) {
|
|
||||||
Log.v(TAG, "clearA2dpSuspended");
|
|
||||||
}
|
|
||||||
synchronized (mDeviceStateLock) {
|
|
||||||
mBluetoothA2dpSuspendedInt = false;
|
|
||||||
mBluetoothA2dpSuspendedExt = false;
|
|
||||||
updateAudioHalBluetoothState();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*package*/ void postSetLeAudioSuspended(boolean enable, String eventSource) {
|
|
||||||
sendILMsgNoDelay(
|
|
||||||
MSG_IL_SET_LEAUDIO_SUSPENDED, SENDMSG_QUEUE, (enable ? 1 : 0), eventSource);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*package*/ void setLeAudioSuspended(boolean enable, boolean internal, String eventSource) {
|
|
||||||
if (AudioService.DEBUG_COMM_RTE) {
|
|
||||||
Log.v(TAG, "setLeAudioSuspended source: " + eventSource + ", enable: "
|
|
||||||
+ enable + ", internal: " + internal
|
|
||||||
+ ", mBluetoothLeSuspendedInt: " + mBluetoothA2dpSuspendedInt
|
|
||||||
+ ", mBluetoothLeSuspendedExt: " + mBluetoothA2dpSuspendedExt);
|
|
||||||
}
|
|
||||||
synchronized (mDeviceStateLock) {
|
|
||||||
if (internal) {
|
|
||||||
mBluetoothLeSuspendedInt = enable;
|
|
||||||
} else {
|
|
||||||
mBluetoothLeSuspendedExt = enable;
|
|
||||||
}
|
|
||||||
updateAudioHalBluetoothState();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*package*/ void clearLeAudioSuspended() {
|
|
||||||
if (AudioService.DEBUG_COMM_RTE) {
|
|
||||||
Log.v(TAG, "clearLeAudioSuspended");
|
|
||||||
}
|
|
||||||
synchronized (mDeviceStateLock) {
|
|
||||||
mBluetoothLeSuspendedInt = false;
|
|
||||||
mBluetoothLeSuspendedExt = false;
|
|
||||||
updateAudioHalBluetoothState();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*package*/ AudioRoutesInfo startWatchingRoutes(IAudioRoutesObserver observer) {
|
/*package*/ AudioRoutesInfo startWatchingRoutes(IAudioRoutesObserver observer) {
|
||||||
synchronized (mDeviceStateLock) {
|
synchronized (mDeviceStateLock) {
|
||||||
return mDeviceInventory.startWatchingRoutes(observer);
|
return mDeviceInventory.startWatchingRoutes(observer);
|
||||||
@@ -1821,12 +1664,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
final int capturePreset = msg.arg1;
|
final int capturePreset = msg.arg1;
|
||||||
mDeviceInventory.onSaveClearPreferredDevicesForCapturePreset(capturePreset);
|
mDeviceInventory.onSaveClearPreferredDevicesForCapturePreset(capturePreset);
|
||||||
} break;
|
} break;
|
||||||
case MSG_IL_SET_A2DP_SUSPENDED: {
|
|
||||||
setA2dpSuspended((msg.arg1 == 1), false /*internal*/, (String) msg.obj);
|
|
||||||
} break;
|
|
||||||
case MSG_IL_SET_LEAUDIO_SUSPENDED: {
|
|
||||||
setLeAudioSuspended((msg.arg1 == 1), false /*internal*/, (String) msg.obj);
|
|
||||||
} break;
|
|
||||||
case MSG_L_NOTIFY_PREFERRED_AUDIOPROFILE_APPLIED: {
|
case MSG_L_NOTIFY_PREFERRED_AUDIOPROFILE_APPLIED: {
|
||||||
final BluetoothDevice btDevice = (BluetoothDevice) msg.obj;
|
final BluetoothDevice btDevice = (BluetoothDevice) msg.obj;
|
||||||
BtHelper.onNotifyPreferredAudioProfileApplied(btDevice);
|
BtHelper.onNotifyPreferredAudioProfileApplied(btDevice);
|
||||||
@@ -1905,8 +1742,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
private static final int MSG_IL_SAVE_NDEF_DEVICE_FOR_STRATEGY = 47;
|
private static final int MSG_IL_SAVE_NDEF_DEVICE_FOR_STRATEGY = 47;
|
||||||
private static final int MSG_IL_SAVE_REMOVE_NDEF_DEVICE_FOR_STRATEGY = 48;
|
private static final int MSG_IL_SAVE_REMOVE_NDEF_DEVICE_FOR_STRATEGY = 48;
|
||||||
private static final int MSG_IL_BTLEAUDIO_TIMEOUT = 49;
|
private static final int MSG_IL_BTLEAUDIO_TIMEOUT = 49;
|
||||||
private static final int MSG_IL_SET_A2DP_SUSPENDED = 50;
|
|
||||||
private static final int MSG_IL_SET_LEAUDIO_SUSPENDED = 51;
|
|
||||||
|
|
||||||
private static final int MSG_L_NOTIFY_PREFERRED_AUDIOPROFILE_APPLIED = 52;
|
private static final int MSG_L_NOTIFY_PREFERRED_AUDIOPROFILE_APPLIED = 52;
|
||||||
|
|
||||||
@@ -2185,6 +2020,12 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
"updateCommunicationRoute, preferredCommunicationDevice: "
|
"updateCommunicationRoute, preferredCommunicationDevice: "
|
||||||
+ preferredCommunicationDevice + " eventSource: " + eventSource)));
|
+ preferredCommunicationDevice + " eventSource: " + eventSource)));
|
||||||
|
|
||||||
|
if (preferredCommunicationDevice == null
|
||||||
|
|| preferredCommunicationDevice.getType() != AudioDeviceInfo.TYPE_BLUETOOTH_SCO) {
|
||||||
|
AudioSystem.setParameters("BT_SCO=off");
|
||||||
|
} else {
|
||||||
|
AudioSystem.setParameters("BT_SCO=on");
|
||||||
|
}
|
||||||
if (preferredCommunicationDevice == null) {
|
if (preferredCommunicationDevice == null) {
|
||||||
AudioDeviceAttributes defaultDevice = getDefaultCommunicationDevice();
|
AudioDeviceAttributes defaultDevice = getDefaultCommunicationDevice();
|
||||||
if (defaultDevice != null) {
|
if (defaultDevice != null) {
|
||||||
|
|||||||
@@ -1478,7 +1478,7 @@ public class AudioDeviceInventory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reset A2DP suspend state each time a new sink is connected
|
// Reset A2DP suspend state each time a new sink is connected
|
||||||
mDeviceBroker.clearA2dpSuspended();
|
mAudioSystem.setParameters("A2dpSuspended=false");
|
||||||
|
|
||||||
// The convention for head tracking sensors associated with A2DP devices is to
|
// The convention for head tracking sensors associated with A2DP devices is to
|
||||||
// use a UUID derived from the MAC address as follows:
|
// use a UUID derived from the MAC address as follows:
|
||||||
@@ -1751,8 +1751,7 @@ public class AudioDeviceInventory {
|
|||||||
private void makeA2dpDeviceUnavailableLater(String address, int delayMs) {
|
private void makeA2dpDeviceUnavailableLater(String address, int delayMs) {
|
||||||
// prevent any activity on the A2DP audio output to avoid unwanted
|
// prevent any activity on the A2DP audio output to avoid unwanted
|
||||||
// reconnection of the sink.
|
// reconnection of the sink.
|
||||||
mDeviceBroker.setA2dpSuspended(
|
mAudioSystem.setParameters("A2dpSuspended=true");
|
||||||
true /*enable*/, true /*internal*/, "makeA2dpDeviceUnavailableLater");
|
|
||||||
// retrieve DeviceInfo before removing device
|
// retrieve DeviceInfo before removing device
|
||||||
final String deviceKey =
|
final String deviceKey =
|
||||||
DeviceInfo.makeDeviceListKey(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, address);
|
DeviceInfo.makeDeviceListKey(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, address);
|
||||||
@@ -1899,7 +1898,7 @@ public class AudioDeviceInventory {
|
|||||||
"LE Audio device addr=" + address + " now available").printLog(TAG));
|
"LE Audio device addr=" + address + " now available").printLog(TAG));
|
||||||
}
|
}
|
||||||
// Reset LEA suspend state each time a new sink is connected
|
// Reset LEA suspend state each time a new sink is connected
|
||||||
mDeviceBroker.clearLeAudioSuspended();
|
mAudioSystem.setParameters("LeAudioSuspended=false");
|
||||||
|
|
||||||
UUID sensorUuid = UuidUtils.uuidFromAudioDeviceAttributes(ada);
|
UUID sensorUuid = UuidUtils.uuidFromAudioDeviceAttributes(ada);
|
||||||
mConnectedDevices.put(DeviceInfo.makeDeviceListKey(device, address),
|
mConnectedDevices.put(DeviceInfo.makeDeviceListKey(device, address),
|
||||||
@@ -1954,8 +1953,7 @@ public class AudioDeviceInventory {
|
|||||||
private void makeLeAudioDeviceUnavailableLater(String address, int device, int delayMs) {
|
private void makeLeAudioDeviceUnavailableLater(String address, int device, int delayMs) {
|
||||||
// prevent any activity on the LEA output to avoid unwanted
|
// prevent any activity on the LEA output to avoid unwanted
|
||||||
// reconnection of the sink.
|
// reconnection of the sink.
|
||||||
mDeviceBroker.setLeAudioSuspended(
|
mAudioSystem.setParameters("LeAudioSuspended=true");
|
||||||
true /*enable*/, true /*internal*/, "makeLeAudioDeviceUnavailableLater");
|
|
||||||
// the device will be made unavailable later, so consider it disconnected right away
|
// the device will be made unavailable later, so consider it disconnected right away
|
||||||
mConnectedDevices.remove(DeviceInfo.makeDeviceListKey(device, address));
|
mConnectedDevices.remove(DeviceInfo.makeDeviceListKey(device, address));
|
||||||
// send the delayed message to make the device unavailable later
|
// send the delayed message to make the device unavailable later
|
||||||
|
|||||||
@@ -6412,26 +6412,6 @@ public class AudioService extends IAudioService.Stub
|
|||||||
mDeviceBroker.setBluetoothScoOn(on, eventSource);
|
mDeviceBroker.setBluetoothScoOn(on, eventSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @see AudioManager#setA2dpSuspended(boolean) */
|
|
||||||
@android.annotation.EnforcePermission(android.Manifest.permission.BLUETOOTH_STACK)
|
|
||||||
public void setA2dpSuspended(boolean enable) {
|
|
||||||
super.setA2dpSuspended_enforcePermission();
|
|
||||||
final String eventSource = new StringBuilder("setA2dpSuspended(").append(enable)
|
|
||||||
.append(") from u/pid:").append(Binder.getCallingUid()).append("/")
|
|
||||||
.append(Binder.getCallingPid()).toString();
|
|
||||||
mDeviceBroker.postSetA2dpSuspended(enable, eventSource);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @see AudioManager#setA2dpSuspended(boolean) */
|
|
||||||
@android.annotation.EnforcePermission(android.Manifest.permission.BLUETOOTH_STACK)
|
|
||||||
public void setLeAudioSuspended(boolean enable) {
|
|
||||||
super.setLeAudioSuspended_enforcePermission();
|
|
||||||
final String eventSource = new StringBuilder("setLeAudioSuspended(").append(enable)
|
|
||||||
.append(") from u/pid:").append(Binder.getCallingUid()).append("/")
|
|
||||||
.append(Binder.getCallingPid()).toString();
|
|
||||||
mDeviceBroker.postSetLeAudioSuspended(enable, eventSource);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @see AudioManager#isBluetoothScoOn()
|
/** @see AudioManager#isBluetoothScoOn()
|
||||||
* Note that it doesn't report internal state, but state seen by apps (which may have
|
* Note that it doesn't report internal state, but state seen by apps (which may have
|
||||||
* called setBluetoothScoOn() */
|
* called setBluetoothScoOn() */
|
||||||
|
|||||||
@@ -445,8 +445,8 @@ public class BtHelper {
|
|||||||
/*package*/ synchronized void resetBluetoothSco() {
|
/*package*/ synchronized void resetBluetoothSco() {
|
||||||
mScoAudioState = SCO_STATE_INACTIVE;
|
mScoAudioState = SCO_STATE_INACTIVE;
|
||||||
broadcastScoConnectionState(AudioManager.SCO_AUDIO_STATE_DISCONNECTED);
|
broadcastScoConnectionState(AudioManager.SCO_AUDIO_STATE_DISCONNECTED);
|
||||||
mDeviceBroker.clearA2dpSuspended();
|
AudioSystem.setParameters("A2dpSuspended=false");
|
||||||
mDeviceBroker.clearLeAudioSuspended();
|
AudioSystem.setParameters("LeAudioSuspended=false");
|
||||||
mDeviceBroker.setBluetoothScoOn(false, "resetBluetoothSco");
|
mDeviceBroker.setBluetoothScoOn(false, "resetBluetoothSco");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user