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

Commit 91fe8455 authored by Daniel Sandler's avatar Daniel Sandler
Browse files

Clean up language in forced foreground service notifications.

Old:  [ IC ] %s running
      [ ON ] %s is running

New:  [ IC ] %s is running
      [ ON ] Touch for more information or to stop the app.

Additionally, disallow these misbehaving services from
supplying their own content views; if you attempt to run a
foreground service with icon == 0, this is the notification
you will get, period.

Bug: 8525548
Change-Id: I2bfd7340396ef925885e8c2160a720f9eff07a35
parent a56b78dc
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -2997,11 +2997,11 @@
    <!-- [CHAR LIMIT=NONE] Stub notification title for an app running a service that has provided
         a bad bad notification for itself. -->
    <string name="app_running_notification_title"><xliff:g id="app_name">%1$s</xliff:g>
        running</string>
        is running</string>
    <!-- [CHAR LIMIT=NONE] Stub notification text for an app running a service that has provided
         a bad bad notification for itself. -->
    <string name="app_running_notification_text"><xliff:g id="app_name">%1$s</xliff:g>
        is currently running</string>
    <string name="app_running_notification_text">Touch for more information
        or to stop the app.</string>

    <!-- Preference framework strings. -->
    <string name="ok">OK</string>
+31 −31
Original line number Diff line number Diff line
@@ -376,9 +376,10 @@ class ServiceRecord extends Binder {
                            // icon, but this used to be able to slip through, so for
                            // those dirty apps give it the app's icon.
                            foregroundNoti.icon = appInfo.icon;
                            if (foregroundNoti.contentView == null) {
                                // In this case the app may not have specified a
                                // content view...  so we'll give them something to show.

                            // Do not allow apps to present a sneaky invisible content view either.
                            foregroundNoti.contentView = null;
                            foregroundNoti.bigContentView = null;
                            CharSequence appName = appInfo.loadLabel(
                                    ams.mContext.getPackageManager());
                            if (appName == null) {
@@ -408,7 +409,6 @@ class ServiceRecord extends Binder {
                                foregroundNoti.icon = 0;
                            }
                        }
                        }
                        if (foregroundNoti.icon == 0) {
                            // Notifications whose icon is 0 are defined to not show
                            // a notification, silently ignoring it.  We don't want to