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

Commit 999b9671 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

release-request-2b6c1b3d-5e73-4d4a-9a8d-92acb8a1483b-for-git_oc-mr1-release-42...

release-request-2b6c1b3d-5e73-4d4a-9a8d-92acb8a1483b-for-git_oc-mr1-release-4212424 snap-temp-L13800000085536241

Change-Id: I8c9507dcc4d1d73d0075bf2fa28877aaa01dc241
parents 5f7649f5 97b88798
Loading
Loading
Loading
Loading
+7 −9
Original line number Original line Diff line number Diff line
@@ -71,7 +71,7 @@ public class SubscriptionInfoUpdater extends Handler {
    private static final int EVENT_SIM_LOCKED_QUERY_ICCID_DONE = 1;
    private static final int EVENT_SIM_LOCKED_QUERY_ICCID_DONE = 1;
    private static final int EVENT_GET_NETWORK_SELECTION_MODE_DONE = 2;
    private static final int EVENT_GET_NETWORK_SELECTION_MODE_DONE = 2;
    private static final int EVENT_SIM_LOADED = 3;
    private static final int EVENT_SIM_LOADED = 3;
    private static final int EVENT_SIM_ABSENT_OR_NOT_READY = 4;
    private static final int EVENT_SIM_ABSENT = 4;
    private static final int EVENT_SIM_LOCKED = 5;
    private static final int EVENT_SIM_LOCKED = 5;
    private static final int EVENT_SIM_IO_ERROR = 6;
    private static final int EVENT_SIM_IO_ERROR = 6;
    private static final int EVENT_SIM_UNKNOWN = 7;
    private static final int EVENT_SIM_UNKNOWN = 7;
@@ -195,10 +195,8 @@ public class SubscriptionInfoUpdater extends Handler {
            // TODO: All of the below should be converted to ACTION_INTERNAL_SIM_STATE_CHANGED to
            // TODO: All of the below should be converted to ACTION_INTERNAL_SIM_STATE_CHANGED to
            // ensure that the SubscriptionInfo is updated before the broadcasts are sent out.
            // ensure that the SubscriptionInfo is updated before the broadcasts are sent out.
            if (action.equals(TelephonyIntents.ACTION_SIM_STATE_CHANGED)) {
            if (action.equals(TelephonyIntents.ACTION_SIM_STATE_CHANGED)) {
                if (IccCardConstants.INTENT_VALUE_ICC_ABSENT.equals(simStatus)
                if (IccCardConstants.INTENT_VALUE_ICC_ABSENT.equals(simStatus)) {
                        || IccCardConstants.INTENT_VALUE_ICC_NOT_READY.equals(simStatus)) {
                    sendMessage(obtainMessage(EVENT_SIM_ABSENT, slotIndex, -1));
                    sendMessage(obtainMessage(EVENT_SIM_ABSENT_OR_NOT_READY, slotIndex, -1,
                            simStatus));
                } else if (IccCardConstants.INTENT_VALUE_ICC_UNKNOWN.equals(simStatus)) {
                } else if (IccCardConstants.INTENT_VALUE_ICC_UNKNOWN.equals(simStatus)) {
                    sendMessage(obtainMessage(EVENT_SIM_UNKNOWN, slotIndex, -1));
                    sendMessage(obtainMessage(EVENT_SIM_UNKNOWN, slotIndex, -1));
                } else if (IccCardConstants.INTENT_VALUE_ICC_CARD_IO_ERROR.equals(simStatus)) {
                } else if (IccCardConstants.INTENT_VALUE_ICC_CARD_IO_ERROR.equals(simStatus)) {
@@ -307,8 +305,8 @@ public class SubscriptionInfoUpdater extends Handler {
                handleSimLoaded(msg.arg1);
                handleSimLoaded(msg.arg1);
                break;
                break;


            case EVENT_SIM_ABSENT_OR_NOT_READY:
            case EVENT_SIM_ABSENT:
                handleSimAbsentOrNotReady(msg.arg1, (String) msg.obj);
                handleSimAbsent(msg.arg1);
                break;
                break;


            case EVENT_SIM_LOCKED:
            case EVENT_SIM_LOCKED:
@@ -492,7 +490,7 @@ public class SubscriptionInfoUpdater extends Handler {
        mCarrierServiceBindHelper.updateForPhoneId(slotId, simState);
        mCarrierServiceBindHelper.updateForPhoneId(slotId, simState);
    }
    }


    private void handleSimAbsentOrNotReady(int slotId, String simState) {
    private void handleSimAbsent(int slotId) {
        if (mIccId[slotId] != null && !mIccId[slotId].equals(ICCID_STRING_FOR_NO_SIM)) {
        if (mIccId[slotId] != null && !mIccId[slotId].equals(ICCID_STRING_FOR_NO_SIM)) {
            logd("SIM" + (slotId + 1) + " hot plug out");
            logd("SIM" + (slotId + 1) + " hot plug out");
        }
        }
@@ -500,7 +498,7 @@ public class SubscriptionInfoUpdater extends Handler {
        if (isAllIccIdQueryDone()) {
        if (isAllIccIdQueryDone()) {
            updateSubscriptionInfoByIccId();
            updateSubscriptionInfoByIccId();
        }
        }
        updateCarrierServices(slotId, simState);
        updateCarrierServices(slotId, IccCardConstants.INTENT_VALUE_ICC_ABSENT);
    }
    }


    private void handleSimError(int slotId) {
    private void handleSimError(int slotId) {
+2 −0
Original line number Original line Diff line number Diff line
@@ -1228,6 +1228,7 @@ public class ImsPhoneConnection extends Connection implements
        Rlog.i(LOG_TAG, "ImsPhoneConnection: changeToPausedState - setting paused bit; "
        Rlog.i(LOG_TAG, "ImsPhoneConnection: changeToPausedState - setting paused bit; "
                + "newVideoState=" + VideoProfile.videoStateToString(newVideoState));
                + "newVideoState=" + VideoProfile.videoStateToString(newVideoState));
        updateVideoState(newVideoState);
        updateVideoState(newVideoState);
        mShouldIgnoreVideoStateChanges = true;
    }
    }


    public void changeToUnPausedState() {
    public void changeToUnPausedState() {
@@ -1235,5 +1236,6 @@ public class ImsPhoneConnection extends Connection implements
        Rlog.i(LOG_TAG, "ImsPhoneConnection: changeToUnPausedState - unsetting paused bit; "
        Rlog.i(LOG_TAG, "ImsPhoneConnection: changeToUnPausedState - unsetting paused bit; "
                + "newVideoState=" + VideoProfile.videoStateToString(newVideoState));
                + "newVideoState=" + VideoProfile.videoStateToString(newVideoState));
        updateVideoState(newVideoState);
        updateVideoState(newVideoState);
        mShouldIgnoreVideoStateChanges = false;
    }
    }
}
}
+11 −3
Original line number Original line Diff line number Diff line
@@ -29,7 +29,6 @@ import android.telephony.SubscriptionManager;
import com.android.internal.R;
import com.android.internal.R;


import java.util.Arrays;
import java.util.Arrays;
import java.util.List;




public class NotificationChannelController {
public class NotificationChannelController {
@@ -39,11 +38,14 @@ public class NotificationChannelController {
     */
     */
    public static final String CHANNEL_ID_ALERT = "alert";
    public static final String CHANNEL_ID_ALERT = "alert";
    public static final String CHANNEL_ID_CALL_FORWARD = "callForward";
    public static final String CHANNEL_ID_CALL_FORWARD = "callForward";
    public static final String CHANNEL_ID_MOBILE_DATA_ALERT = "mobileDataAlert";
    public static final String CHANNEL_ID_MOBILE_DATA_ALERT = "mobileDataAlertNew";
    public static final String CHANNEL_ID_SMS = "sms";
    public static final String CHANNEL_ID_SMS = "sms";
    public static final String CHANNEL_ID_VOICE_MAIL = "voiceMail";
    public static final String CHANNEL_ID_VOICE_MAIL = "voiceMail";
    public static final String CHANNEL_ID_WFC = "wfc";
    public static final String CHANNEL_ID_WFC = "wfc";


    /** deprecated channel, replaced with @see #CHANNEL_ID_MOBILE_DATA_ALERT */
    private static final String CHANNEL_ID_MOBILE_DATA_ALERT_DEPRECATED = "mobileDataAlert";

    /**
    /**
     * Creates all notification channels and registers with NotificationManager. If a channel
     * Creates all notification channels and registers with NotificationManager. If a channel
     * with the same ID is already registered, NotificationManager will ignore this call.
     * with the same ID is already registered, NotificationManager will ignore this call.
@@ -63,7 +65,7 @@ public class NotificationChannelController {
                        NotificationManager.IMPORTANCE_LOW),
                        NotificationManager.IMPORTANCE_LOW),
                new NotificationChannel(CHANNEL_ID_MOBILE_DATA_ALERT,
                new NotificationChannel(CHANNEL_ID_MOBILE_DATA_ALERT,
                        context.getText(R.string.notification_channel_mobile_data_alert),
                        context.getText(R.string.notification_channel_mobile_data_alert),
                        NotificationManager.IMPORTANCE_DEFAULT),
                        NotificationManager.IMPORTANCE_LOW),
                new NotificationChannel(CHANNEL_ID_SMS,
                new NotificationChannel(CHANNEL_ID_SMS,
                        context.getText(R.string.notification_channel_sms),
                        context.getText(R.string.notification_channel_sms),
                        NotificationManager.IMPORTANCE_HIGH),
                        NotificationManager.IMPORTANCE_HIGH),
@@ -75,6 +77,12 @@ public class NotificationChannelController {
        if (getChannel(CHANNEL_ID_VOICE_MAIL, context) != null) {
        if (getChannel(CHANNEL_ID_VOICE_MAIL, context) != null) {
            migrateVoicemailNotificationSettings(context);
            migrateVoicemailNotificationSettings(context);
        }
        }
        // after channel has been created there is no way to change the channel setting
        // programmatically. delete the old channel and create a new one with a new ID.
        if (getChannel(CHANNEL_ID_MOBILE_DATA_ALERT_DEPRECATED, context) != null) {
            context.getSystemService(NotificationManager.class)
                    .deleteNotificationChannel(CHANNEL_ID_MOBILE_DATA_ALERT_DEPRECATED);
        }
    }
    }


    public NotificationChannelController(Context context) {
    public NotificationChannelController(Context context) {
+1 −24
Original line number Original line Diff line number Diff line
@@ -182,29 +182,6 @@ public class SubscriptionInfoUpdaterTest extends TelephonyTest {
        verify(mSubscriptionController, times(1)).notifySubscriptionInfoChanged();
        verify(mSubscriptionController, times(1)).notifySubscriptionInfoChanged();
    }
    }


    @Test
    @SmallTest
    public void testSimNotReady() throws Exception {
        doReturn(Arrays.asList(mSubInfo)).when(mSubscriptionController)
                .getSubInfoUsingSlotIndexWithCheck(eq(FAKE_SUB_ID_1), anyBoolean(), anyString());
        Intent mIntent = new Intent(TelephonyIntents.ACTION_SIM_STATE_CHANGED);
        mIntent.putExtra(IccCardConstants.INTENT_KEY_ICC_STATE,
                IccCardConstants.INTENT_VALUE_ICC_NOT_READY);
        mIntent.putExtra(PhoneConstants.PHONE_KEY, FAKE_SUB_ID_1);

        mContext.sendBroadcast(mIntent);

        waitForMs(100);
        verify(mSubscriptionContent).put(eq(SubscriptionManager.SIM_SLOT_INDEX),
                eq(SubscriptionManager.INVALID_SIM_SLOT_INDEX));

        CarrierConfigManager mConfigManager = (CarrierConfigManager)
                mContext.getSystemService(Context.CARRIER_CONFIG_SERVICE);
        verify(mConfigManager).updateConfigForPhoneId(eq(FAKE_SUB_ID_1),
                eq(IccCardConstants.INTENT_VALUE_ICC_NOT_READY));
        verify(mSubscriptionController, times(1)).notifySubscriptionInfoChanged();
    }

    @Test
    @Test
    @SmallTest
    @SmallTest
    public void testSimUnknown() throws Exception {
    public void testSimUnknown() throws Exception {