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

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

Merge "Cancelling launcher reload on mcc change" into ub-launcher3-burnaby

parents c44de1ad 2003c75a
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -219,7 +219,7 @@ public class IconCache {
        // Remove all active icon update tasks.
        mWorkerHandler.removeCallbacksAndMessages(ICON_UPDATE_TOKEN);

        mIconDb.updateSystemStateString(mContext);
        mIconDb.updateSystemStateString();
        for (UserHandleCompat user : mUserManager.getUserProfiles()) {
            // Query for the set of apps
            final List<LauncherActivityInfoCompat> apps = mLauncherApps.getActivityList(null, user);
@@ -756,15 +756,13 @@ public class IconCache {

        public IconDB(Context context) {
            super(context, LauncherFiles.APP_ICONS_DB, null, DB_VERSION);
            updateSystemStateString(context);
            updateSystemStateString();
        }

        public void updateSystemStateString(Context c) {
            mSystemState = Locale.getDefault().toString() + ","
                    + c.getResources().getConfiguration().mcc;
        public void updateSystemStateString() {
            mSystemState = Locale.getDefault().toString();
        }


        @Override
        public void onCreate(SQLiteDatabase db) {
            db.execSQL("CREATE TABLE IF NOT EXISTS " + TABLE_NAME + " (" +
+0 −1
Original line number Diff line number Diff line
@@ -95,7 +95,6 @@ public class LauncherAppState {
        // Register intent receivers
        IntentFilter filter = new IntentFilter();
        filter.addAction(Intent.ACTION_LOCALE_CHANGED);
        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
+0 −19
Original line number Diff line number Diff line
@@ -30,8 +30,6 @@ import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.content.pm.ProviderInfo;
import android.content.pm.ResolveInfo;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.net.Uri;
@@ -177,8 +175,6 @@ public class LauncherModel extends BroadcastReceiver

    @Thunk IconCache mIconCache;

    protected int mPreviousConfigMcc;

    @Thunk final LauncherAppsCompat mLauncherApps;
    @Thunk final UserManagerCompat mUserManager;

@@ -243,9 +239,6 @@ public class LauncherModel extends BroadcastReceiver
        mBgWidgetsModel = new WidgetsModel(context, iconCache, appFilter);
        mIconCache = iconCache;

        final Resources res = context.getResources();
        Configuration config = res.getConfiguration();
        mPreviousConfigMcc = config.mcc;
        mLauncherApps = LauncherAppsCompat.getInstance(context);
        mUserManager = UserManagerCompat.getInstance(context);
    }
@@ -1286,18 +1279,6 @@ public class LauncherModel extends BroadcastReceiver
        if (Intent.ACTION_LOCALE_CHANGED.equals(action)) {
            // If we have changed locale we need to clear out the labels in all apps/workspace.
            forceReload();
        } else if (Intent.ACTION_CONFIGURATION_CHANGED.equals(action)) {
             // Check if configuration change was an mcc/mnc change which would affect app resources
             // and we would need to clear out the labels in all apps/workspace. Same handling as
             // above for ACTION_LOCALE_CHANGED
             Configuration currentConfig = context.getResources().getConfiguration();
             if (mPreviousConfigMcc != currentConfig.mcc) {
                   Log.d(TAG, "Reload apps on config change. curr_mcc:"
                       + currentConfig.mcc + " prevmcc:" + mPreviousConfigMcc);
                   forceReload();
             }
             // Update previousConfig
             mPreviousConfigMcc = currentConfig.mcc;
        } else if (SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED.equals(action) ||
                   SearchManager.INTENT_ACTION_SEARCHABLES_CHANGED.equals(action)) {
            Callbacks callbacks = getCallback();