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

Commit c2daeaf7 authored by liurong's avatar liurong
Browse files

Optimized Code: call direct method to get integer extra



Description: Make the default preferred sim slot as the first one(0) when get PREFERRED_SIM.

Test: NA
Change-Id: Id54bdbefd413c58ecd637cb8ff522861ead79331
Signed-off-by: default avatarliurong <liurong@xiaomi.com>
parent 084c2040
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -59,8 +59,7 @@ public class SimDialogActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        final Bundle extras = getIntent().getExtras();
        final int dialogType = extras.getInt(DIALOG_TYPE_KEY, INVALID_PICK);
        final int dialogType = getIntent().getIntExtra(DIALOG_TYPE_KEY, INVALID_PICK);

        switch (dialogType) {
            case DATA_PICK:
@@ -69,7 +68,7 @@ public class SimDialogActivity extends Activity {
                createDialog(this, dialogType).show();
                break;
            case PREFERRED_PICK:
                displayPreferredDialog(extras.getInt(PREFERRED_SIM));
                displayPreferredDialog(getIntent().getIntExtra(PREFERRED_SIM, 0));
                break;
            default:
                throw new IllegalArgumentException("Invalid dialog type " + dialogType + " sent.");