Add shortcut to install an app to Private space

Introduce long-press shortcut to install a copy
of the main user app to private space.

Test: manual, installed apps in different stores
and tried shortcut
https://screenshot.googleplex.com/6oAVamTytiYmvPC.png
Bug: 316118005
Flag: ACONFIG com.android.launcher3.Flags.enable_private_space_install_shortcut DEVELOPMENT

Change-Id: I702cd2a27388e3cc6e9e126308d5479836ba6655
This commit is contained in:
Anna Zhuravleva committed 2024-01-11 12:40:28 +00:00
1 parent 0f8d28024e
commit 29a3139815
9 files changed
+134 -2

No files matched your search

@@ -94,6 +94,19 @@ public abstract class UserProfileManager {
return mCurrentState;
}
/** Returns if user profile is enabled. */
public boolean isEnabled() {
return mCurrentState == STATE_ENABLED;
}
/** Returns the UserHandle corresponding to the profile type, null in case no matches found. */
public UserHandle getProfileUser() {
return mUserCache.getUserProfiles().stream()
.filter(getUserMatcher())
.findAny()
.orElse(null);
}
/** Logs Event to StatsLogManager. */
protected void logEvents(StatsLogManager.EventEnum event) {
mStatsLogManager.logger().log(event);