diff options
Diffstat (limited to 'src/java')
6 files changed, 44 insertions, 13 deletions
diff --git a/src/java/com/android/internal/telephony/CallForwardInfo.java b/src/java/com/android/internal/telephony/CallForwardInfo.java index dccf3066a..e40028fc2 100644 --- a/src/java/com/android/internal/telephony/CallForwardInfo.java +++ b/src/java/com/android/internal/telephony/CallForwardInfo.java @@ -16,12 +16,16 @@ package com.android.internal.telephony; +import android.telecom.Log; + /** * See also RIL_CallForwardInfo in include/telephony/ril.h * * {@hide} */ public class CallForwardInfo { + private static final String TAG = "CallForwardInfo"; + public int status; /*1 = active, 0 = not active */ public int reason; /* from TS 27.007 7.11 "reason" */ public int serviceClass; /* Saum of CommandsInterface.SERVICE_CLASS */ @@ -31,9 +35,9 @@ public class CallForwardInfo { @Override public String toString() { - return super.toString() + (status == 0 ? " not active " : " active ") - + " reason: " + reason - + " serviceClass: " + serviceClass + " " + timeSeconds + " seconds"; - + return "[CallForwardInfo: status=" + (status == 0 ? " not active " : " active ") + + ", reason= " + reason + + ", serviceClass= " + serviceClass + ", timeSec= " + timeSeconds + " seconds" + + ", number=" + Log.pii(number) + "]"; } } diff --git a/src/java/com/android/internal/telephony/DefaultPhoneNotifier.java b/src/java/com/android/internal/telephony/DefaultPhoneNotifier.java index c13e54086..98c0a32ec 100644 --- a/src/java/com/android/internal/telephony/DefaultPhoneNotifier.java +++ b/src/java/com/android/internal/telephony/DefaultPhoneNotifier.java @@ -125,6 +125,9 @@ public class DefaultPhoneNotifier implements PhoneNotifier { int subId = sender.getSubId(); try { if (mRegistry != null) { + Rlog.d(LOG_TAG, "notifyCallForwardingChanged: subId=" + subId + ", isCFActive=" + + sender.getCallForwardingIndicator()); + mRegistry.notifyCallForwardingChangedForSubscriber(subId, sender.getCallForwardingIndicator()); } diff --git a/src/java/com/android/internal/telephony/GsmCdmaPhone.java b/src/java/com/android/internal/telephony/GsmCdmaPhone.java index d95d0183b..505334167 100644 --- a/src/java/com/android/internal/telephony/GsmCdmaPhone.java +++ b/src/java/com/android/internal/telephony/GsmCdmaPhone.java @@ -2549,6 +2549,7 @@ public class GsmCdmaPhone extends Phone { private void processIccRecordEvents(int eventCode) { switch (eventCode) { case IccRecords.EVENT_CFI: + logi("processIccRecordEvents: EVENT_CFI"); notifyCallForwardingIndicator(); break; } diff --git a/src/java/com/android/internal/telephony/Phone.java b/src/java/com/android/internal/telephony/Phone.java index 28e45565f..8b0c6775d 100644 --- a/src/java/com/android/internal/telephony/Phone.java +++ b/src/java/com/android/internal/telephony/Phone.java @@ -56,6 +56,7 @@ import android.telephony.SignalStrength; import android.telephony.SubscriptionManager; import android.telephony.VoLteServiceState; import android.text.TextUtils; +import android.util.Log; import com.android.ims.ImsCall; import com.android.ims.ImsConfig; @@ -1789,7 +1790,7 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { int status = enable ? IccRecords.CALL_FORWARDING_STATUS_ENABLED : IccRecords.CALL_FORWARDING_STATUS_DISABLED; int subId = getSubId(); - Rlog.d(LOG_TAG, "setCallForwardingIndicatorInSharedPref: Storing status = " + status + + Rlog.i(LOG_TAG, "setCallForwardingIndicatorInSharedPref: Storing status = " + status + " in pref " + CF_STATUS + subId); SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mContext); @@ -1831,6 +1832,9 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { if (callForwardingIndicator == IccRecords.CALL_FORWARDING_STATUS_UNKNOWN) { callForwardingIndicator = getCallForwardingIndicatorFromSharedPref(); } + Rlog.v(LOG_TAG, "getCallForwardingIndicator: iccForwardingFlag=" + (r != null + ? r.getVoiceCallForwardingFlag() : "null") + ", sharedPrefFlag=" + + getCallForwardingIndicatorFromSharedPref()); return (callForwardingIndicator == IccRecords.CALL_FORWARDING_STATUS_ENABLED); } 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 { diff --git a/src/java/com/android/internal/telephony/util/NotificationChannelController.java b/src/java/com/android/internal/telephony/util/NotificationChannelController.java index 9967b05dc..54d7d1abd 100644 --- a/src/java/com/android/internal/telephony/util/NotificationChannelController.java +++ b/src/java/com/android/internal/telephony/util/NotificationChannelController.java @@ -58,21 +58,26 @@ public class NotificationChannelController { alertChannel.setSound(Settings.System.DEFAULT_NOTIFICATION_URI, new AudioAttributes.Builder().setUsage(AudioAttributes.USAGE_NOTIFICATION).build()); + final NotificationChannel mobileDataStatusChannel = new NotificationChannel( + CHANNEL_ID_MOBILE_DATA_STATUS, + context.getText(R.string.notification_channel_mobile_data_status), + NotificationManager.IMPORTANCE_LOW); + // allow users to block notifications from system + mobileDataStatusChannel.setBlockableSystem(true); + context.getSystemService(NotificationManager.class) .createNotificationChannels(Arrays.asList( new NotificationChannel(CHANNEL_ID_CALL_FORWARD, context.getText(R.string.notification_channel_call_forward), NotificationManager.IMPORTANCE_LOW), - new NotificationChannel(CHANNEL_ID_MOBILE_DATA_STATUS, - context.getText(R.string.notification_channel_mobile_data_status), - NotificationManager.IMPORTANCE_LOW), new NotificationChannel(CHANNEL_ID_SMS, context.getText(R.string.notification_channel_sms), NotificationManager.IMPORTANCE_HIGH), new NotificationChannel(CHANNEL_ID_WFC, context.getText(R.string.notification_channel_wfc), NotificationManager.IMPORTANCE_LOW), - alertChannel)); + alertChannel, + mobileDataStatusChannel)); // only for update if (getChannel(CHANNEL_ID_VOICE_MAIL, context) != null) { migrateVoicemailNotificationSettings(context); |