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

Commit 98e48454 authored by Jon Miranda's avatar Jon Miranda
Browse files

Merging from ub-launcher3-master @ build 6219992

Test: manual, presubmit on the source branch
http://x20/teams/android-launcher/merge/ub-launcher3-master_6219992.html

Change-Id: Iff1e0d32b4ded4cb51c91c187d85f128b92157ca
parents 94c1178e b8d1e352
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ android_library {
}

java_library_static {
    name: "launcher-log-protos-lite",
    name: "launcher_log_protos_lite",
    srcs: [
        "protos/*.proto",
        "proto_overrides/*.proto",
@@ -45,4 +45,5 @@ java_library_static {
            "proto_overrides",
        ],
    },
    static_libs: ["libprotobuf-java-lite"],
}
+11 −3
Original line number Diff line number Diff line
@@ -48,7 +48,9 @@ LOCAL_STATIC_ANDROID_LIBRARIES := \
    androidx.preference_preference \
    iconloader_base

LOCAL_STATIC_JAVA_LIBRARIES := LauncherPluginLib
LOCAL_STATIC_JAVA_LIBRARIES := \
    LauncherPluginLib \
    launcher_log_protos_lite

LOCAL_SRC_FILES := \
    $(call all-proto-files-under, protos) \
@@ -144,7 +146,10 @@ LOCAL_USE_AAPT2 := true
LOCAL_AAPT2_ONLY := true
LOCAL_MODULE_TAGS := optional

LOCAL_STATIC_JAVA_LIBRARIES := SystemUISharedLibLauncherWrapper launcherprotosnano
LOCAL_STATIC_JAVA_LIBRARIES := \
    SystemUISharedLib \
    launcherprotosnano \
    launcher_log_protos_lite
ifneq (,$(wildcard frameworks/base))
  LOCAL_PRIVATE_PLATFORM_APIS := true
else
@@ -213,7 +218,10 @@ include $(CLEAR_VARS)
LOCAL_USE_AAPT2 := true
LOCAL_MODULE_TAGS := optional

LOCAL_STATIC_JAVA_LIBRARIES := SystemUISharedLibLauncherWrapper launcherprotosnano
LOCAL_STATIC_JAVA_LIBRARIES := \
    SystemUISharedLib \
    launcherprotosnano \
    launcher_log_protos_lite
ifneq (,$(wildcard frameworks/base))
  LOCAL_PRIVATE_PLATFORM_APIS := true
else
+2 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ import android.os.UserHandle;
import androidx.annotation.Nullable;

import com.android.launcher3.LauncherAppState;
import com.android.launcher3.icons.ComponentWithLabel;
import com.android.launcher3.icons.ComponentWithLabelAndIcon;
import com.android.launcher3.util.PackageUserKey;
import com.android.launcher3.widget.WidgetListRowEntry;

@@ -59,7 +59,7 @@ public class WidgetsModel {
     * @param packageUser If null, all widgets and shortcuts are updated and returned, otherwise
     *                    only widgets and shortcuts associated with the package/user are.
     */
    public List<ComponentWithLabel> update(LauncherAppState app,
    public List<ComponentWithLabelAndIcon> update(LauncherAppState app,
            @Nullable PackageUserKey packageUser) {
        return Collections.emptyList();
    }
+11 −0
Original line number Diff line number Diff line
@@ -350,6 +350,17 @@ public class BaseIconFactory implements AutoCloseable {
                iconDpi);
    }

    /**
     * Badges the provided source with the badge info
     */
    public BitmapInfo badgeBitmap(Bitmap source, BitmapInfo badgeInfo) {
        Bitmap icon = BitmapRenderer.createHardwareBitmap(mIconBitmapSize, mIconBitmapSize, (c) -> {
            getShadowGenerator().recreateIcon(source, c);
            badgeWithDrawable(c, new FixedSizeBitmapDrawable(badgeInfo.icon));
        });
        return BitmapInfo.of(icon, badgeInfo.color);
    }

    private int extractColor(Bitmap bitmap) {
        return mDisableColorExtractor ? 0 : mColorExtractor.findDominantColorByHue(bitmap);
    }
+8 −5
Original line number Diff line number Diff line
@@ -281,7 +281,8 @@ public abstract class BaseIconCache {

        ContentValues values = newContentValues(entry.bitmap, entry.title.toString(),
                componentName.getPackageName(), cachingLogic.getKeywords(object, mLocaleList));
        addIconToDB(values, componentName, info, userSerial);
        addIconToDB(values, componentName, info, userSerial,
                cachingLogic.getLastUpdatedTime(object, info));
    }

    /**
@@ -289,10 +290,10 @@ public abstract class BaseIconCache {
     * @param values {@link ContentValues} containing icon & title
     */
    private void addIconToDB(ContentValues values, ComponentName key,
            PackageInfo info, long userSerial) {
            PackageInfo info, long userSerial, long lastUpdateTime) {
        values.put(IconDB.COLUMN_COMPONENT, key.flattenToString());
        values.put(IconDB.COLUMN_USER, userSerial);
        values.put(IconDB.COLUMN_LAST_UPDATED, info.lastUpdateTime);
        values.put(IconDB.COLUMN_LAST_UPDATED, lastUpdateTime);
        values.put(IconDB.COLUMN_VERSION, info.versionCode);
        mIconDb.insertOrReplace(values);
    }
@@ -362,7 +363,8 @@ public abstract class BaseIconCache {
                }
                if (object != null) {
                    entry.title = cachingLogic.getLabel(object);
                    entry.contentDescription = mPackageManager.getUserBadgedLabel(entry.title, user);
                    entry.contentDescription = mPackageManager.getUserBadgedLabel(
                            cachingLogic.getDescription(object, entry.title), user);
                }
            }
        }
@@ -449,7 +451,8 @@ public abstract class BaseIconCache {
                    // package updates.
                    ContentValues values = newContentValues(
                            iconInfo, entry.title.toString(), packageName, null);
                    addIconToDB(values, cacheKey.componentName, info, getSerialNumberForUser(user));
                    addIconToDB(values, cacheKey.componentName, info, getSerialNumberForUser(user),
                            info.lastUpdateTime);

                } catch (NameNotFoundException e) {
                    if (DEBUG) Log.d(TAG, "Application not installed " + packageName);
Loading