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

Commit 35576884 authored by Grace Chen's avatar Grace Chen
Browse files

Default CDMA subscription source to RUIM/SIM

Operators read CDMA subscription from RUIM/SIM now thus change
the default hardcoded preference everywhere. Add code clean-up to
make the default come from a single source, the Phone interface.

Additional rework proposed in http://b/62299272, but this corrects
immediate issue where CDMA SSM was defaulting to NV instead of RUIM
/SIM and caused CSIM subscription to not load and 'no sim' symptom
for many users.

Bug: 62143087
Test: None
Change-Id: I384cf6ac4d5fad54ee64edc3b95da4b799bd4d1b
parent 474e64b2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -175,7 +175,7 @@ public interface PhoneInternalInterface {
    static final int CDMA_SUBSCRIPTION_RUIM_SIM = 0; // RUIM/SIM (default)
    static final int CDMA_SUBSCRIPTION_NV       = 1; // NV -> non-volatile memory

    static final int PREFERRED_CDMA_SUBSCRIPTION = CDMA_SUBSCRIPTION_NV;
    static final int PREFERRED_CDMA_SUBSCRIPTION = CDMA_SUBSCRIPTION_RUIM_SIM;

    static final int TTY_MODE_OFF = 0;
    static final int TTY_MODE_FULL = 1;
+4 −3
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.internal.telephony.cdma;
import java.util.concurrent.atomic.AtomicInteger;

import com.android.internal.telephony.CommandsInterface;
import com.android.internal.telephony.Phone;
import android.content.Context;
import android.os.AsyncResult;
import android.os.Handler;
@@ -44,7 +45,6 @@ public class CdmaSubscriptionSourceManager extends Handler {
    public static final int SUBSCRIPTION_SOURCE_UNKNOWN = -1;
    public static final int SUBSCRIPTION_FROM_RUIM      = 0; /* CDMA subscription from RUIM */
    public static final int SUBSCRIPTION_FROM_NV        = 1; /* CDMA subscription from NV */
    public static final int PREFERRED_CDMA_SUBSCRIPTION = SUBSCRIPTION_FROM_RUIM;

    private static CdmaSubscriptionSourceManager sInstance;
    private static final Object sReferenceCountMonitor = new Object();
@@ -55,7 +55,8 @@ public class CdmaSubscriptionSourceManager extends Handler {
    private RegistrantList mCdmaSubscriptionSourceChangedRegistrants = new RegistrantList();

    // Type of CDMA subscription source
    private AtomicInteger mCdmaSubscriptionSource = new AtomicInteger(SUBSCRIPTION_FROM_NV);
    private AtomicInteger mCdmaSubscriptionSource =
            new AtomicInteger(Phone.PREFERRED_CDMA_SUBSCRIPTION);

    // Constructor
    private CdmaSubscriptionSourceManager(Context context, CommandsInterface ci) {
@@ -161,7 +162,7 @@ public class CdmaSubscriptionSourceManager extends Handler {
    public static int getDefault(Context context) {
        // Get the default value from the Settings
        int subscriptionSource = Settings.Global.getInt(context.getContentResolver(),
                Settings.Global.CDMA_SUBSCRIPTION_MODE, PREFERRED_CDMA_SUBSCRIPTION);
                Settings.Global.CDMA_SUBSCRIPTION_MODE, Phone.PREFERRED_CDMA_SUBSCRIPTION);
        Rlog.d(LOG_TAG, "subscriptionSource from settings: " + subscriptionSource);
        return subscriptionSource;
    }