diff options
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/ActivityManagerInternal.java | 11 | ||||
| -rw-r--r-- | core/java/android/content/pm/ILauncherApps.aidl | 5 | ||||
| -rw-r--r-- | core/java/android/content/pm/LauncherApps.java | 6 |
3 files changed, 18 insertions, 4 deletions
diff --git a/core/java/android/app/ActivityManagerInternal.java b/core/java/android/app/ActivityManagerInternal.java index 97c9fa58622f..7338bfea9d4d 100644 --- a/core/java/android/app/ActivityManagerInternal.java +++ b/core/java/android/app/ActivityManagerInternal.java @@ -236,6 +236,17 @@ public abstract class ActivityManagerInternal { int userId, Intent[] intents, Bundle bOptions); /** + * Start activity {@code intent} without calling user-id check. + * + * - DO NOT call it with the calling UID cleared. + * - The caller must do the calling user ID check. + * + * @return error codes used by {@link IActivityManager#startActivity} and its siblings. + */ + public abstract int startActivityAsUser(IApplicationThread caller, String callingPackage, + Intent intent, @Nullable Bundle options, int userId); + + /** * Get the procstate for the UID. The return value will be between * {@link ActivityManager#MIN_PROCESS_STATE} and {@link ActivityManager#MAX_PROCESS_STATE}. * Note if the UID doesn't exist, it'll return {@link ActivityManager#PROCESS_STATE_NONEXISTENT} diff --git a/core/java/android/content/pm/ILauncherApps.aidl b/core/java/android/content/pm/ILauncherApps.aidl index ae1c2071eeca..ba7710b8ef48 100644 --- a/core/java/android/content/pm/ILauncherApps.aidl +++ b/core/java/android/content/pm/ILauncherApps.aidl @@ -16,6 +16,7 @@ package android.content.pm; +import android.app.IApplicationThread; import android.content.ComponentName; import android.content.Intent; import android.content.IntentSender; @@ -42,10 +43,10 @@ interface ILauncherApps { String callingPackage, String packageName, in UserHandle user); ActivityInfo resolveActivity( String callingPackage, in ComponentName component, in UserHandle user); - void startActivityAsUser(String callingPackage, + void startActivityAsUser(in IApplicationThread caller, String callingPackage, in ComponentName component, in Rect sourceBounds, in Bundle opts, in UserHandle user); - void showAppDetailsAsUser( + void showAppDetailsAsUser(in IApplicationThread caller, String callingPackage, in ComponentName component, in Rect sourceBounds, in Bundle opts, in UserHandle user); boolean isPackageEnabled(String callingPackage, String packageName, in UserHandle user); diff --git a/core/java/android/content/pm/LauncherApps.java b/core/java/android/content/pm/LauncherApps.java index 8717601cfde0..fa423e29406a 100644 --- a/core/java/android/content/pm/LauncherApps.java +++ b/core/java/android/content/pm/LauncherApps.java @@ -548,7 +548,8 @@ public class LauncherApps { Log.i(TAG, "StartMainActivity " + component + " " + user.getIdentifier()); } try { - mService.startActivityAsUser(mContext.getPackageName(), + mService.startActivityAsUser(mContext.getIApplicationThread(), + mContext.getPackageName(), component, sourceBounds, opts, user); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); @@ -568,7 +569,8 @@ public class LauncherApps { Rect sourceBounds, Bundle opts) { logErrorForInvalidProfileAccess(user); try { - mService.showAppDetailsAsUser(mContext.getPackageName(), + mService.showAppDetailsAsUser(mContext.getIApplicationThread(), + mContext.getPackageName(), component, sourceBounds, opts, user); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); |
