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

Commit bac54b14 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8573187 from 798ae24c to tm-d1-release

Change-Id: If7d84648c04411494e2e7b7fc8b6964866dc2d07
parents 83735282 798ae24c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -261,6 +261,7 @@ message OutgoingSms {
    optional int32 carrier_id = 11;
    optional int64 message_id = 12;
    optional int32 retry_id = 13;
    optional int64 interval_millis = 14;
}

message CarrierIdMismatch {
+4 −2
Original line number Diff line number Diff line
@@ -194,7 +194,8 @@ public class ImsSmsDispatcher extends SMSDispatcher {
                        status == ImsSmsImplBase.SEND_STATUS_ERROR_FALLBACK,
                        reason,
                        tracker.mMessageId,
                        tracker.isFromDefaultSmsApplication(mContext));
                        tracker.isFromDefaultSmsApplication(mContext),
                        tracker.getInterval());
            } finally {
                Binder.restoreCallingIdentity(identity);
            }
@@ -471,7 +472,8 @@ public class ImsSmsDispatcher extends SMSDispatcher {
                    true /* fallbackToCs */,
                    SmsManager.RESULT_SYSTEM_ERROR,
                    tracker.mMessageId,
                    tracker.isFromDefaultSmsApplication(mContext));
                    tracker.isFromDefaultSmsApplication(mContext),
                    tracker.getInterval());
        }
    }

+10 −19
Original line number Diff line number Diff line
@@ -486,20 +486,12 @@ public class LocaleTracker extends Handler {
        String countryIso = "";
        String countryIsoDebugInfo = "empty as default";

        // For time zone detection we want the best geographical match we can get, which may differ
        // from the countryIso.
        String timeZoneCountryIso = null;
        String timeZoneCountryIsoDebugInfo = null;

        if (!TextUtils.isEmpty(mOperatorNumeric)) {
            MccMnc mccMnc = MccMnc.fromOperatorNumeric(mOperatorNumeric);
            if (mccMnc != null) {
                countryIso = MccTable.countryCodeForMcc(mccMnc.mcc);
                countryIso = MccTable.geoCountryCodeForMccMnc(mccMnc);
                countryIsoDebugInfo = "OperatorNumeric(" + mOperatorNumeric
                        + "): MccTable.countryCodeForMcc(\"" + mccMnc.mcc + "\")";
                timeZoneCountryIso = MccTable.geoCountryCodeForMccMnc(mccMnc);
                timeZoneCountryIsoDebugInfo =
                        "OperatorNumeric: MccTable.geoCountryCodeForMccMnc(" + mccMnc + ")";
                        + "): MccTable.geoCountryCodeForMccMnc(\"" + mccMnc + "\")";
            } else {
                loge("updateLocale: Can't get country from operator numeric. mOperatorNumeric = "
                        + mOperatorNumeric);
@@ -509,15 +501,19 @@ public class LocaleTracker extends Handler {
        // If for any reason we can't get country from operator numeric, try to get it from cell
        // info.
        if (TextUtils.isEmpty(countryIso)) {
            // Find the most prevalent MCC from surrounding cell towers.
            String mcc = getMccFromCellInfo();
            if (mcc != null) {
                countryIso = MccTable.countryCodeForMcc(mcc);
                countryIsoDebugInfo = "CellInfo: MccTable.countryCodeForMcc(\"" + mcc + "\")";

                // Some MCC+MNC combinations are known to be used in countries other than those
                // that the MCC alone would suggest. Do a second pass of nearby cells that match
                // the most frequently observed MCC to see if this could be one of those cases.
                MccMnc mccMnc = getMccMncFromCellInfo(mcc);
                if (mccMnc != null) {
                    timeZoneCountryIso = MccTable.geoCountryCodeForMccMnc(mccMnc);
                    timeZoneCountryIsoDebugInfo =
                    countryIso = MccTable.geoCountryCodeForMccMnc(mccMnc);
                    countryIsoDebugInfo =
                            "CellInfo: MccTable.geoCountryCodeForMccMnc(" + mccMnc + ")";
                }
            }
@@ -526,8 +522,6 @@ public class LocaleTracker extends Handler {
        if (mCountryOverride != null) {
            countryIso = mCountryOverride;
            countryIsoDebugInfo = "mCountryOverride = \"" + mCountryOverride + "\"";
            timeZoneCountryIso = countryIso;
            timeZoneCountryIsoDebugInfo = countryIsoDebugInfo;
        }

        if (!mPhone.isRadioOn()) {
@@ -569,6 +563,8 @@ public class LocaleTracker extends Handler {

        // Pass the geographical country information to the telephony time zone detection code.

        String timeZoneCountryIso = countryIso;
        String timeZoneCountryIsoDebugInfo = countryIsoDebugInfo;
        boolean isTestMcc = false;
        if (!TextUtils.isEmpty(mOperatorNumeric)) {
            // For a test cell (MCC 001), the NitzStateMachine requires handleCountryDetected("") in
@@ -579,11 +575,6 @@ public class LocaleTracker extends Handler {
                timeZoneCountryIsoDebugInfo = "Test cell: " + mOperatorNumeric;
            }
        }
        if (timeZoneCountryIso == null) {
            // After this timeZoneCountryIso may still be null.
            timeZoneCountryIso = countryIso;
            timeZoneCountryIsoDebugInfo = "Defaulted: " + countryIsoDebugInfo;
        }
        log("updateLocale: timeZoneCountryIso = " + timeZoneCountryIso
                + ", timeZoneCountryIsoDebugInfo = " + timeZoneCountryIsoDebugInfo);

+21 −6
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import android.os.Looper;
import android.os.Message;
import android.os.PersistableBundle;
import android.os.Process;
import android.os.SystemClock;
import android.os.UserHandle;
import android.provider.Settings;
import android.provider.Telephony;
@@ -902,7 +903,8 @@ public abstract class SMSDispatcher extends Handler {
                    false /* fallbackToCs */,
                    SmsManager.RESULT_ERROR_NONE,
                    tracker.mMessageId,
                    tracker.isFromDefaultSmsApplication(mContext));
                    tracker.isFromDefaultSmsApplication(mContext),
                    tracker.getInterval());
        } else {
            if (DBG) {
                Rlog.d(TAG, "SMS send failed "
@@ -937,7 +939,8 @@ public abstract class SMSDispatcher extends Handler {
                        false /* fallbackToCs */,
                        getNotInServiceError(ss),
                        tracker.mMessageId,
                        tracker.isFromDefaultSmsApplication(mContext));
                        tracker.isFromDefaultSmsApplication(mContext),
                        tracker.getInterval());
            } else if (error == SmsManager.RESULT_RIL_SMS_SEND_FAIL_RETRY
                    && tracker.mRetryCount < MAX_SEND_RETRIES) {
                // Retry after a delay if needed.
@@ -959,7 +962,8 @@ public abstract class SMSDispatcher extends Handler {
                        SmsManager.RESULT_RIL_SMS_SEND_FAIL_RETRY,
                        errorCode,
                        tracker.mMessageId,
                        tracker.isFromDefaultSmsApplication(mContext));
                        tracker.isFromDefaultSmsApplication(mContext),
                        tracker.getInterval());
            } else {
                int errorCode = (smsResponse != null) ? smsResponse.mErrorCode : NO_ERROR_CODE;
                tracker.onFailed(mContext, error, errorCode);
@@ -970,7 +974,8 @@ public abstract class SMSDispatcher extends Handler {
                        error,
                        errorCode,
                        tracker.mMessageId,
                        tracker.isFromDefaultSmsApplication(mContext));
                        tracker.isFromDefaultSmsApplication(mContext),
                        tracker.getInterval());
            }
        }
    }
@@ -2007,7 +2012,8 @@ public abstract class SMSDispatcher extends Handler {
                    false /* fallbackToCs */,
                    error,
                    trackers[0].mMessageId,
                    trackers[0].isFromDefaultSmsApplication(mContext));
                    trackers[0].isFromDefaultSmsApplication(mContext),
                    trackers[0].getInterval());
        }
    }

@@ -2047,7 +2053,7 @@ public abstract class SMSDispatcher extends Handler {
        public final SmsHeader mSmsHeader;

        @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
        private long mTimestamp = System.currentTimeMillis();
        private long mTimestamp = SystemClock.elapsedRealtime();
        @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
        public Uri mMessageUri; // Uri of persisted message if we wrote one

@@ -2173,6 +2179,15 @@ public abstract class SMSDispatcher extends Handler {
            }
        }

        /**
         * Returns the interval in milliseconds between sending the message out and current time.
         * Called after receiving success/failure response to calculate the time
         * to complete the SMS send to the network.
         */
        protected long getInterval() {
            return SystemClock.elapsedRealtime() - mTimestamp;
        }

        /**
         * Persist a sent SMS if required:
         * 1. It is a text message
+1 −0
Original line number Diff line number Diff line
@@ -3309,6 +3309,7 @@ public class SubscriptionController extends ISub.Stub {
            case SubscriptionManager.GROUP_UUID:
                if (mContext.checkCallingOrSelfPermission(
                        Manifest.permission.READ_PRIVILEGED_PHONE_STATE) != PERMISSION_GRANTED) {
                    EventLog.writeEvent(0x534e4554, "213457638", Binder.getCallingUid());
                    return null;
                }
                break;
Loading