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

Commit 7aa51ddf authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Set correct max vol curve index for LEA" into main

parents cda0f42f b3197a64
Loading
Loading
Loading
Loading
+13 −4
Original line number Original line Diff line number Diff line
@@ -10086,19 +10086,28 @@ public class AudioService extends IAudioService.Stub
                        mIndexStepFactor = 1.f;
                        mIndexStepFactor = 1.f;
                    } else if ((equalScoLeaVcIndexRange() || equalScoHaVcIndexRange())
                    } else if ((equalScoLeaVcIndexRange() || equalScoHaVcIndexRange())
                            && isStreamBluetoothComm(mStreamType)) {
                            && isStreamBluetoothComm(mStreamType)) {
                        final int btCommActiveDevice = mBtCommDeviceActive.get();
                        // For non SCO devices the stream state does not change the min index
                        // For non SCO devices the stream state does not change the min index
                        if (mBtCommDeviceActive.get() == BT_COMM_DEVICE_ACTIVE_SCO) {
                        if (btCommActiveDevice == BT_COMM_DEVICE_ACTIVE_SCO) {
                            mIndexMin = MIN_STREAM_VOLUME[AudioSystem.STREAM_BLUETOOTH_SCO] * 10;
                            mIndexMin = MIN_STREAM_VOLUME[AudioSystem.STREAM_BLUETOOTH_SCO] * 10;
                            indexMinVolCurve = MIN_STREAM_VOLUME[AudioSystem.STREAM_BLUETOOTH_SCO];
                            indexMinVolCurve = MIN_STREAM_VOLUME[AudioSystem.STREAM_BLUETOOTH_SCO];
                            indexMaxVolCurve = MAX_STREAM_VOLUME[AudioSystem.STREAM_BLUETOOTH_SCO];
                            indexMaxVolCurve = MAX_STREAM_VOLUME[AudioSystem.STREAM_BLUETOOTH_SCO];
                        } else if (equalScoHaVcIndexRange()
                            mIndexStepFactor = 1.f;
                                && mBtCommDeviceActive.get() == BT_COMM_DEVICE_ACTIVE_HA) {
                        } else if ((equalScoHaVcIndexRange()
                                && btCommActiveDevice == BT_COMM_DEVICE_ACTIVE_HA) || (
                                equalScoLeaVcIndexRange() && (btCommActiveDevice
                                        == BT_COMM_DEVICE_ACTIVE_BLE_HEADSET
                                        || btCommActiveDevice
                                        == BT_COMM_DEVICE_ACTIVE_BLE_SPEAKER))) {
                            mIndexMin = MIN_STREAM_VOLUME[mStreamType] * 10;
                            mIndexMin = MIN_STREAM_VOLUME[mStreamType] * 10;
                            indexMaxVolCurve = MAX_STREAM_VOLUME[AudioSystem.STREAM_BLUETOOTH_SCO];
                            indexMaxVolCurve = MAX_STREAM_VOLUME[AudioSystem.STREAM_BLUETOOTH_SCO];
                            mIndexStepFactor = 1.f;
                        } else {
                        } else {
                            Slog.wtf(TAG, "Index factor not supported for BT comm device "
                                    + btCommActiveDevice);
                            mIndexMin = MIN_STREAM_VOLUME[mStreamType] * 10;
                            mIndexMin = MIN_STREAM_VOLUME[mStreamType] * 10;
                        }
                        }
                        mIndexStepFactor = 1.f;
                    } else {
                    } else {
                        mIndexMin = MIN_STREAM_VOLUME[AudioSystem.STREAM_VOICE_CALL] * 10;
                        mIndexMin = MIN_STREAM_VOLUME[AudioSystem.STREAM_VOICE_CALL] * 10;
                        mIndexStepFactor = (float) (mIndexMax - mIndexMin) / (float) (
                        mIndexStepFactor = (float) (mIndexMax - mIndexMin) / (float) (