diff options
author | Marcos Marado <mmarado@cyngn.com> | 2016-10-04 12:03:59 +0100 |
---|---|---|
committer | Adrian DC <radian.dc@gmail.com> | 2016-12-03 22:10:25 +0100 |
commit | 72ce09e6a92b74acaf257ac3d133fa08cea7e6d4 (patch) | |
tree | f10ad67f3850ed9d76acae107c471fb0936460c5 /src/com/android/launcher3/IconCache.java | |
parent | 9d4bdad6b7d23ffefee6d1c57af13f95b993a8b1 (diff) | |
download | android_packages_apps_Trebuchet-72ce09e6a92b74acaf257ac3d133fa08cea7e6d4.tar.gz android_packages_apps_Trebuchet-72ce09e6a92b74acaf257ac3d133fa08cea7e6d4.tar.bz2 android_packages_apps_Trebuchet-72ce09e6a92b74acaf257ac3d133fa08cea7e6d4.zip |
IconCache: Simplify application of custom titles from STKstable/cm-13.0-ZNH5Y
Instead of trying to deal with multiple icon-cache conditions,
just apply the custom title to the entry right before using it.
This deals with hot-swap, card exchange, and similar weird issues
that were hitting stale cache entries, and is less aggressive
than outright flushing the cache with every STK refresh.
RM-290
Issue: FEIJAO-815
Change-Id: Iacd7da820f0404b4dc12394d9c9a571bdceadeb0
Diffstat (limited to 'src/com/android/launcher3/IconCache.java')
-rw-r--r-- | src/com/android/launcher3/IconCache.java | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java index 59239be90..b30ff2d6e 100644 --- a/src/com/android/launcher3/IconCache.java +++ b/src/com/android/launcher3/IconCache.java @@ -597,12 +597,7 @@ public class IconCache { if (DEBUG) Log.d(TAG, "using package default icon for " + componentName.toShortString()); entry.icon = packageEntry.icon; - if (isCustomTitle) { - entry.title = ((LauncherApplication) mContext) - .getStkAppName(); - } else { - entry.title = packageEntry.title; - } + entry.title = packageEntry.title; entry.contentDescription = packageEntry.contentDescription; } } @@ -615,15 +610,16 @@ public class IconCache { } if (TextUtils.isEmpty(entry.title) && info != null) { - if (isCustomTitle) { - entry.title = ((LauncherApplication) mContext) - .getStkAppName(); - } else { - entry.title = info.getLabel(); - } + entry.title = info.getLabel(); entry.contentDescription = mUserManager.getBadgedLabelForUser(entry.title, user); } } + + if (isCustomTitle) { + entry.title = ((LauncherApplication) mContext) + .getStkAppName(); + } + return entry; } |