Use Intent.EXTRA_USER for ACTION_CHANGE_DEFAULT

Use Intent.EXTRA_USER to pass the UserHandle as the extra field of
ACTION_CHANGE_DEFAULT.

Bug: 215300017
Test: manual
Change-Id: I8862ae509638c7c264f49c4bc5753a65e8fdcfbc
This commit is contained in:
Jack Yu
2022-02-09 21:34:59 +08:00
parent e299e37585
commit c7b568751e

View File

@@ -58,7 +58,11 @@ public final class PaymentDefaultDialog extends AlertActivity implements
ComponentName component = intent.getParcelableExtra( ComponentName component = intent.getParcelableExtra(
CardEmulation.EXTRA_SERVICE_COMPONENT); CardEmulation.EXTRA_SERVICE_COMPONENT);
String category = intent.getStringExtra(CardEmulation.EXTRA_CATEGORY); String category = intent.getStringExtra(CardEmulation.EXTRA_CATEGORY);
int userId = intent.getIntExtra(CardEmulation.EXTRA_USERID, UserHandle.myUserId()); UserHandle userHandle = intent.getParcelableExtra(Intent.EXTRA_USER);
if (userHandle == null) {
userHandle = UserHandle.CURRENT;
}
int userId = userHandle.getIdentifier();
setResult(RESULT_CANCELED); setResult(RESULT_CANCELED);
if (!buildDialog(component, category, userId)) { if (!buildDialog(component, category, userId)) {