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

Commit 400c63ad authored by Jack Yu's avatar Jack Yu
Browse files

Fixed flaky unit tests

Adding checks before the actual root cause
is found.

Test: Unit tests
Bug: 78357839
Change-Id: Ic87a9ad1f3013e224ff822304c926da83ab51723
parent af36be55
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -3805,11 +3805,14 @@ public class ServiceStateTracker extends Handler {
        }

        // if there is no SIM present, do not poll signal strength
        if (UiccController.getInstance() != null) {
            UiccCard uiccCard = UiccController.getInstance().getUiccCard(getPhoneId());
            if (uiccCard == null || uiccCard.getCardState() == CardState.CARDSTATE_ABSENT) {
                log("Not polling signal strength due to absence of SIM");
                return;
            }
        }


        Message msg;

+1 −3
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ import android.telephony.Rlog;
import android.telephony.TelephonyManager;
import android.util.LocalLog;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telephony.CommandException;
import com.android.internal.telephony.CommandsInterface;
import com.android.internal.telephony.IccCardConstants;
@@ -198,8 +197,7 @@ public class UiccController extends Handler {
    public static UiccController getInstance() {
        synchronized (mLock) {
            if (mInstance == null) {
                throw new RuntimeException(
                        "UiccController.getInstance can't be called before make()");
                Rlog.e(LOG_TAG, "UiccController.getInstance can't be called before make()");
            }
            return mInstance;
        }