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

Commit c6e97692 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Moving LoaderTask static

Will move it to a separate file in a followup cl.
This simplifies dependencies between LauncherModel and LoaderTask which
and making it easier to start the loader before Launcher activity is
created (as the Callbacks in LauncherModel can change while loader is running).

Bug: 34112546
Bug: 37616877
Change-Id: Ie9619c6b0de0e3eb60657c04ae1b58d946c829e9
parent ccb25a3d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
package com.android.launcher3;

import android.content.ComponentName;
import android.content.Context;

public class AppFilter {

    public static AppFilter newInstance(Context context) {
        return Utilities.getOverrideObject(AppFilter.class, context, R.string.app_filter_class);
    }

    public boolean shouldShowApp(ComponentName app) {
        return true;
    }
+1 −1
Original line number Diff line number Diff line
@@ -3970,7 +3970,7 @@ public class Launcher extends BaseActivity
     *                    refreshes the widgets and shortcuts associated with the given package/user
     */
    public void refreshAndBindWidgetsForPackageUser(@Nullable PackageUserKey packageUser) {
        mModel.refreshAndBindWidgetsAndShortcuts(this, mWidgetsView.isEmpty(), packageUser);
        mModel.refreshAndBindWidgetsAndShortcuts(packageUser);
    }

    public void lockScreenOrientation() {
+1 −3
Original line number Diff line number Diff line
@@ -93,9 +93,7 @@ public class LauncherAppState {
        mInvariantDeviceProfile = new InvariantDeviceProfile(mContext);
        mIconCache = new IconCache(mContext, mInvariantDeviceProfile);
        mWidgetCache = new WidgetPreviewLoader(mContext, mIconCache);

        mModel = new LauncherModel(this, mIconCache,
                Utilities.getOverrideObject(AppFilter.class, mContext, R.string.app_filter_class));
        mModel = new LauncherModel(this, mIconCache, AppFilter.newInstance(mContext));

        LauncherAppsCompat.getInstance(mContext).addOnAppsChangedCallback(mModel);

+140 −148

File changed.

Preview size limit exceeded, changes collapsed.

+10 −0
Original line number Diff line number Diff line
@@ -90,11 +90,21 @@ public class BgDataModel {
     */
    public final Map<ShortcutKey, MutableInt> pinnedShortcutCounts = new HashMap<>();

    /**
     * True if the launcher has permission to access deep shortcuts.
     */
    public boolean hasShortcutHostPermission;

    /**
     * Maps all launcher activities to the id's of their shortcuts (if they have any).
     */
    public final MultiHashMap<ComponentKey, String> deepShortcutMap = new MultiHashMap<>();

    /**
     * Entire list of widgets.
     */
    public final WidgetsModel widgetsModel = new WidgetsModel();

    /**
     * Clears all the data
     */
Loading