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

Commit a376b027 authored by fbaron's avatar fbaron
Browse files

Show package name if the title is empty

See comment #33 on b/245517507

Fix: 245517507
Test: verify that if title is empty, packagename is shown instead
Flag: no flag
Change-Id: I86e5fa6710f00448ce69df74f26d5ca7bafd0f48
parent 7b1c0ff1
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -329,9 +329,11 @@ public abstract class BaseIconCache {
        if (entry.bitmap.isNullOrLowRes()) return;

        CharSequence entryTitle = cachingLogic.getLabel(object);
        if (TextUtils.isEmpty(entryTitle)) {
            if (entryTitle == null) {
                Log.wtf(TAG, "No label returned from caching logic instance: " + cachingLogic);
            entryTitle = "";
            }
            entryTitle = componentName.getPackageName();;
        }
        entry.title = entryTitle;

@@ -490,6 +492,9 @@ public abstract class BaseIconCache {
            @NonNull final T object, @NonNull final CacheEntry entry,
            @NonNull final CachingLogic<T> cachingLogic, @NonNull final UserHandle user) {
        entry.title = cachingLogic.getLabel(object);
        if (TextUtils.isEmpty(entry.title)) {
            entry.title = cachingLogic.getComponent(object).getPackageName();
        }
        entry.contentDescription = getUserBadgedLabel(
                cachingLogic.getDescription(object, entry.title), user);
    }