Revert "[RESTRICT AUTOMERGE] Fix permission issue in legacy shortcut"

This reverts commit 3de2b51b6b.

Reason for revert: 285847936 getParcelable requires API level 33 (current min is 26)

Change-Id: I83d47f3b55c8a4f48b4ace54b8106c97a854a394
This commit is contained in:
Renato Grottesi
2023-06-05 11:17:41 +00:00
committed by Android (Google) Code Review
parent 3de2b51b6b
commit dedca445bb
@@ -145,18 +145,6 @@ 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 = extras.getParcelable(Intent.EXTRA_INTENT, Intent.class);
if (intent == null) {
return true;
}
}
ResolveInfo target = mPm.resolveActivity(intent, 0);
if (target == null) {
// Not a valid target