Fix permission issue in legacy shortcut am: c53818a16b am: d19cb72bae am: 3c771b12fb
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/23526090 Change-Id: I679537a6b5e8831065e8a665ecd6e686da20988f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -136,6 +136,18 @@ public class PackageManagerHelper {
|
||||
* 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
|
||||
|
||||
Reference in New Issue
Block a user