summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-05-01 13:02:20 -0700
committerSunny Goyal <sunnygoyal@google.com>2015-05-01 13:02:20 -0700
commit957c13f032fc4088b3273cec08603c67c069e2c6 (patch)
treea85aa44c8c58907a84fb39789ca464cdfc1a01b0 /src/com/android/launcher3
parent65832b6267053220e3c4b798db882a2f0641ad4d (diff)
downloadandroid_packages_apps_Trebuchet-957c13f032fc4088b3273cec08603c67c069e2c6.tar.gz
android_packages_apps_Trebuchet-957c13f032fc4088b3273cec08603c67c069e2c6.tar.bz2
android_packages_apps_Trebuchet-957c13f032fc4088b3273cec08603c67c069e2c6.zip
Handling managed profile creation in the model as the activity
can get killed in the background. Change-Id: I95f62cf268fe642c9a2bb4975eb92bf8e12d23a9
Diffstat (limited to 'src/com/android/launcher3')
-rw-r--r--src/com/android/launcher3/Launcher.java5
-rw-r--r--src/com/android/launcher3/LauncherAppState.java4
-rw-r--r--src/com/android/launcher3/LauncherModel.java3
3 files changed, 7 insertions, 5 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 2ef5d0ac4..7688a3dc7 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -1675,9 +1675,6 @@ public class Launcher extends Activity
mModel.startLoader(false, PagedView.INVALID_RESTORE_PAGE,
LauncherModel.LOADER_FLAG_CLEAR_WORKSPACE
| LauncherModel.LOADER_FLAG_MIGRATE_SHORTCUTS);
- } else if (LauncherAppsCompat.ACTION_MANAGED_PROFILE_ADDED.equals(action)
- || LauncherAppsCompat.ACTION_MANAGED_PROFILE_REMOVED.equals(action)) {
- getModel().forceReload();
}
}
};
@@ -1691,8 +1688,6 @@ public class Launcher extends Activity
filter.addAction(Intent.ACTION_SCREEN_OFF);
filter.addAction(Intent.ACTION_USER_PRESENT);
// For handling managed profiles
- filter.addAction(LauncherAppsCompat.ACTION_MANAGED_PROFILE_ADDED);
- filter.addAction(LauncherAppsCompat.ACTION_MANAGED_PROFILE_REMOVED);
if (ENABLE_DEBUG_INTENTS) {
filter.addAction(DebugIntents.DELETE_DATABASE);
filter.addAction(DebugIntents.MIGRATE_DATABASE);
diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java
index 7f31e4999..d51df32b0 100644
--- a/src/com/android/launcher3/LauncherAppState.java
+++ b/src/com/android/launcher3/LauncherAppState.java
@@ -112,6 +112,10 @@ public class LauncherAppState implements DeviceProfile.DeviceProfileCallbacks {
filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED);
filter.addAction(SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED);
filter.addAction(SearchManager.INTENT_ACTION_SEARCHABLES_CHANGED);
+ // For handling managed profiles
+ filter.addAction(LauncherAppsCompat.ACTION_MANAGED_PROFILE_ADDED);
+ filter.addAction(LauncherAppsCompat.ACTION_MANAGED_PROFILE_REMOVED);
+
sContext.registerReceiver(mModel, filter);
}
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index 957073552..e62c689fb 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -1279,6 +1279,9 @@ public class LauncherModel extends BroadcastReceiver
if (callbacks != null) {
callbacks.bindSearchablesChanged();
}
+ } else if (LauncherAppsCompat.ACTION_MANAGED_PROFILE_ADDED.equals(action)
+ || LauncherAppsCompat.ACTION_MANAGED_PROFILE_REMOVED.equals(action)) {
+ forceReload();
}
}