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

Commit 2f36ab88 authored by Dan Sandler's avatar Dan Sandler
Browse files

Updates to Dianne's Dungeon.

 - new EKG icon
 - set the notification timestamp to the oldest service
   start time, so you have some idea how long things have been
   this way
 - minor text fixes

Bug: 36891897
Test: runtest -x cts/tests/app/src/android/app/cts/ServiceTest.java
Change-Id: I99db280cde8ca3ecd7205cd44fac159d8f652ca2
parent 2f77da6e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -135,7 +135,7 @@ public class SystemNotificationChannels {
        channelsList.add(new NotificationChannel(
        channelsList.add(new NotificationChannel(
                FOREGROUND_SERVICE,
                FOREGROUND_SERVICE,
                context.getString(R.string.notification_channel_foreground_service),
                context.getString(R.string.notification_channel_foreground_service),
                NotificationManager.IMPORTANCE_MIN));
                NotificationManager.IMPORTANCE_LOW));


        nm.createNotificationChannels(channelsList);
        nm.createNotificationChannels(channelsList);
    }
    }
+29 −0
Original line number Original line Diff line number Diff line
<!--
Copyright (C) 2017 The Android Open Source Project

   Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<!-- "system vitals", as represented by an EKG trace -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="24.0"
        android:viewportHeight="24.0">
    <path
        android:fillColor="#FF000000"
        android:pathData="M19.5608645,12.0797103 L17.15,5.15 L15.25,5.15 L11.95,15.95 L9.75,11.5 L7.95,11.55 L7.2,13.3
        L6.65,14.6 L3.25,14.6 L3.25,16.6 L7.35,16.6 L8,16.6 L8.25,16 L8.9,14.3 L11.2,18.85 L13.15,18.85 L16.25,8.8
        L17.5310733,12.642689 C17.2014325,12.9992627 17,13.4761078 17,14 C17,15.1045695 17.8954305,16 19,16
        C20.1045695,16 21,15.1045695 21,14 C21,13.0901368 20.3924276,12.3221796 19.5608645,12.0797103 Z M21,3
        C22,3 23,4 23,5 L23,19 C23,20 22,21 21,21 L3,21 C1.9,21 1,20.1 1,19 L1,5 C1,4 2,3 3,3 L21,3 Z" />
</vector>
+1 −0
Original line number Original line Diff line number Diff line
@@ -3024,4 +3024,5 @@
  <java-symbol type="bool" name="config_handleVolumeKeysInWindowManager" />
  <java-symbol type="bool" name="config_handleVolumeKeysInWindowManager" />


  <java-symbol type="integer" name="config_inCallNotificationVolumeRelative" />
  <java-symbol type="integer" name="config_inCallNotificationVolumeRelative" />
  <java-symbol type="drawable" name="stat_sys_vitals" />
</resources>
</resources>
+7 −3
Original line number Original line Diff line number Diff line
@@ -162,7 +162,7 @@ public final class ActiveServices {


    /**
    /**
     * Information about an app that is currently running one or more foreground services.
     * Information about an app that is currently running one or more foreground services.
     * (This mapps directly to the running apps we show in the notification.)
     * (This maps directly to the running apps we show in the notification.)
     */
     */
    static final class ActiveForegroundApp {
    static final class ActiveForegroundApp {
        String mPackageName;
        String mPackageName;
@@ -813,6 +813,7 @@ public final class ActiveServices {
            String title;
            String title;
            String msg;
            String msg;
            String[] pkgs;
            String[] pkgs;
            long oldestStartTime = System.currentTimeMillis(); // now
            if (active.size() == 1) {
            if (active.size() == 1) {
                intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
                intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
                intent.setData(Uri.fromParts("package", active.get(0).mPackageName, null));
                intent.setData(Uri.fromParts("package", active.get(0).mPackageName, null));
@@ -820,11 +821,13 @@ public final class ActiveServices {
                        R.string.foreground_service_app_in_background, active.get(0).mLabel);
                        R.string.foreground_service_app_in_background, active.get(0).mLabel);
                msg = context.getString(R.string.foreground_service_tap_for_details);
                msg = context.getString(R.string.foreground_service_tap_for_details);
                pkgs = new String[] { active.get(0).mPackageName };
                pkgs = new String[] { active.get(0).mPackageName };
                oldestStartTime = active.get(0).mStartTime;
            } else {
            } else {
                intent = new Intent(Settings.ACTION_FOREGROUND_SERVICES_SETTINGS);
                intent = new Intent(Settings.ACTION_FOREGROUND_SERVICES_SETTINGS);
                pkgs = new String[active.size()];
                pkgs = new String[active.size()];
                for (int i = 0; i < active.size(); i++) {
                for (int i = 0; i < active.size(); i++) {
                    pkgs[i] = active.get(i).mPackageName;
                    pkgs[i] = active.get(i).mPackageName;
                    oldestStartTime = Math.min(oldestStartTime, active.get(i).mStartTime);
                }
                }
                intent.putExtra("packages", pkgs);
                intent.putExtra("packages", pkgs);
                title = context.getString(
                title = context.getString(
@@ -841,9 +844,10 @@ public final class ActiveServices {
                    new Notification.Builder(context,
                    new Notification.Builder(context,
                            SystemNotificationChannels.FOREGROUND_SERVICE)
                            SystemNotificationChannels.FOREGROUND_SERVICE)
                            .addExtras(notificationBundle)
                            .addExtras(notificationBundle)
                            .setSmallIcon(R.drawable.ic_check_circle_24px)
                            .setSmallIcon(R.drawable.stat_sys_vitals)
                            .setOngoing(true)
                            .setOngoing(true)
                            .setShowWhen(false)
                            .setShowWhen(oldestStartTime > 0)
                            .setWhen(oldestStartTime)
                            .setColor(context.getColor(
                            .setColor(context.getColor(
                                    com.android.internal.R.color.system_notification_accent_color))
                                    com.android.internal.R.color.system_notification_accent_color))
                            .setContentTitle(title)
                            .setContentTitle(title)