Merge t-mpr-2023-08
Change-Id: I2804164cfa5e7c10256711ffdaadf3d2930823fd
This commit is contained in:
commit
1711f06170
|
@ -44,7 +44,6 @@
|
||||||
<!-- for rotating surface by arbitrary degree -->
|
<!-- for rotating surface by arbitrary degree -->
|
||||||
<uses-permission android:name="android.permission.ROTATE_SURFACE_FLINGER" />
|
<uses-permission android:name="android.permission.ROTATE_SURFACE_FLINGER" />
|
||||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
<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
|
Permissions required for read/write access to the workspace data. These permission name
|
||||||
|
|
|
@ -145,6 +145,18 @@ public class PackageManagerHelper {
|
||||||
* any permissions
|
* any permissions
|
||||||
*/
|
*/
|
||||||
public boolean hasPermissionForActivity(Intent intent, String srcPackage) {
|
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);
|
ResolveInfo target = mPm.resolveActivity(intent, 0);
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
// Not a valid target
|
// Not a valid target
|
||||||
|
|
Loading…
Reference in New Issue