diff options
author | 2024-02-14 16:32:09 +0000 | |
---|---|---|
committer | 2024-02-14 16:32:09 +0000 | |
commit | 1ee6c39a12e82341d65eb6b6b4c4e4426ab2432a (patch) | |
tree | 62d378624b0a97a7160a066d754e8aeb13cb81b3 | |
parent | 7669e6b8b45bdbe7f5ce4e93ff0c90bc471723ba (diff) | |
parent | df71f480dee389192a080fba6fe417f83506b33b (diff) |
Merge "Remove direct reference to Activity getIntent()" into main
-rw-r--r-- | java/src/com/android/intentresolver/v2/ChooserActivity.java | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/java/src/com/android/intentresolver/v2/ChooserActivity.java b/java/src/com/android/intentresolver/v2/ChooserActivity.java index cdc05b95..072c56de 100644 --- a/java/src/com/android/intentresolver/v2/ChooserActivity.java +++ b/java/src/com/android/intentresolver/v2/ChooserActivity.java @@ -485,7 +485,7 @@ public class ChooserActivity extends Hilt_ChooserActivity implements .get(BasePreviewViewModel.class); previewViewModel.init( chooserRequest.getTargetIntent(), - getIntent(), + mActivityLaunch.getIntent(), chooserRequest.getAdditionalContentUri(), chooserRequest.getFocusedItemPosition(), mChooserServiceFeatureFlags.chooserPayloadToggling()); @@ -807,10 +807,6 @@ public class ChooserActivity extends Hilt_ChooserActivity implements mChooserMultiProfilePagerAdapter.getActiveListAdapter().handlePackagesChanged(); } - public boolean super_shouldAutoLaunchSingleChoice(TargetInfo target) { - return !target.isSuspended(); - } - /** Start the activity specified by the {@link TargetInfo}.*/ public final void safelyStartActivity(TargetInfo cti) { // In case cloned apps are present, we would want to start those apps in cloned user @@ -1652,14 +1648,12 @@ public class ChooserActivity extends Hilt_ChooserActivity implements } public boolean shouldAutoLaunchSingleChoice(TargetInfo target) { - // Note that this is only safe because the Intent handled by the ChooserActivity is - // guaranteed to contain no extras unknown to the local ClassLoader. That is why this - // method can not be replaced in the ResolverActivity whole hog. - if (!super_shouldAutoLaunchSingleChoice(target)) { + if (target.isSuspended()) { return false; } - return getIntent().getBooleanExtra(Intent.EXTRA_AUTO_LAUNCH_SINGLE_CHOICE, true); + return mActivityLaunch.getIntent().getBooleanExtra(Intent.EXTRA_AUTO_LAUNCH_SINGLE_CHOICE, + true); } private void showTargetDetails(TargetInfo targetInfo) { |