diff options
author | Rubin Xu <rubinxu@google.com> | 2016-04-04 16:13:35 +0100 |
---|---|---|
committer | Rubin Xu <rubinxu@google.com> | 2016-04-04 16:13:35 +0100 |
commit | ac6e5d7956124ed807ace9aa92aae0b13d61bafd (patch) | |
tree | 02bce9374843862de96fe05bb2e3c65af41000d1 /src/com | |
parent | 19c5c5765d38656b298465f33256fd5c5b0978b5 (diff) | |
download | android_packages_apps_Trebuchet-ac6e5d7956124ed807ace9aa92aae0b13d61bafd.tar.gz android_packages_apps_Trebuchet-ac6e5d7956124ed807ace9aa92aae0b13d61bafd.tar.bz2 android_packages_apps_Trebuchet-ac6e5d7956124ed807ace9aa92aae0b13d61bafd.zip |
Listen on new broadcasts for profile changes.
The change is due to API review comments on the platform side.
Bug: 27532254
Change-Id: I44133fbb5c3ee13d0523a72b25d2e1c5d1eba6a0
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/launcher3/LauncherAppState.java | 3 | ||||
-rw-r--r-- | src/com/android/launcher3/LauncherModel.java | 3 | ||||
-rw-r--r-- | src/com/android/launcher3/compat/LauncherAppsCompat.java | 6 |
3 files changed, 8 insertions, 4 deletions
diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java index 302a0c36a..f84e4b5b4 100644 --- a/src/com/android/launcher3/LauncherAppState.java +++ b/src/com/android/launcher3/LauncherAppState.java @@ -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. diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java index 030c6e2d0..c4c1946fc 100644 --- a/src/com/android/launcher3/LauncherModel.java +++ b/src/com/android/launcher3/LauncherModel.java @@ -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( diff --git a/src/com/android/launcher3/compat/LauncherAppsCompat.java b/src/com/android/launcher3/compat/LauncherAppsCompat.java index db5b89e81..bc900bcb5 100644 --- a/src/com/android/launcher3/compat/LauncherAppsCompat.java +++ b/src/com/android/launcher3/compat/LauncherAppsCompat.java @@ -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); |