diff options
Diffstat (limited to 'src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java')
-rw-r--r-- | src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java b/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java index c19c28bc1..072da68ed 100644 --- a/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java +++ b/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java @@ -726,6 +726,8 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { return NetworkStats.UID_ALL; } + // Initialize to UID_ALL so at least it can be counted to overall data usage if + // the dialer's package uid is not available. int uid = NetworkStats.UID_ALL; try { uid = context.getPackageManager().getPackageUid(pkg, 0); @@ -2549,7 +2551,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { && targetAccessTech != ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN && targetAccessTech != ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN; if (isHandoverFromWifi && imsCall.isVideoCall()) { - if (mNotifyHandoverVideoFromWifiToLTE) { + if (mNotifyHandoverVideoFromWifiToLTE && mIsDataEnabled) { log("onCallHandover :: notifying of WIFI to LTE handover."); conn.onConnectionEvent( TelephonyManager.EVENT_HANDOVER_VIDEO_FROM_WIFI_TO_LTE, null); @@ -2558,7 +2560,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { if (!mIsDataEnabled && mIsViLteDataMetered) { // Call was downgraded from WIFI to LTE and data is metered; downgrade the // call now. - downgradeVideoCall(ImsReasonInfo.CODE_DATA_DISABLED, conn); + downgradeVideoCall(ImsReasonInfo.CODE_WIFI_LOST, conn); } } } else { @@ -2999,6 +3001,17 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { // a separate entry if uid is different from the previous snapshot. NetworkStats vtDataUsageUidSnapshot = new NetworkStats(currentTime, 1); vtDataUsageUidSnapshot.combineAllValues(mVtDataUsageUidSnapshot); + + // The dialer uid might not be initialized correctly during boot up due to telecom service + // not ready or its default dialer cache not ready. So we double check again here to see if + // default dialer uid is really not available. + if (mDefaultDialerUid.get() == NetworkStats.UID_ALL) { + final TelecomManager telecomManager = + (TelecomManager) mPhone.getContext().getSystemService(Context.TELECOM_SERVICE); + mDefaultDialerUid.set( + getPackageUid(mPhone.getContext(), telecomManager.getDefaultDialerPackage())); + } + // Since the modem only reports the total vt data usage rather than rx/tx separately, // the only thing we can do here is splitting the usage into half rx and half tx. vtDataUsageUidSnapshot.combineValues(new NetworkStats.Entry( @@ -3507,8 +3520,9 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { // If the carrier supports downgrading to voice, then we can simply issue a // downgrade to voice instead of terminating the call. modifyVideoCall(imsCall, VideoProfile.STATE_AUDIO_ONLY); - } else if (mSupportPauseVideo) { - // The carrier supports video pause signalling, so pause the video. + } else if (mSupportPauseVideo && reasonCode != ImsReasonInfo.CODE_WIFI_LOST) { + // The carrier supports video pause signalling, so pause the video if we didn't just + // lose wifi; in that case just disconnect. mShouldUpdateImsConfigOnDisconnect = true; conn.pauseVideo(VideoPauseTracker.SOURCE_DATA_ENABLED); } else { |