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

Commit 04be1928 authored by Danny Baumann's avatar Danny Baumann
Browse files

Fix signal strength indicator.

Some devices don't check the service indicator, but only the signal
indicator. Don't give the false impression that the network signal is ok
when we're actually out of service for those devices.

Change-Id: I2e24daf13593439cbc23254fb4539cd250dbae89
parent f0362f25
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -161,13 +161,17 @@ class HeadsetPhoneState {

    void sendDeviceStateChanged()
    {
        // When out of service, send signal strength as 0. Some devices don't
        // use the service indicator, but only the signal indicator
        int signal = mService == HeadsetHalConstants.NETWORK_STATE_AVAILABLE ? mSignal : 0;

        Log.d(TAG, "sendDeviceStateChanged. mService="+ mService +
                   " mSignal="+mSignal +" mRoam="+mRoam +
                   " mSignal=" + signal +" mRoam="+ mRoam +
                   " mBatteryCharge=" + mBatteryCharge);
        HeadsetStateMachine sm = mStateMachine;
        if (sm != null) {
            sm.sendMessage(HeadsetStateMachine.DEVICE_STATE_CHANGED,
                new HeadsetDeviceState(mService, mRoam, mSignal, mBatteryCharge));
                new HeadsetDeviceState(mService, mRoam, signal, mBatteryCharge));
        }
    }