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

Commit 00aad92a authored by Roopa Sattiraju's avatar Roopa Sattiraju
Browse files

Changing AudioManager.VOLUME_CHANGED_ACTION to

AudioManager.ACTION_VOLUME_CHANGED

Bug: 216731966
Test: Compile and Test
Change-Id: I00c53989152030b7bf8f8d09e246a55f129cf623
parent 05b39b42
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ public class AvrcpTargetService extends ProfileService {
                        Log.d(TAG, "request to disconnect device " + device);
                    }
                }
            } else if (action.equals(AudioManager.VOLUME_CHANGED_ACTION)) {
            } else if (action.equals(AudioManager.ACTION_VOLUME_CHANGED)) {
                int streamType = intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, -1);
                if (streamType == AudioManager.STREAM_MUSIC) {
                    int volume = intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_VALUE, 0);
@@ -240,7 +240,7 @@ public class AvrcpTargetService extends ProfileService {
        IntentFilter filter = new IntentFilter();
        filter.addAction(BluetoothA2dp.ACTION_ACTIVE_DEVICE_CHANGED);
        filter.addAction(BluetoothA2dp.ACTION_CONNECTION_STATE_CHANGED);
        filter.addAction(AudioManager.VOLUME_CHANGED_ACTION);
        filter.addAction(AudioManager.ACTION_VOLUME_CHANGED);
        registerReceiver(mReceiver, filter);

        // Only allow the service to be used once it is initialized
+2 −2
Original line number Diff line number Diff line
@@ -170,7 +170,7 @@ public class HeadsetService extends ProfileService {
        // Step 6: Setup broadcast receivers
        IntentFilter filter = new IntentFilter();
        filter.addAction(Intent.ACTION_BATTERY_CHANGED);
        filter.addAction(AudioManager.VOLUME_CHANGED_ACTION);
        filter.addAction(AudioManager.ACTION_VOLUME_CHANGED);
        filter.addAction(BluetoothDevice.ACTION_CONNECTION_ACCESS_REPLY);
        filter.addAction(BluetoothDevice.ACTION_BOND_STATE_CHANGED);
        registerReceiver(mHeadsetReceiver, filter);
@@ -361,7 +361,7 @@ public class HeadsetService extends ProfileService {
                    mSystemInterface.getHeadsetPhoneState().setCindBatteryCharge(cindBatteryLevel);
                    break;
                }
                case AudioManager.VOLUME_CHANGED_ACTION: {
                case AudioManager.ACTION_VOLUME_CHANGED: {
                    int streamType = intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, -1);
                    if (streamType == AudioManager.STREAM_BLUETOOTH_SCO) {
                        doForEachConnectedStateMachine(stateMachine -> stateMachine.sendMessage(
+1 −1
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ public class HeadsetStateMachine extends StateMachine {
    static final int VOICE_RECOGNITION_START = 5;
    static final int VOICE_RECOGNITION_STOP = 6;

    // message.obj is an intent AudioManager.VOLUME_CHANGED_ACTION
    // message.obj is an intent AudioManager.ACTION_VOLUME_CHANGED
    // EXTRA_VOLUME_STREAM_TYPE is STREAM_BLUETOOTH_SCO
    static final int INTENT_SCO_VOLUME_CHANGED = 7;
    static final int INTENT_CONNECTION_ACCESS_REPLY = 8;
+2 −2
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ public class HeadsetClientService extends ProfileService {
                mStateMachineMap.clear();
            }

            IntentFilter filter = new IntentFilter(AudioManager.VOLUME_CHANGED_ACTION);
            IntentFilter filter = new IntentFilter(AudioManager.ACTION_VOLUME_CHANGED);
            filter.addAction(Intent.ACTION_BATTERY_CHANGED);
            registerReceiver(mBroadcastReceiver, filter);

@@ -192,7 +192,7 @@ public class HeadsetClientService extends ProfileService {
            // not go through audio manager (audio mixer). see
            // ({@link HeadsetClientStateMachine#SET_SPEAKER_VOLUME} in
            // {@link HeadsetClientStateMachine} for details.
            if (action.equals(AudioManager.VOLUME_CHANGED_ACTION)) {
            if (action.equals(AudioManager.ACTION_VOLUME_CHANGED)) {
                if (DBG) {
                    Log.d(TAG, "Volume changed for stream: " + intent.getIntExtra(
                            AudioManager.EXTRA_VOLUME_STREAM_TYPE, -1));
+2 −2
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@ public class VolumeManager {

        mVolumeManagerReceiver = new VolumeManagerReceiver();
        IntentFilter filter = new IntentFilter();
        filter.addAction(AudioManager.VOLUME_CHANGED_ACTION);
        filter.addAction(AudioManager.ACTION_VOLUME_CHANGED);
        filter.addAction(BluetoothDevice.ACTION_BOND_STATE_CHANGED);
        filter.addAction(ACTION_SHUTDOWN);
        filter.addAction(ACTION_POWER_OFF);
@@ -731,7 +731,7 @@ public class VolumeManager {
                return;

            switch(action) {
                case AudioManager.VOLUME_CHANGED_ACTION:
                case AudioManager.ACTION_VOLUME_CHANGED:
                    int streamType = intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, -1);
                    int volumeValue = intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_VALUE, 0);
                    if(streamType == AudioManager.STREAM_BLUETOOTH_SCO) {