commit | 3c771b12fbe1abcc216736536fcbff9f058b13e0 | [log] [tgz] |
---|---|---|
author | Pinyao Ting <pinyaoting@google.com> | Tue Jun 06 01:33:35 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Jun 06 01:33:35 2023 +0000 |
tree | 54f3d14db613aa321f60e0158e228117a9f2a72a | |
parent | e29216a55d52547345fcf810c498e69bf8312306 [diff] | |
parent | d19cb72bae9b995ea42d1294b1fd8b1c796f2457 [diff] |
Fix permission issue in legacy shortcut am: c53818a16b am: d19cb72bae Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/23526090 Change-Id: I8a0137303fdbb2811788efef4290a5bacd469f65 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/src/com/android/launcher3/util/PackageManagerHelper.java b/src/com/android/launcher3/util/PackageManagerHelper.java index 08ec591..1bcdab1 100644 --- a/src/com/android/launcher3/util/PackageManagerHelper.java +++ b/src/com/android/launcher3/util/PackageManagerHelper.java
@@ -136,6 +136,18 @@ * any permissions */ public boolean hasPermissionForActivity(Intent intent, String srcPackage) { + // b/270152142 + if (Intent.ACTION_CHOOSER.equals(intent.getAction())) { + final Bundle extras = intent.getExtras(); + if (extras == null) { + return true; + } + // If given intent is ACTION_CHOOSER, verify srcPackage has permission over EXTRA_INTENT + intent = (Intent) extras.getParcelable(Intent.EXTRA_INTENT); + if (intent == null) { + return true; + } + } ResolveInfo target = mPm.resolveActivity(intent, 0); if (target == null) { // Not a valid target