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

Commit 323606ee authored by Jack Yu's avatar Jack Yu
Browse files

Correct null UserHandle handling for ACTION_CHANGE_DEFAULT

When there is no userhandle passed via Intent.EXTRA_USER,
use UserHandle.myUserId() instead.

Bug: 221561126
Test: set default payment in GPay app
Change-Id: I272aa6674b7a18523fe02fadeb4a502a67303ee7
parent 6b985b36
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -59,10 +59,13 @@ public final class PaymentDefaultDialog extends AlertActivity implements
                CardEmulation.EXTRA_SERVICE_COMPONENT);
        String category = intent.getStringExtra(CardEmulation.EXTRA_CATEGORY);
        UserHandle userHandle = intent.getParcelableExtra(Intent.EXTRA_USER);

        int userId;
        if (userHandle == null) {
            userHandle = UserHandle.CURRENT;
            userId = UserHandle.myUserId();
        } else {
            userId = userHandle.getIdentifier();
        }
        int userId = userHandle.getIdentifier();

        setResult(RESULT_CANCELED);
        if (!buildDialog(component, category, userId)) {