Merge "Enforce sysui-held permissions when getting main launch intent" into udc-dev am: 2d3f07bfc2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22997262 Change-Id: I2aeb589a1afebd89a729666aa60df05d5746094e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -765,10 +765,6 @@ public class LauncherApps {
|
|||||||
@Nullable
|
@Nullable
|
||||||
public PendingIntent getMainActivityLaunchIntent(@NonNull ComponentName component,
|
public PendingIntent getMainActivityLaunchIntent(@NonNull ComponentName component,
|
||||||
@Nullable Bundle startActivityOptions, @NonNull UserHandle user) {
|
@Nullable Bundle startActivityOptions, @NonNull UserHandle user) {
|
||||||
if (mContext.checkSelfPermission(android.Manifest.permission.START_TASKS_FROM_RECENTS)
|
|
||||||
!= PackageManager.PERMISSION_GRANTED) {
|
|
||||||
Log.w(TAG, "Only allowed for recents.");
|
|
||||||
}
|
|
||||||
logErrorForInvalidProfileAccess(user);
|
logErrorForInvalidProfileAccess(user);
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Log.i(TAG, "GetMainActivityLaunchIntent " + component + " " + user);
|
Log.i(TAG, "GetMainActivityLaunchIntent " + component + " " + user);
|
||||||
|
|||||||
@@ -1330,7 +1330,11 @@ public class LauncherAppsService extends SystemService {
|
|||||||
@Override
|
@Override
|
||||||
public PendingIntent getActivityLaunchIntent(String callingPackage, ComponentName component,
|
public PendingIntent getActivityLaunchIntent(String callingPackage, ComponentName component,
|
||||||
UserHandle user) {
|
UserHandle user) {
|
||||||
ensureShortcutPermission(callingPackage);
|
if (mContext.checkPermission(android.Manifest.permission.START_TASKS_FROM_RECENTS,
|
||||||
|
injectBinderCallingPid(), injectBinderCallingUid())
|
||||||
|
!= PackageManager.PERMISSION_GRANTED) {
|
||||||
|
throw new SecurityException("Permission START_TASKS_FROM_RECENTS required");
|
||||||
|
}
|
||||||
if (!canAccessProfile(user.getIdentifier(), "Cannot start activity")) {
|
if (!canAccessProfile(user.getIdentifier(), "Cannot start activity")) {
|
||||||
throw new ActivityNotFoundException("Activity could not be found");
|
throw new ActivityNotFoundException("Activity could not be found");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user