Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 50c8a39b authored by Eric Laurent's avatar Eric Laurent
Browse files

Revert "AudioDeviceBroker: fix deadlock with setA2dpSuspended"

This reverts commit 2bd07ff1.
Bug: 281786703
Test: make

Change-Id: I5ed93786daf6bd34a249d231b2831aab158d6476
parent 322d6946
Loading
Loading
Loading
Loading
+0 −17
Original line number Diff line number Diff line
@@ -971,10 +971,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
        }
    }

    /*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: "
@@ -1003,11 +999,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
        }
    }

    /*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: "
@@ -1821,12 +1812,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
                    final int capturePreset = msg.arg1;
                    mDeviceInventory.onSaveClearPreferredDevicesForCapturePreset(capturePreset);
                } 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: {
                    final BluetoothDevice btDevice = (BluetoothDevice) msg.obj;
                    BtHelper.onNotifyPreferredAudioProfileApplied(btDevice);
@@ -1905,8 +1890,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_REMOVE_NDEF_DEVICE_FOR_STRATEGY = 48;
    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;

+2 −2
Original line number Diff line number Diff line
@@ -6412,7 +6412,7 @@ public class AudioService extends IAudioService.Stub
        final String eventSource = new StringBuilder("setA2dpSuspended(").append(enable)
                .append(") from u/pid:").append(Binder.getCallingUid()).append("/")
                .append(Binder.getCallingPid()).toString();
        mDeviceBroker.postSetA2dpSuspended(enable, eventSource);
        mDeviceBroker.setA2dpSuspended(enable, false /*internal*/, eventSource);
    }
    /** @see AudioManager#setA2dpSuspended(boolean) */
@@ -6422,7 +6422,7 @@ public class AudioService extends IAudioService.Stub
        final String eventSource = new StringBuilder("setLeAudioSuspended(").append(enable)
                .append(") from u/pid:").append(Binder.getCallingUid()).append("/")
                .append(Binder.getCallingPid()).toString();
        mDeviceBroker.postSetLeAudioSuspended(enable, eventSource);
        mDeviceBroker.setLeAudioSuspended(enable, false /*internal*/, eventSource);
    }
    /** @see AudioManager#isBluetoothScoOn()