Adding Prework for Private Space integration in Launcher

This Cl adds the following:
1. Fixes for Quite Mode check maintained by Launcher
2. Addition of new Quite Mode broadcasts
3. Fixes for determining work profile user correctly.

Flag: ACONFIG com.android.launcher3.Flags.enable_private_space DEVELOPMENT
Bug: 289223923
Test: Ran Launcher3 tests
Change-Id: I5f6158b213723339e70ff99e66c5f439f5879e12
This commit is contained in:
Himanshu Gupta
2023-10-12 16:53:00 +01:00
parent 402ca3e3e5
commit 9aab4d4603
13 changed files with 223 additions and 29 deletions

View File

@@ -55,10 +55,18 @@ public class UserCache implements SafeCloseable {
? Intent.ACTION_PROFILE_ACCESSIBLE : Intent.ACTION_MANAGED_PROFILE_UNLOCKED;
public static final String ACTION_PROFILE_LOCKED = ATLEAST_U
? Intent.ACTION_PROFILE_INACCESSIBLE : Intent.ACTION_MANAGED_PROFILE_UNAVAILABLE;
public static final String ACTION_PROFILE_AVAILABLE = "android.intent.action.PROFILE_AVAILABLE";
public static final String ACTION_PROFILE_UNAVAILABLE =
"android.intent.action.PROFILE_UNAVAILABLE";
public static final MainThreadInitializedObject<UserCache> INSTANCE =
new MainThreadInitializedObject<>(UserCache::new);
/** Returns an instance of UserCache bound to the context provided. */
public static UserCache getInstance(Context context) {
return INSTANCE.get(context);
}
private final List<BiConsumer<UserHandle, String>> mUserEventListeners = new ArrayList<>();
private final SimpleBroadcastReceiver mUserChangeReceiver =
new SimpleBroadcastReceiver(this::onUsersChanged);
@@ -87,7 +95,9 @@ public class UserCache implements SafeCloseable {
ACTION_PROFILE_ADDED,
ACTION_PROFILE_REMOVED,
ACTION_PROFILE_UNLOCKED,
ACTION_PROFILE_LOCKED);
ACTION_PROFILE_LOCKED,
ACTION_PROFILE_AVAILABLE,
ACTION_PROFILE_UNAVAILABLE);
updateCache();
}