Fix permission bypass in legacy shortcut am: b7b192bd7f am: a30a52e708 am: 7446209d60 am: c08b5f4760
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/24751391 Change-Id: I91cfe8344b819d1ae94a7110f99e37b4b116e7dd Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -138,15 +138,8 @@ public class PackageManagerHelper {
|
|||||||
public boolean hasPermissionForActivity(Intent intent, String srcPackage) {
|
public boolean hasPermissionForActivity(Intent intent, String srcPackage) {
|
||||||
// b/270152142
|
// b/270152142
|
||||||
if (Intent.ACTION_CHOOSER.equals(intent.getAction())) {
|
if (Intent.ACTION_CHOOSER.equals(intent.getAction())) {
|
||||||
final Bundle extras = intent.getExtras();
|
// Chooser shortcuts is not a valid target
|
||||||
if (extras == null) {
|
return false;
|
||||||
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);
|
ResolveInfo target = mPm.resolveActivity(intent, 0);
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user