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

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

Merge "Removing unused keywords column from DB" into main

parents 24e092c0 031325e3
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -382,8 +382,8 @@ public abstract class BaseIconCache {
        entry.contentDescription = getUserBadgedLabel(entry.title, user);
        if (cachingLogic.addToMemCache()) mCache.put(key, entry);

        ContentValues values = newContentValues(entry.bitmap, entry.title.toString(),
                componentName.getPackageName(), cachingLogic.getKeywords(object, mLocaleList));
        ContentValues values = newContentValues(
                entry.bitmap, entry.title.toString(), componentName.getPackageName());
        addIconToDB(values, componentName, info, userSerial,
                cachingLogic.getLastUpdatedTime(object, info));
    }
@@ -645,7 +645,7 @@ public abstract class BaseIconCache {
                    // Add the icon in the DB here, since these do not get written during
                    // package updates.
                    ContentValues values = newContentValues(
                            iconInfo, entry.title.toString(), packageName, null);
                            iconInfo, entry.title.toString(), packageName);
                    addIconToDB(values, cacheKey.componentName, info, getSerialNumberForUser(user),
                            info.lastUpdateTime);

@@ -767,7 +767,6 @@ public abstract class BaseIconCache {
        public static final String COLUMN_FLAGS = "flags";
        public static final String COLUMN_LABEL = "label";
        public static final String COLUMN_SYSTEM_STATE = "system_state";
        public static final String COLUMN_KEYWORDS = "keywords";

        public static final String[] COLUMNS_LOW_RES = new String[]{
                COLUMN_COMPONENT,
@@ -806,7 +805,6 @@ public abstract class BaseIconCache {
                    + COLUMN_FLAGS + " INTEGER NOT NULL DEFAULT 0, "
                    + COLUMN_LABEL + " TEXT, "
                    + COLUMN_SYSTEM_STATE + " TEXT, "
                    + COLUMN_KEYWORDS + " TEXT, "
                    + "PRIMARY KEY (" + COLUMN_COMPONENT + ", " + COLUMN_USER + ") "
                    + ");");
        }
@@ -814,8 +812,7 @@ public abstract class BaseIconCache {

    @NonNull
    private ContentValues newContentValues(@NonNull final BitmapInfo bitmapInfo,
            @NonNull final String label, @NonNull final String packageName,
            @Nullable final String keywords) {
            @NonNull final String label, @NonNull final String packageName) {
        ContentValues values = new ContentValues();
        if (bitmapInfo.canPersist()) {
            values.put(IconDB.COLUMN_ICON, flattenBitmap(bitmapInfo.icon));
@@ -840,7 +837,6 @@ public abstract class BaseIconCache {

        values.put(IconDB.COLUMN_LABEL, label);
        values.put(IconDB.COLUMN_SYSTEM_STATE, getIconSystemState(packageName));
        values.put(IconDB.COLUMN_KEYWORDS, keywords);
        return values;
    }

+0 −9
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.launcher3.icons.cache;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.os.LocaleList;
import android.os.UserHandle;

import androidx.annotation.NonNull;
@@ -49,14 +48,6 @@ public interface CachingLogic<T> {
    @NonNull
    BitmapInfo loadIcon(@NonNull Context context, @NonNull BaseIconCache cache, @NonNull T object);

    /**
     * Provides a option list of keywords to associate with this object
     */
    @Nullable
    default String getKeywords(@NonNull final T object, @NonNull final LocaleList localeList) {
        return null;
    }

    /**
     * Returns the timestamp the entry was last updated in cache.
     */