summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Savage-Jones <edward.savage-jones@sony.com>2022-11-13 17:21:45 +0100
committeralk3pInjection <webmaster@raspii.tech>2023-04-20 00:08:54 +0800
commitadb51c01410cb5a26082e4759adb1ff14dac8d15 (patch)
tree9314809f063477af7978d7982edb445fae653ab1
parent99e560deac90333569b62aa14cc9abd26b716eb2 (diff)
toast: Fix inconsistent app icon display for system apps
When an app is preloaded and it displays a toast, no app icon is visible in the toast. If the app is then upgraded, and it displays a toast the app icon is the visible in the toast. This updates the logic to also include system apps when checking if the app has a launch intent to decide whether to show an icon. Test: Display a Toast in a system app, upgrade the system app and trigger the toast again. The app icon should be displayed in both cases. Bug: 260568818 Change-Id: I9535b4599ba16cb3e4b224b9569259db1ec9ed36
-rw-r--r--packages/SystemUI/src/com/android/systemui/toast/SystemUIToast.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/toast/SystemUIToast.java b/packages/SystemUI/src/com/android/systemui/toast/SystemUIToast.java
index 05e566690f57..29f16c7b924a 100644
--- a/packages/SystemUI/src/com/android/systemui/toast/SystemUIToast.java
+++ b/packages/SystemUI/src/com/android/systemui/toast/SystemUIToast.java
@@ -272,10 +272,10 @@ public class SystemUIToast implements ToastPlugin.Toast {
private static boolean showApplicationIcon(ApplicationInfo appInfo,
PackageManager packageManager) {
- if (hasFlag(appInfo.flags, FLAG_UPDATED_SYSTEM_APP)) {
+ if (hasFlag(appInfo.flags, FLAG_UPDATED_SYSTEM_APP | FLAG_SYSTEM)) {
return packageManager.getLaunchIntentForPackage(appInfo.packageName) != null;
}
- return !hasFlag(appInfo.flags, FLAG_SYSTEM);
+ return true;
}
private static boolean hasFlag(int flags, int flag) {