Merge 34ece9b8e4 on remote branch

Change-Id: Ibe81ef0aefae337078e7a3191103315edaa6a361
This commit is contained in:
Linux Build Service Account 2023-09-06 17:18:13 -07:00
commit 8c56a12c66
2 changed files with 12 additions and 1 deletions

View File

@ -44,7 +44,6 @@
<!-- for rotating surface by arbitrary degree -->
<uses-permission android:name="android.permission.ROTATE_SURFACE_FLINGER" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.READ_HOME_APP_SEARCH_DATA" />
<!--
Permissions required for read/write access to the workspace data. These permission name

View File

@ -145,6 +145,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