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

Commit ba69ad6e authored by Edward Savage-Jones's avatar Edward Savage-Jones Committed by Ed Savage-Jones
Browse files

Toast app icon display is inconsistent 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
parent e33bf4ea
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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) {