diff options
| author | 2022-11-16 16:54:10 +0000 | |
|---|---|---|
| committer | 2022-11-16 16:58:41 +0000 | |
| commit | 20e7b8d9ebf0781a8afabfba1bff22fc78f5e9ab (patch) | |
| tree | 057173e855ced0a2c146b3c3578c02291fb0531b | |
| parent | cb118b6a7136a0bcb50fbf7ec5e37a6ea90783ce (diff) | |
Extract getIntentUser function in ResolverActivity
This should resolve conflicts with master.
Bug: 233348916
Test: presubmit
Change-Id: If5bf5c73441dc9c54822d0c2b36f16b11ea892ec
| -rw-r--r-- | core/java/com/android/internal/app/ResolverActivity.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/core/java/com/android/internal/app/ResolverActivity.java b/core/java/com/android/internal/app/ResolverActivity.java index e926605ae88a..a237e986f1d7 100644 --- a/core/java/com/android/internal/app/ResolverActivity.java +++ b/core/java/com/android/internal/app/ResolverActivity.java @@ -492,6 +492,12 @@ public class ResolverActivity extends Activity implements /* workProfileUserHandle= */ null); } + private UserHandle getIntentUser() { + return getIntent().hasExtra(EXTRA_CALLING_USER) + ? getIntent().getParcelableExtra(EXTRA_CALLING_USER, android.os.UserHandle.class) + : getUser(); + } + private ResolverMultiProfilePagerAdapter createResolverMultiProfilePagerAdapterForTwoProfiles( Intent[] initialIntents, List<ResolveInfo> rList, @@ -500,9 +506,7 @@ public class ResolverActivity extends Activity implements // the intent resolver is started in the other profile. Since this is the only case when // this happens, we check for it here and set the current profile's tab. int selectedProfile = getCurrentProfile(); - UserHandle intentUser = getIntent().hasExtra(EXTRA_CALLING_USER) - ? getIntent().getParcelableExtra(EXTRA_CALLING_USER, android.os.UserHandle.class) - : getUser(); + UserHandle intentUser = getIntentUser(); if (!getUser().equals(intentUser)) { if (getPersonalProfileUserHandle().equals(intentUser)) { selectedProfile = PROFILE_PERSONAL; |