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

Commit d0a8d559 authored by Hari Veerubhotla's avatar Hari Veerubhotla Committed by Gerrit - the friendly Code Review server
Browse files

Do not display sim absent when sim info is not available.

Display NO Service instead of NO SIM when sim is not ready

Change-Id: I168a9621e2121c8aee9d93b6048219cf3a4085f4
CRs-Fixed: 1001718
parent e3e145a9
Loading
Loading
Loading
Loading
+21 −1
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.os.SystemProperties;

import com.android.internal.telephony.IccCardConstants;
import com.android.internal.telephony.IccCardConstants.State;
@@ -158,10 +159,29 @@ public class CarrierText extends TextView {
        boolean showLocale = getContext().getResources().getBoolean(
                com.android.internal.R.bool.config_monitor_locale_change);
        CharSequence displayText = null;

        String carrier = "405854";
        List<SubscriptionInfo> subs = mKeyguardUpdateMonitor.getSubscriptionInfo(false);
        final int N = subs.size();
        if (DEBUG) Log.d(TAG, "updateCarrierText(): " + N);
        // If the Subscription Infos are not available and if any of the sims are not
        // in SIM_STATE_ABSENT,set displayText as "NO SERVICE".
        // displayText will be overrided after the Subscription infos are available and
        // displayText is set according to the SIM Status.
        String property = SystemProperties.get("persist.radio.atel.carrier");
            if (N == 0 && carrier.equals(property)) {
                 boolean isSimAbsent = false;
                 for (int i = 0; i < TelephonyManager.getDefault().getSimCount(); i++) {
                      if (TelephonyManager.getDefault().getSimState(i)
                            == TelephonyManager.SIM_STATE_ABSENT) {
                            isSimAbsent = true;
                            break;
                      }
            }
            if (!isSimAbsent) {
                allSimsMissing = false;
                displayText = getContext().getString(R.string.keyguard_carrier_default);
            }
        }
        for (int i = 0; i < N; i++) {
            CharSequence networkClass = "";
            int subId = subs.get(i).getSubscriptionId();