Loading core/java/android/content/pm/ILauncherApps.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,7 @@ interface ILauncherApps { List<String> getPreInstalledSystemPackages(in UserHandle user); IntentSender getAppMarketActivityIntent(String callingPackage, String packageName, in UserHandle user); IntentSender getPrivateSpaceSettingsIntent(); void showAppDetailsAsUser(in IApplicationThread caller, String callingPackage, String callingFeatureId, in ComponentName component, in Rect sourceBounds, in Bundle opts, in UserHandle user); Loading core/java/android/content/pm/LauncherApps.java +22 −0 Original line number Diff line number Diff line Loading @@ -898,6 +898,28 @@ public class LauncherApps { } } /** * Returns {@link IntentSender} which can be used to start the Private Space Settings Activity. * * <p> Caller should have {@link android.app.role.RoleManager.ROLE_HOME} and either of the * permissions required.</p> * * @return {@link IntentSender} object which launches the Private Space Settings Activity, if * successful, null otherwise. * @hide */ @Nullable @FlaggedApi(Flags.FLAG_ALLOW_PRIVATE_PROFILE) @RequiresPermission(conditional = true, anyOf = {ACCESS_HIDDEN_PROFILES_FULL, ACCESS_HIDDEN_PROFILES}) public IntentSender getPrivateSpaceSettingsIntent() { try { return mService.getPrivateSpaceSettingsIntent(); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } /** * Returns the activity info for a given intent and user handle, if it resolves. Otherwise it * returns null. Loading services/core/java/com/android/server/pm/LauncherAppsService.java +24 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,9 @@ import java.util.zip.ZipOutputStream; public class LauncherAppsService extends SystemService { private static final String WM_TRACE_DIR = "/data/misc/wmtrace/"; private static final String VC_FILE_SUFFIX = ".vc"; // TODO(b/310027945): Update the intent name. private static final String PS_SETTINGS_INTENT = "com.android.settings.action.PRIVATE_SPACE_SETUP_FLOW"; private static final Set<PosixFilePermission> WM_TRACE_FILE_PERMISSIONS = Set.of( PosixFilePermission.OWNER_WRITE, Loading Loading @@ -1777,6 +1780,27 @@ public class LauncherAppsService extends SystemService { } } @Override public @Nullable IntentSender getPrivateSpaceSettingsIntent() { if (!canAccessHiddenProfile(getCallingUid(), getCallingPid())) { Slog.e(TAG, "Caller cannot access hidden profiles"); return null; } final long identity = Binder.clearCallingIdentity(); try { Intent psSettingsIntent = new Intent(PS_SETTINGS_INTENT); psSettingsIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); final PendingIntent pi = PendingIntent.getActivity(mContext, /* requestCode */ 0, psSettingsIntent, PendingIntent.FLAG_IMMUTABLE | FLAG_UPDATE_CURRENT); return pi == null ? null : pi.getIntentSender(); } finally { Binder.restoreCallingIdentity(identity); } } @Nullable private IntentSender buildAppMarketIntentSenderForUser(@NonNull UserHandle user) { Intent appMarketIntent = new Intent(Intent.ACTION_MAIN); Loading Loading
core/java/android/content/pm/ILauncherApps.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,7 @@ interface ILauncherApps { List<String> getPreInstalledSystemPackages(in UserHandle user); IntentSender getAppMarketActivityIntent(String callingPackage, String packageName, in UserHandle user); IntentSender getPrivateSpaceSettingsIntent(); void showAppDetailsAsUser(in IApplicationThread caller, String callingPackage, String callingFeatureId, in ComponentName component, in Rect sourceBounds, in Bundle opts, in UserHandle user); Loading
core/java/android/content/pm/LauncherApps.java +22 −0 Original line number Diff line number Diff line Loading @@ -898,6 +898,28 @@ public class LauncherApps { } } /** * Returns {@link IntentSender} which can be used to start the Private Space Settings Activity. * * <p> Caller should have {@link android.app.role.RoleManager.ROLE_HOME} and either of the * permissions required.</p> * * @return {@link IntentSender} object which launches the Private Space Settings Activity, if * successful, null otherwise. * @hide */ @Nullable @FlaggedApi(Flags.FLAG_ALLOW_PRIVATE_PROFILE) @RequiresPermission(conditional = true, anyOf = {ACCESS_HIDDEN_PROFILES_FULL, ACCESS_HIDDEN_PROFILES}) public IntentSender getPrivateSpaceSettingsIntent() { try { return mService.getPrivateSpaceSettingsIntent(); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } /** * Returns the activity info for a given intent and user handle, if it resolves. Otherwise it * returns null. Loading
services/core/java/com/android/server/pm/LauncherAppsService.java +24 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,9 @@ import java.util.zip.ZipOutputStream; public class LauncherAppsService extends SystemService { private static final String WM_TRACE_DIR = "/data/misc/wmtrace/"; private static final String VC_FILE_SUFFIX = ".vc"; // TODO(b/310027945): Update the intent name. private static final String PS_SETTINGS_INTENT = "com.android.settings.action.PRIVATE_SPACE_SETUP_FLOW"; private static final Set<PosixFilePermission> WM_TRACE_FILE_PERMISSIONS = Set.of( PosixFilePermission.OWNER_WRITE, Loading Loading @@ -1777,6 +1780,27 @@ public class LauncherAppsService extends SystemService { } } @Override public @Nullable IntentSender getPrivateSpaceSettingsIntent() { if (!canAccessHiddenProfile(getCallingUid(), getCallingPid())) { Slog.e(TAG, "Caller cannot access hidden profiles"); return null; } final long identity = Binder.clearCallingIdentity(); try { Intent psSettingsIntent = new Intent(PS_SETTINGS_INTENT); psSettingsIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); final PendingIntent pi = PendingIntent.getActivity(mContext, /* requestCode */ 0, psSettingsIntent, PendingIntent.FLAG_IMMUTABLE | FLAG_UPDATE_CURRENT); return pi == null ? null : pi.getIntentSender(); } finally { Binder.restoreCallingIdentity(identity); } } @Nullable private IntentSender buildAppMarketIntentSenderForUser(@NonNull UserHandle user) { Intent appMarketIntent = new Intent(Intent.ACTION_MAIN); Loading