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

Commit e930dadb authored by jasonwshsu's avatar jasonwshsu
Browse files

Fix crash when clicking on 'surrounding' collapse button in Hearing device dialog

Root Cause: When init ambient data, HearingDeviceLocalDataManager is not start yet, so can not get
the data from Settings key.

Solution: Start HearingDeviceLocalDataManager when created

Bug: 403752469
Test: pair hearing aids > click ha dialog
Flag: EXEMPT bugfix
Change-Id: Ic4e5b6ea6140a4b56c42f9fe1664229344feb454
parent ab631004
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ public class AmbientVolumeUiController implements
        mLocalDataManager = new HearingDeviceLocalDataManager(context);
        mLocalDataManager.setOnDeviceLocalDataChangeListener(this,
                ThreadUtils.getBackgroundExecutor());
        mLocalDataManager.start();
    }

    @VisibleForTesting
+2 −0
Original line number Diff line number Diff line
@@ -176,6 +176,8 @@ public class HearingDevicesDialogDelegateTest extends SysuiTestCase {
                .thenReturn(SETTINGS_PACKAGE_NAME);
        when(mDevice.getBondState()).thenReturn(BOND_BONDED);
        when(mDevice.isConnected()).thenReturn(true);
        when(mDevice.getAddress()).thenReturn(DEVICE_ADDRESS);
        when(mDevice.getAnonymizedAddress()).thenReturn(DEVICE_ADDRESS);
        when(mCachedDevice.getDevice()).thenReturn(mDevice);
        when(mCachedDevice.getAddress()).thenReturn(DEVICE_ADDRESS);
        when(mCachedDevice.getName()).thenReturn(DEVICE_NAME);