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

Unverified Commit bac736de authored by Michael Bestas's avatar Michael Bestas
Browse files

Merge tag 'android-14.0.0_r17' into staging/lineage-21.0_merge-android-14.0.0_r17

Android 14.0.0 Release 17 (UQ1A.231205.015)

# -----BEGIN PGP SIGNATURE-----
#
# iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCZXDPMAAKCRDorT+BmrEO
# eEc8AJ9UwD/XggsIR+15nIYAcMJ1UYYHHwCeJagEtfLIjBMe33T39AT4+84hKcY=
# =Frpe
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed Dec  6 21:44:48 2023 EET
# gpg:                using DSA key 4340D13570EF945E83810964E8AD3F819AB10E78
# gpg: Good signature from "The Android Open Source Project <initial-contribution@android.com>" [marginal]
# gpg: initial-contribution@android.com: Verified 2182 signatures in the past
#      2 years.  Encrypted 4 messages in the past 23 months.
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 4340 D135 70EF 945E 8381  0964 E8AD 3F81 9AB1 0E78

# By Ling Ma (17) and others
# Via Automerger Merge Worker (360) and others
* tag 'android-14.0.0_r17': (64 commits)
  DO NOT MERGE Add helper method in phone to get new carrier config key.
  Only set the vonr setting when sim state loaded
  Add isDataEnabled field.
  Delay data switch untill call alerting
  Update matchAllRuleAllowed flag condition
  Control ratcheting logic based on carrier config
  Profile is getting activated on wrong portIndex
  Update cardId for downloaded embedded profile
  Update bandwidth threshhold for NR advanced
  Fix NR advanced logic for NR NSA
  Check mAdnCache is not null before loading FDN.
  Fix EVENT_SET_NULL_CIPHER_AND_INTEGRITY_DONE Error Handling
  Fixed eSIM activation failed issue
  Keep the TP-MessageRef as is for SMS Fallback
  Revert "Allow IWLAN network when power off modem"
  Fixed subscription database cache out of sync
  Check extras to determine if the call is cross sim
  Fixed incorrect phone number from inactive subscription
  Add logic to keep 5G+/5G UC icon when RRC idle
  Check mAdnCache is not null before loading FDN.
  ...

 Conflicts:
	src/java/com/android/internal/telephony/NetworkTypeController.java
	tests/telephonytests/src/com/android/internal/telephony/NetworkTypeControllerTest.java

Change-Id: Iadb4bc7db1e967b2b4da3c89cdbdbd74b211d43e
parents 52d0b067 9dc4b919
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -275,6 +275,8 @@ message VoiceCallSession {
    optional int32 call_duration = 32;
    optional int32 last_known_rat = 33;
    optional int32 fold_state = 34;
    optional int64 rat_switch_count_after_connected = 35;
    optional bool handover_in_progress = 36;

    // Internal use only
    optional int64 setup_begin_millis = 10001;
@@ -378,6 +380,8 @@ message CellularServiceState {
    optional bool is_emergency_only = 10;
    optional bool is_internet_pdn_up = 11;
    optional int32 fold_state = 12;
    optional bool override_voice_service = 13;
    optional bool isDataEnabled = 14;

    // Internal use only
    optional int64 last_used_millis = 10001;
+58 −6
Original line number Diff line number Diff line
@@ -116,14 +116,15 @@ public class CarrierServiceStateTracker extends Handler {
                                    mPhone.getContext(),
                                    mPhone.getSubId(),
                                    CarrierConfigManager.KEY_EMERGENCY_NOTIFICATION_DELAY_INT,
                                    CarrierConfigManager
                                            .KEY_PREF_NETWORK_NOTIFICATION_DELAY_INT);
                                    CarrierConfigManager.KEY_PREF_NETWORK_NOTIFICATION_DELAY_INT,
                                    CarrierConfigManager.KEY_HIDE_PREFERRED_NETWORK_TYPE_BOOL);
                    if (b.isEmpty()) return;

                    for (Map.Entry<Integer, NotificationType> entry :
                            mNotificationTypeMap.entrySet()) {
                        NotificationType notificationType = entry.getValue();
                        notificationType.setDelay(b);
                        notificationType.setEnabled(b);
                    }
                    handleConfigChanges();
                });
@@ -429,6 +430,18 @@ public class CarrierServiceStateTracker extends Handler {
        **/
        void setDelay(PersistableBundle bundle);

        /**
         * Checks whether this Notification is enabled.
         * @return {@code true} if this Notification is enabled, false otherwise
         */
        boolean isEnabled();

        /**
         * Sets whether this Notification is enabled. If disabled, it will not build notification.
         * @param bundle PersistableBundle
         */
        void setEnabled(PersistableBundle bundle);

        /**
         * returns notification type id.
         **/
@@ -458,6 +471,7 @@ public class CarrierServiceStateTracker extends Handler {

        private final int mTypeId;
        private int mDelay = UNINITIALIZED_DELAY_VALUE;
        private boolean mEnabled = false;

        PrefNetworkNotification(int typeId) {
            this.mTypeId = typeId;
@@ -480,6 +494,28 @@ public class CarrierServiceStateTracker extends Handler {
            return mDelay;
        }

        /**
         * Checks whether this Notification is enabled.
         * @return {@code true} if this Notification is enabled, false otherwise
         */
        public boolean isEnabled() {
            return mEnabled;
        }

        /**
         * Sets whether this Notification is enabled. If disabled, it will not build notification.
         * @param bundle PersistableBundle
         */
        public void setEnabled(PersistableBundle bundle) {
            if (bundle == null) {
                Rlog.e(LOG_TAG, "bundle is null");
                return;
            }
            mEnabled = !bundle.getBoolean(
                    CarrierConfigManager.KEY_HIDE_PREFERRED_NETWORK_TYPE_BOOL);
            Rlog.i(LOG_TAG, "reading enabled notification pref network: " + mEnabled);
        }

        public int getTypeId() {
            return mTypeId;
        }
@@ -497,10 +533,10 @@ public class CarrierServiceStateTracker extends Handler {
         */
        public boolean sendMessage() {
            Rlog.i(LOG_TAG, "PrefNetworkNotification: sendMessage() w/values: "
                    + "," + isPhoneStillRegistered() + "," + mDelay + "," + isGlobalMode()
                    + "," + mSST.isRadioOn());
            if (mDelay == UNINITIALIZED_DELAY_VALUE || isPhoneStillRegistered() || isGlobalMode()
                    || isRadioOffOrAirplaneMode()) {
                    + "," + mEnabled + "," + isPhoneStillRegistered() + "," + mDelay
                    + "," + isGlobalMode() + "," + mSST.isRadioOn());
            if (!mEnabled || mDelay == UNINITIALIZED_DELAY_VALUE || isPhoneStillRegistered()
                    || isGlobalMode() || isRadioOffOrAirplaneMode()) {
                return false;
            }
            return true;
@@ -559,6 +595,22 @@ public class CarrierServiceStateTracker extends Handler {
            return mDelay;
        }

        /**
         * Checks whether this Notification is enabled.
         * @return {@code true} if this Notification is enabled, false otherwise
         */
        public boolean isEnabled() {
            return true;
        }

        /**
         * Sets whether this Notification is enabled. If disabled, it will not build notification.
         * @param bundle PersistableBundle
         */
        public void setEnabled(PersistableBundle bundle) {
            // always allowed. There is no config to hide notifications.
        }

        public int getTypeId() {
            return mTypeId;
        }
+37 −2
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@ import android.telephony.CellBroadcastIdRange;
import android.telephony.SmsCbMessage;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.util.IndentingPrintWriter;
import android.util.LocalLog;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo;
@@ -33,6 +35,8 @@ import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo;
import com.android.internal.util.State;
import com.android.internal.util.StateMachine;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -59,6 +63,7 @@ public final class CellBroadcastConfigTracker extends StateMachine {
    // Cache of current cell broadcast id ranges of 3gpp2
    private List<CellBroadcastIdRange> mCbRanges3gpp2 = new CopyOnWriteArrayList<>();
    private Phone mPhone;
    private final LocalLog mLocalLog = new LocalLog(128);
    @VisibleForTesting
    public int mSubId;
    @VisibleForTesting
@@ -106,8 +111,7 @@ public final class CellBroadcastConfigTracker extends StateMachine {
        @Override
        public String toString() {
            return "Request[mCbRangesRequest3gpp = " + mCbRangesRequest3gpp + ", "
                    + "mCbRangesRequest3gpp2 = " + mCbRangesRequest3gpp2 + ", "
                    + "mCallback = " + mCallback + "]";
                    + "mCbRangesRequest3gpp2 = " + mCbRangesRequest3gpp2 + "]";
        }
    }

@@ -175,6 +179,9 @@ public final class CellBroadcastConfigTracker extends StateMachine {
                    Request request = (Request) msg.obj;
                    if (DBG) {
                        logd("IdleState handle EVENT_REQUEST with request:" + request);
                        mLocalLog.log("IdleState handle EVENT_REQUEST with request:" + request
                                + ", mCbRanges3gpp:" + mCbRanges3gpp
                                + ", mCbRanges3gpp2:" + mCbRanges3gpp2);
                    }
                    if (!mCbRanges3gpp.equals(request.get3gppRanges())) {
                        // set gsm config if the config is changed
@@ -229,6 +236,7 @@ public final class CellBroadcastConfigTracker extends StateMachine {
                        transitionTo(mGsmActivatingState);
                    } else {
                        logd("Failed to set gsm config");
                        mLocalLog.log("GsmConfiguringState Failed to set gsm config:" + request);
                        request.getCallback().accept(
                                TelephonyManager.CELL_BROADCAST_RESULT_FAIL_CONFIG);
                        // transit to idle state on the failure case
@@ -265,6 +273,8 @@ public final class CellBroadcastConfigTracker extends StateMachine {
                    if (DBG) {
                        logd("GsmActivatingState handle EVENT_ACTIVATION_DONE with request:"
                                + request);
                        mLocalLog.log("GsmActivatingState EVENT_ACTIVATION_DONE, exception:"
                                + ar.exception + ", request:" + request);
                    }
                    if (ar.exception == null) {
                        mCbRanges3gpp = request.get3gppRanges();
@@ -326,6 +336,7 @@ public final class CellBroadcastConfigTracker extends StateMachine {
                        transitionTo(mCdmaActivatingState);
                    } else {
                        logd("Failed to set cdma config");
                        mLocalLog.log("CdmaConfiguringState Failed to set cdma config:" + request);
                        request.getCallback().accept(
                                TelephonyManager.CELL_BROADCAST_RESULT_FAIL_CONFIG);
                        // transit to idle state on the failure case
@@ -362,6 +373,8 @@ public final class CellBroadcastConfigTracker extends StateMachine {
                    if (DBG) {
                        logd("CdmaActivatingState handle EVENT_ACTIVATION_DONE with request:"
                                + request);
                        mLocalLog.log("CdmaActivatingState EVENT_ACTIVATION_DONE, exception:"
                                + ar.exception + ", request:" + request);
                    }
                    if (ar.exception == null) {
                        mCbRanges3gpp2 = request.get3gpp2Ranges();
@@ -531,4 +544,26 @@ public final class CellBroadcastConfigTracker extends StateMachine {
            mPhone.mCi.setCdmaBroadcastActivation(activate, response);
        }
    }

    /**
     * Dump the state of CellBroadcastConfigTracker
     *
     * @param fd File descriptor
     * @param printWriter Print writer
     * @param args Arguments
     */
    public void dump(FileDescriptor fd, PrintWriter printWriter, String[] args) {
        IndentingPrintWriter pw = new IndentingPrintWriter(printWriter, "  ");
        pw.println(CellBroadcastConfigTracker.class.getSimpleName()
                + "-" + mPhone.getPhoneId() + ":");
        pw.increaseIndent();
        pw.println("Current mCbRanges3gpp:" + mCbRanges3gpp);
        pw.println("Current mCbRanges3gpp2:" + mCbRanges3gpp2);
        pw.decreaseIndent();

        pw.println("Local logs:");
        pw.increaseIndent();
        mLocalLog.dump(fd, pw, args);
        pw.decreaseIndent();
    }
}
+6 −1
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telephony.metrics.RcsStats;
import com.android.telephony.Rlog;

import java.util.NoSuchElementException;
import java.util.concurrent.ConcurrentLinkedQueue;

/**
@@ -155,7 +156,11 @@ public class GbaManager {

        public synchronized void unlinkToDeath() {
            if (mBinder != null) {
                try {
                    mBinder.unlinkToDeath(this, 0);
                } catch (NoSuchElementException e) {
                    // do nothing
                }
                mBinder = null;
            }
        }
+18 −5
Original line number Diff line number Diff line
@@ -249,6 +249,7 @@ public class GsmCdmaPhone extends Phone {
    private String mImeiSv;
    private String mVmNumber;
    private int mImeiType = IMEI_TYPE_UNKNOWN;
    private int mSimState = TelephonyManager.SIM_STATE_UNKNOWN;

    @VisibleForTesting
    public CellBroadcastConfigTracker mCellBroadcastConfigTracker =
@@ -426,9 +427,9 @@ public class GsmCdmaPhone extends Phone {
                if (mPhoneId == intent.getIntExtra(
                        SubscriptionManager.EXTRA_SLOT_INDEX,
                        SubscriptionManager.INVALID_SIM_SLOT_INDEX)) {
                    int simState = intent.getIntExtra(TelephonyManager.EXTRA_SIM_STATE,
                    mSimState = intent.getIntExtra(TelephonyManager.EXTRA_SIM_STATE,
                            TelephonyManager.SIM_STATE_UNKNOWN);
                    if (simState == TelephonyManager.SIM_STATE_LOADED
                    if (mSimState == TelephonyManager.SIM_STATE_LOADED
                            && currentSlotSubIdChanged()) {
                        setNetworkSelectionModeAutomatic(null);
                    }
@@ -680,6 +681,7 @@ public class GsmCdmaPhone extends Phone {
        mTelecomVoiceServiceStateOverride = newOverride;
        if (changed && mSST != null) {
            mSST.onTelecomVoiceServiceStateOverrideChanged();
            mSST.getServiceStateStats().onVoiceServiceStateOverrideChanged(hasService);
        }
    }

@@ -3521,13 +3523,14 @@ public class GsmCdmaPhone extends Phone {
            case EVENT_SET_NULL_CIPHER_AND_INTEGRITY_DONE:
                logd("EVENT_SET_NULL_CIPHER_AND_INTEGRITY_DONE");
                ar = (AsyncResult) msg.obj;
                // Only test for a success here in order to flip the support flag.
                // Testing for the negative case, e.g. REQUEST_NOT_SUPPORTED, is insufficient
                // because the modem or the RIL could still return exceptions for temporary
                // failures even when the feature is unsupported.
                if (ar == null || ar.exception == null) {
                    mIsNullCipherAndIntegritySupported = true;
                    return;
                }
                CommandException.Error error = ((CommandException) ar.exception).getCommandError();
                mIsNullCipherAndIntegritySupported = !error.equals(
                        CommandException.Error.REQUEST_NOT_SUPPORTED);
                break;

            case EVENT_IMS_DEREGISTRATION_TRIGGERED:
@@ -4499,6 +4502,12 @@ public class GsmCdmaPhone extends Phone {
            e.printStackTrace();
        }
        pw.flush();
        try {
            mCellBroadcastConfigTracker.dump(fd, pw, args);
        } catch (Exception e) {
            e.printStackTrace();
        }
        pw.flush();
    }

    @Override
@@ -5017,6 +5026,10 @@ public class GsmCdmaPhone extends Phone {
            return;
        }

        if (mSimState != TelephonyManager.SIM_STATE_LOADED) {
            return;
        }

        if (config == null) {
            loge("didn't get the vonr_enabled_bool from the carrier config.");
            return;
Loading