Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac6e5d79 authored by Rubin Xu's avatar Rubin Xu
Browse files

Listen on new broadcasts for profile changes.

The change is due to API review comments on the platform side.

Bug: 27532254
Change-Id: I44133fbb5c3ee13d0523a72b25d2e1c5d1eba6a0
parent 19c5c576
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -108,7 +108,8 @@ public class LauncherAppState {
        // For handling managed profiles
        filter.addAction(LauncherAppsCompat.ACTION_MANAGED_PROFILE_ADDED);
        filter.addAction(LauncherAppsCompat.ACTION_MANAGED_PROFILE_REMOVED);
        filter.addAction(LauncherAppsCompat.ACTION_MANAGED_PROFILE_AVAILABILITY_CHANGED);
        filter.addAction(LauncherAppsCompat.ACTION_MANAGED_PROFILE_AVAILABLE);
        filter.addAction(LauncherAppsCompat.ACTION_MANAGED_PROFILE_UNAVAILABLE);
        // For extracting colors from the wallpaper
        if (Utilities.isNycOrAbove()) {
            // TODO: add a broadcast entry to the manifest for pre-N.
+2 −1
Original line number Diff line number Diff line
@@ -1217,7 +1217,8 @@ public class LauncherModel extends BroadcastReceiver
                || LauncherAppsCompat.ACTION_MANAGED_PROFILE_REMOVED.equals(action)) {
            UserManagerCompat.getInstance(context).enableAndResetCache();
            forceReload();
        } else if (LauncherAppsCompat.ACTION_MANAGED_PROFILE_AVAILABILITY_CHANGED.equals(action)) {
        } else if (LauncherAppsCompat.ACTION_MANAGED_PROFILE_AVAILABLE.equals(action) ||
                LauncherAppsCompat.ACTION_MANAGED_PROFILE_UNAVAILABLE.equals(action)) {
            UserHandleCompat user = UserHandleCompat.fromIntent(intent);
            if (user != null) {
                enqueuePackageUpdated(new PackageUpdatedTask(
+4 −2
Original line number Diff line number Diff line
@@ -35,8 +35,10 @@ public abstract class LauncherAppsCompat {
            "android.intent.action.MANAGED_PROFILE_ADDED";
    public static final String ACTION_MANAGED_PROFILE_REMOVED =
            "android.intent.action.MANAGED_PROFILE_REMOVED";
    public static final String ACTION_MANAGED_PROFILE_AVAILABILITY_CHANGED =
            "android.intent.action.MANAGED_PROFILE_AVAILABILITY_CHANGED";
    public static final String ACTION_MANAGED_PROFILE_AVAILABLE =
            "android.intent.action.MANAGED_PROFILE_AVAILABLE";
    public static final String ACTION_MANAGED_PROFILE_UNAVAILABLE =
            "android.intent.action.MANAGED_PROFILE_UNAVAILABLE";

    public interface OnAppsChangedCallbackCompat {
        void onPackageRemoved(String packageName, UserHandleCompat user);