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

Commit 9ece0ab1 authored by Susheel Nyamala's avatar Susheel Nyamala Committed by Amit Mahajan
Browse files

Add new vendor prefix data files

Bug: 152277258
Test: basic sanity, TH
Change-Id: I34ea8aad5de89e4cfeb76303c2e448aefe673f63
(cherry picked from commit 4ea608e6403037094f24aed96c227fc547a48ffb)
parent 5dda74b4
Loading
Loading
Loading
Loading
+34 −34
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ import java.util.concurrent.CompletableFuture;
 */
public class PhoneSwitcher extends Handler {
    private static final String LOG_TAG = "PhoneSwitcher";
    private static final boolean VDBG = false;
    protected static final boolean VDBG = false;

    private static final int DEFAULT_NETWORK_CHANGE_TIMEOUT_MS = 5000;
    private static final int MODEM_COMMAND_RETRY_PERIOD_MS     = 5000;
@@ -155,17 +155,17 @@ public class PhoneSwitcher extends Handler {
        }
    }

    private final List<DcRequest> mPrioritizedDcRequests = new ArrayList<>();
    private final RegistrantList mActivePhoneRegistrants;
    private final SubscriptionController mSubscriptionController;
    private final Context mContext;
    protected final List<DcRequest> mPrioritizedDcRequests = new ArrayList<>();
    protected final RegistrantList mActivePhoneRegistrants;
    protected final SubscriptionController mSubscriptionController;
    protected final Context mContext;
    private final LocalLog mLocalLog;
    private PhoneState[] mPhoneStates;
    private int[] mPhoneSubscriptions;
    private final CellularNetworkValidator mValidator;
    protected PhoneState[] mPhoneStates;
    protected int[] mPhoneSubscriptions;
    @VisibleForTesting
    protected final CellularNetworkValidator mValidator;
    private int mPendingSwitchSubId = INVALID_SUBSCRIPTION_ID;
    private boolean mPendingSwitchNeedValidation;

    @VisibleForTesting
    public final CellularNetworkValidator.ValidationCallback mValidationCallback =
            new CellularNetworkValidator.ValidationCallback() {
@@ -186,16 +186,16 @@ public class PhoneSwitcher extends Handler {
    @UnsupportedAppUsage
    // How many phones (correspondingly logical modems) are allowed for PS attach. This is used
    // when we specifically use setDataAllowed to initiate on-demand PS(data) attach for each phone.
    private int mMaxDataAttachModemCount;
    protected int mMaxDataAttachModemCount;
    // Local cache of TelephonyManager#getActiveModemCount(). 1 if in single SIM mode, 2 if in dual
    // SIM mode.
    private int mActiveModemCount;
    private static PhoneSwitcher sPhoneSwitcher = null;
    protected int mActiveModemCount;
    protected static PhoneSwitcher sPhoneSwitcher = null;

    // Which primary (non-opportunistic) subscription is set as data subscription among all primary
    // subscriptions. This value usually comes from user setting, and it's the subscription used for
    // Internet data if mOpptDataSubId is not set.
    private int mPrimaryDataSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
    protected int mPrimaryDataSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;

    // mOpptDataSubId must be an active subscription. If it's set, it overrides mPrimaryDataSubId
    // to be used for Internet data.
@@ -203,7 +203,7 @@ public class PhoneSwitcher extends Handler {

    // The phone ID that has an active voice call. If set, and its mobile data setting is on,
    // it will become the mPreferredDataPhoneId.
    private int mPhoneIdInVoiceCall = SubscriptionManager.INVALID_PHONE_INDEX;
    protected int mPhoneIdInVoiceCall = SubscriptionManager.INVALID_PHONE_INDEX;

    @VisibleForTesting
    // It decides:
@@ -215,7 +215,7 @@ public class PhoneSwitcher extends Handler {
    protected int mPreferredDataPhoneId = SubscriptionManager.INVALID_PHONE_INDEX;

    // Subscription ID corresponds to mPreferredDataPhoneId.
    private WatchedInt mPreferredDataSubId =
    protected WatchedInt mPreferredDataSubId =
            new WatchedInt(SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
        @Override
        public void set(int newValue) {
@@ -232,7 +232,7 @@ public class PhoneSwitcher extends Handler {
    private ISetOpportunisticDataCallback mSetOpptSubCallback;

    private static final int EVENT_PRIMARY_DATA_SUB_CHANGED       = 101;
    private static final int EVENT_SUBSCRIPTION_CHANGED           = 102;
    protected static final int EVENT_SUBSCRIPTION_CHANGED           = 102;
    private static final int EVENT_REQUEST_NETWORK                = 103;
    private static final int EVENT_RELEASE_NETWORK                = 104;
    // ECBM has started/ended. If we just ended an emergency call and mEmergencyOverride is not
@@ -270,12 +270,12 @@ public class PhoneSwitcher extends Handler {
    // Depending on version of IRadioConfig, we need to send either RIL_REQUEST_ALLOW_DATA if it's
    // 1.0, or RIL_REQUEST_SET_PREFERRED_DATA if it's 1.1 or later. So internally mHalCommandToUse
    // will be either HAL_COMMAND_ALLOW_DATA or HAL_COMMAND_ALLOW_DATA or HAL_COMMAND_UNKNOWN.
    private static final int HAL_COMMAND_UNKNOWN        = 0;
    private static final int HAL_COMMAND_ALLOW_DATA     = 1;
    private static final int HAL_COMMAND_PREFERRED_DATA = 2;
    private int mHalCommandToUse = HAL_COMMAND_UNKNOWN;
    protected static final int HAL_COMMAND_UNKNOWN        = 0;
    protected static final int HAL_COMMAND_ALLOW_DATA     = 1;
    protected static final int HAL_COMMAND_PREFERRED_DATA = 2;
    protected int mHalCommandToUse = HAL_COMMAND_UNKNOWN;

    private RadioConfig mRadioConfig;
    protected RadioConfig mRadioConfig;

    private final static int MAX_LOCAL_LOG_LINES = 30;

@@ -777,8 +777,8 @@ public class PhoneSwitcher extends Handler {
        return (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
    }

    private static final boolean REQUESTS_CHANGED   = true;
    private static final boolean REQUESTS_UNCHANGED = false;
    protected static final boolean REQUESTS_CHANGED   = true;
    protected static final boolean REQUESTS_UNCHANGED = false;
    /**
     * Re-evaluate things. Do nothing if nothing's changed.
     *
@@ -788,7 +788,7 @@ public class PhoneSwitcher extends Handler {
     *
     * @return {@code True} if the default data subscription need to be changed.
     */
    private boolean onEvaluate(boolean requestsChanged, String reason) {
    protected boolean onEvaluate(boolean requestsChanged, String reason) {
        StringBuilder sb = new StringBuilder(reason);

        // If we use HAL_COMMAND_PREFERRED_DATA,
@@ -916,18 +916,18 @@ public class PhoneSwitcher extends Handler {
        return diffDetected;
    }

    private static class PhoneState {
    protected static class PhoneState {
        public volatile boolean active = false;
        public long lastRequested = 0;
    }

    @UnsupportedAppUsage
    private void activate(int phoneId) {
    protected void activate(int phoneId) {
        switchPhone(phoneId, true);
    }

    @UnsupportedAppUsage
    private void deactivate(int phoneId) {
    protected void deactivate(int phoneId) {
        switchPhone(phoneId, false);
    }

@@ -980,7 +980,7 @@ public class PhoneSwitcher extends Handler {
        msg.sendToTarget();
    }

    private void sendRilCommands(int phoneId) {
    protected void sendRilCommands(int phoneId) {
        if (!SubscriptionManager.isValidPhoneId(phoneId)) return;

        Message message = Message.obtain(this, EVENT_MODEM_COMMAND_DONE, phoneId);
@@ -1039,7 +1039,7 @@ public class PhoneSwitcher extends Handler {
        return phoneId;
    }

    private int getSubIdFromNetworkSpecifier(NetworkSpecifier specifier) {
    protected int getSubIdFromNetworkSpecifier(NetworkSpecifier specifier) {
        if (specifier == null) {
            return DEFAULT_SUBSCRIPTION_ID;
        }
@@ -1059,7 +1059,7 @@ public class PhoneSwitcher extends Handler {

    // This updates mPreferredDataPhoneId which decides which phone should handle default network
    // requests.
    private void updatePreferredDataPhoneId() {
    protected void updatePreferredDataPhoneId() {
        Phone voicePhone = findPhoneById(mPhoneIdInVoiceCall);
        if (mEmergencyOverride != null && findPhoneById(mEmergencyOverride.mPhoneId) != null) {
            // Override DDS for emergency even if user data is not enabled, since it is an
@@ -1096,7 +1096,7 @@ public class PhoneSwitcher extends Handler {
                mSubscriptionController.getSubIdUsingPhoneId(mPreferredDataPhoneId));
    }

    private void transitionToEmergencyPhone() {
    protected void transitionToEmergencyPhone() {
        if (mActiveModemCount <= 0) {
            log("No phones: unable to reset preferred phone for emergency");
            return;
@@ -1334,7 +1334,7 @@ public class PhoneSwitcher extends Handler {
                subId, needValidation ? 1 : 0, callback).sendToTarget();
    }

    private boolean isPhoneInVoiceCall(Phone phone) {
    protected boolean isPhoneInVoiceCall(Phone phone) {
        if (phone == null) {
            return false;
        }
@@ -1364,7 +1364,7 @@ public class PhoneSwitcher extends Handler {
    }

    @UnsupportedAppUsage
    private void log(String l) {
    protected void log(String l) {
        Rlog.d(LOG_TAG, l);
        mLocalLog.log(l);
    }
@@ -1380,7 +1380,7 @@ public class PhoneSwitcher extends Handler {
    /**
     * See {@link PhoneStateListener#LISTEN_ACTIVE_DATA_SUBSCRIPTION_ID_CHANGE}.
     */
    private void notifyPreferredDataSubIdChanged() {
    protected void notifyPreferredDataSubIdChanged() {
        TelephonyRegistryManager telephonyRegistryManager = (TelephonyRegistryManager) mContext
                .getSystemService(Context.TELEPHONY_REGISTRY_SERVICE);
        log("notifyPreferredDataSubIdChanged to " + mPreferredDataSubId.get());
+1 −1
Original line number Diff line number Diff line
@@ -244,7 +244,7 @@ public class SubscriptionController extends ISub.Stub {
        }
    }

    protected static class WatchedInt {
    public static class WatchedInt {
        private int mValue;

        public WatchedInt(int initialValue) {
+16 −16
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ import java.util.stream.Collectors;
 * {@hide}
 */
public class DcTracker extends Handler {
    private static final boolean DBG = true;
    protected static final boolean DBG = true;
    private static final boolean VDBG = false; // STOPSHIP if true
    private static final boolean VDBG_STALL = false; // STOPSHIP if true
    private static final boolean RADIO_TESTS = false;
@@ -239,7 +239,7 @@ public class DcTracker extends Handler {
    private static final int DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS_DEFAULT = 1000 * 60;

    private static final boolean DATA_STALL_SUSPECTED = true;
    private static final boolean DATA_STALL_NOT_SUSPECTED = false;
    protected static final boolean DATA_STALL_NOT_SUSPECTED = false;

    private static final String INTENT_DATA_STALL_ALARM =
            "com.android.internal.telephony.data-stall";
@@ -569,10 +569,10 @@ public class DcTracker extends Handler {
    // True if data stall detection is enabled
    private volatile boolean mDataStallNoRxEnabled = true;

    private volatile boolean mFailFast = false;
    protected volatile boolean mFailFast = false;

    // True when in voice call
    private boolean mInVoiceCall = false;
    protected boolean mInVoiceCall = false;

    /** Intent sent when the reconnect alarm fires. */
    private PendingIntent mReconnectIntent = null;
@@ -597,7 +597,7 @@ public class DcTracker extends Handler {
    private HashMap<String, Integer> mApnToDataConnectionId = new HashMap<String, Integer>();

    /** Phone.APN_TYPE_* ===> ApnContext */
    private ConcurrentHashMap<String, ApnContext> mApnContexts =
    protected ConcurrentHashMap<String, ApnContext> mApnContexts =
            new ConcurrentHashMap<String, ApnContext>();

    private SparseArray<ApnContext> mApnContextsByType = new SparseArray<ApnContext>();
@@ -1493,7 +1493,7 @@ public class DcTracker extends Handler {
        }
    }

    private void setupDataOnConnectableApn(ApnContext apnContext, String reason,
    protected void setupDataOnConnectableApn(ApnContext apnContext, String reason,
            RetryFailures retryFailures) {
        if (VDBG) log("setupDataOnAllConnectableApns: apnContext " + apnContext);

@@ -2233,7 +2233,7 @@ public class DcTracker extends Handler {
        return retry;
    }

    private void startReconnect(long delay, ApnContext apnContext) {
    protected void startReconnect(long delay, ApnContext apnContext) {
        Message msg = obtainMessage(DctConstants.EVENT_DATA_RECONNECT,
                       mPhone.getSubId(), mTransportType, apnContext);
        cancelReconnect(apnContext);
@@ -2251,7 +2251,7 @@ public class DcTracker extends Handler {
     *
     * @param apnContext on which the alarm should be stopped.
     */
    private void cancelReconnect(ApnContext apnContext) {
    protected void cancelReconnect(ApnContext apnContext) {
        if (apnContext == null) return;

        if (DBG) {
@@ -2792,7 +2792,7 @@ public class DcTracker extends Handler {
     * A SETUP (aka bringUp) has completed, possibly with an error. If
     * there is an error this method will call {@link #onDataSetupCompleteError}.
     */
    private void onDataSetupComplete(ApnContext apnContext, boolean success, int cause,
    protected void onDataSetupComplete(ApnContext apnContext, boolean success, int cause,
                                     @RequestNetworkType int requestType) {
        int apnType = ApnSetting.getApnTypesBitmaskFromString(apnContext.getApnType());
        List<Message> messageList = mRequestNetworkCompletionMsgs.get(apnType);
@@ -2974,7 +2974,7 @@ public class DcTracker extends Handler {
     * beginning if the list is empty. Between each SETUP request there will
     * be a delay defined by {@link #getApnDelay()}.
     */
    private void onDataSetupCompleteError(ApnContext apnContext,
    protected void onDataSetupCompleteError(ApnContext apnContext,
                                          @RequestNetworkType int requestType) {
        long delay = apnContext.getDelayForNextApn(mFailFast);

@@ -3121,7 +3121,7 @@ public class DcTracker extends Handler {
        }
    }

    private void onVoiceCallEnded() {
    protected void onVoiceCallEnded() {
        if (DBG) log("onVoiceCallEnded");
        mInVoiceCall = false;
        if (isConnected()) {
@@ -3138,7 +3138,7 @@ public class DcTracker extends Handler {
        setupDataOnAllConnectableApns(Phone.REASON_VOICE_CALL_ENDED, RetryFailures.ALWAYS);
    }

    private boolean isConnected() {
    protected boolean isConnected() {
        for (ApnContext apnContext : mApnContexts.values()) {
            if (apnContext.getState() == DctConstants.State.CONNECTED) {
                // At least one context is connected, return true
@@ -4426,13 +4426,13 @@ public class DcTracker extends Handler {
    /**
     * Polling stuff
     */
    private void resetPollStats() {
    protected void resetPollStats() {
        mTxPkts = -1;
        mRxPkts = -1;
        mNetStatPollPeriod = POLL_NETSTAT_MILLIS;
    }

    private void startNetStatPoll() {
    protected void startNetStatPoll() {
        if (getOverallState() == DctConstants.State.CONNECTED
                && mNetStatPollEnabled == false) {
            if (DBG) {
@@ -4873,7 +4873,7 @@ public class DcTracker extends Handler {
        startDataStallAlarm(suspectedStall);
    }

    private void startDataStallAlarm(boolean suspectedStall) {
    protected void startDataStallAlarm(boolean suspectedStall) {
        int delayInMs;

        if (mDsRecoveryHandler.isNoRxDataStallDetectionEnabled()
@@ -5065,7 +5065,7 @@ public class DcTracker extends Handler {
    }

    @RilRadioTechnology
    private int getDataRat() {
    protected int getDataRat() {
        ServiceState ss = mPhone.getServiceState();
        NetworkRegistrationInfo nrs = ss.getNetworkRegistrationInfo(
                NetworkRegistrationInfo.DOMAIN_PS, mTransportType);
Loading