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

Commit 0be752ca authored by Sunny Goyal's avatar Sunny Goyal Committed by Android (Google) Code Review
Browse files

Merge "Handling managed profile creation in the model as the activity can get...

Merge "Handling managed profile creation in the model as the activity can get killed in the background." into ub-launcher3-burnaby
parents fe46c29c 957c13f0
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -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);
+4 −0
Original line number Diff line number Diff line
@@ -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);
    }

+3 −0
Original line number Diff line number Diff line
@@ -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();
        }
    }