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

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

Merge "No need to differentiate package event into app or updated based on a...

Merge "No need to differentiate package event into app or updated based on a package is being updated or not" into ub-launcher3-calgary
parents 6ed21eeb 144154d4
Loading
Loading
Loading
Loading
+2 −16
Original line number Diff line number Diff line
@@ -103,7 +103,6 @@ public class LauncherModel extends BroadcastReceiver
    private static final int ITEMS_CHUNK = 6; // batch size for the workspace icons
    private static final long INVALID_SCREEN_ID = -1L;

    @Thunk final boolean mAppsCanBeOnRemoveableStorage;
    private final boolean mOldContentProviderExists;

    @Thunk final LauncherAppState mApp;
@@ -217,7 +216,6 @@ public class LauncherModel extends BroadcastReceiver
    LauncherModel(LauncherAppState app, IconCache iconCache, AppFilter appFilter) {
        Context context = app.getContext();

        mAppsCanBeOnRemoveableStorage = Environment.isExternalStorageRemovable();
        String oldProvider = context.getString(R.string.old_launcher_provider_uri);
        // This may be the same as MIGRATE_AUTHORITY, or it may be replaced by a different
        // resource string.
@@ -1170,20 +1168,8 @@ public class LauncherModel extends BroadcastReceiver
    @Override
    public void onPackagesAvailable(String[] packageNames, UserHandleCompat user,
            boolean replacing) {
        if (!replacing) {
            enqueuePackageUpdated(new PackageUpdatedTask(PackageUpdatedTask.OP_ADD, packageNames,
                    user));
            if (mAppsCanBeOnRemoveableStorage) {
                // Only rebind if we support removable storage. It catches the
                // case where
                // apps on the external sd card need to be reloaded
                startLoaderFromBackground();
            }
        } else {
            // If we are replacing then just update the packages in the list
            enqueuePackageUpdated(new PackageUpdatedTask(PackageUpdatedTask.OP_UPDATE,
                    packageNames, user));
        }
        enqueuePackageUpdated(
                new PackageUpdatedTask(PackageUpdatedTask.OP_UPDATE, packageNames, user));
    }

    @Override