From 83b870f7d2fad96f357c91259011a8a7b35ed8d6 Mon Sep 17 00:00:00 2001 From: Jordan Liu Date: Fri, 22 Feb 2019 14:19:55 -0800 Subject: [PATCH] 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 --- .../core/java/com/android/server/TelephonyRegistry.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java index b4d45d475917c..5b839e4174d66 100644 --- a/services/core/java/com/android/server/TelephonyRegistry.java +++ b/services/core/java/com/android/server/TelephonyRegistry.java @@ -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); }