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

Commit e3c11405 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Migrate getSimStateForSlotIndex to TelephonyManager"

parents 72c87360 80b86fa2
Loading
Loading
Loading
Loading
+0 −41
Original line number Diff line number Diff line
@@ -77,7 +77,6 @@ import android.util.Log;
import com.android.ims.ImsManager;
import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telephony.IccCardConstants.State;
import com.android.internal.telephony.data.PhoneSwitcher;
import com.android.internal.telephony.metrics.TelephonyMetrics;
import com.android.internal.telephony.uicc.IccUtils;
@@ -3162,46 +3161,6 @@ public class SubscriptionController extends ISub.Stub {
        return retVal;
    }

    /**
     * Get the SIM state for the slot index.
     * For Remote-SIMs, this method returns {@link IccCardConstants.State#UNKNOWN}
     * @return SIM state as the ordinal of {@link IccCardConstants.State}
     */
    @Override
    public int getSimStateForSlotIndex(int slotIndex) {
        State simState;
        String err;
        if (slotIndex < 0) {
            simState = IccCardConstants.State.UNKNOWN;
            err = "invalid slotIndex";
        } else {
            Phone phone = null;
            try {
                phone = PhoneFactory.getPhone(slotIndex);
            } catch (IllegalStateException e) {
                // ignore
            }
            if (phone == null) {
                simState = IccCardConstants.State.UNKNOWN;
                err = "phone == null";
            } else {
                IccCard icc = phone.getIccCard();
                if (icc == null) {
                    simState = IccCardConstants.State.UNKNOWN;
                    err = "icc == null";
                } else {
                    simState = icc.getState();
                    err = "";
                }
            }
        }
        if (VDBG) {
            logd("getSimStateForSlotIndex: " + err + " simState=" + simState
                    + " ordinal=" + simState.ordinal() + " slotIndex=" + slotIndex);
        }
        return simState.ordinal();
    }

    /**
     * Store properties associated with SubscriptionInfo in database
     * @param subId Subscription Id of Subscription
+0 −5
Original line number Diff line number Diff line
@@ -2319,11 +2319,6 @@ public class SubscriptionManagerService extends ISub.Stub {
        }
    }

    @Override
    public int getSimStateForSlotIndex(int slotIndex) {
        return 0;
    }

    /**
     * Check if a subscription is active.
     *