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

Commit 83b870f7 authored by Jordan Liu's avatar Jordan Liu
Browse files

Reset callNetworkType and CallQuality after calls

When the PreciseCallState is not active, we can zero-out/reset the
callNetworkType and CallQuality. This way we don't return the cached
value when the next call comes.

Bug: 125342572
Test: manual
Change-Id: I8cb34b43bc5983be9c2b5576a1c797907518ecc9
parent 474d0ab6
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1549,6 +1549,13 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
                log("notifyPreciseCallState: mCallQuality is null, skipping call attributes");
                notifyCallAttributes = false;
            } else {
                // If the precise call state is no longer active, reset the call network type and
                // call quality.
                if (mPreciseCallState.getForegroundCallState()
                        != PreciseCallState.PRECISE_CALL_STATE_ACTIVE) {
                    mCallNetworkType = TelephonyManager.NETWORK_TYPE_UNKNOWN;
                    mCallQuality = new CallQuality();
                }
                mCallAttributes = new CallAttributes(mPreciseCallState, mCallNetworkType,
                        mCallQuality);
            }