Merge "Handling managed profile creation in the model as the activity can get killed in the background." into ub-launcher3-burnaby
This commit is contained in:
@@ -1675,9 +1675,6 @@ public class Launcher extends Activity
|
|||||||
mModel.startLoader(false, PagedView.INVALID_RESTORE_PAGE,
|
mModel.startLoader(false, PagedView.INVALID_RESTORE_PAGE,
|
||||||
LauncherModel.LOADER_FLAG_CLEAR_WORKSPACE
|
LauncherModel.LOADER_FLAG_CLEAR_WORKSPACE
|
||||||
| LauncherModel.LOADER_FLAG_MIGRATE_SHORTCUTS);
|
| 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_SCREEN_OFF);
|
||||||
filter.addAction(Intent.ACTION_USER_PRESENT);
|
filter.addAction(Intent.ACTION_USER_PRESENT);
|
||||||
// For handling managed profiles
|
// For handling managed profiles
|
||||||
filter.addAction(LauncherAppsCompat.ACTION_MANAGED_PROFILE_ADDED);
|
|
||||||
filter.addAction(LauncherAppsCompat.ACTION_MANAGED_PROFILE_REMOVED);
|
|
||||||
if (ENABLE_DEBUG_INTENTS) {
|
if (ENABLE_DEBUG_INTENTS) {
|
||||||
filter.addAction(DebugIntents.DELETE_DATABASE);
|
filter.addAction(DebugIntents.DELETE_DATABASE);
|
||||||
filter.addAction(DebugIntents.MIGRATE_DATABASE);
|
filter.addAction(DebugIntents.MIGRATE_DATABASE);
|
||||||
|
|||||||
@@ -112,6 +112,10 @@ public class LauncherAppState implements DeviceProfile.DeviceProfileCallbacks {
|
|||||||
filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED);
|
filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED);
|
||||||
filter.addAction(SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED);
|
filter.addAction(SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED);
|
||||||
filter.addAction(SearchManager.INTENT_ACTION_SEARCHABLES_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);
|
sContext.registerReceiver(mModel, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1279,6 +1279,9 @@ public class LauncherModel extends BroadcastReceiver
|
|||||||
if (callbacks != null) {
|
if (callbacks != null) {
|
||||||
callbacks.bindSearchablesChanged();
|
callbacks.bindSearchablesChanged();
|
||||||
}
|
}
|
||||||
|
} else if (LauncherAppsCompat.ACTION_MANAGED_PROFILE_ADDED.equals(action)
|
||||||
|
|| LauncherAppsCompat.ACTION_MANAGED_PROFILE_REMOVED.equals(action)) {
|
||||||
|
forceReload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user