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

Commit 0b5efb3b 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: I37c76ae86bcaee7c946863add041bbd1ca678cf9
parent e5ef6769
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ public class SystemNotificationChannels {
        channelsList.add(new NotificationChannel(
                FOREGROUND_SERVICE,
                context.getString(R.string.notification_channel_foreground_service),
                NotificationManager.IMPORTANCE_MIN));
                NotificationManager.IMPORTANCE_LOW));

        nm.createNotificationChannels(channelsList);
    }
+29 −0
Original line number 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>
+3 −3
Original line number Diff line number Diff line
@@ -3038,10 +3038,10 @@
  <java-symbol type="array" name="config_allowedSecureInstantAppSettings" />

  <java-symbol type="bool" name="config_handleVolumeKeysInWindowManager" />

  <java-symbol type="integer" name="config_inCallNotificationVolumeRelative" />

  <java-symbol type="bool" name="config_dozeAlwaysOnDisplayAvailable" />

  <java-symbol type="integer" name="config_storageManagerDaystoRetainDefault" />

  <java-symbol type="drawable" name="stat_sys_vitals" />

</resources>
+7 −3
Original line number 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.
     * (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 {
        String mPackageName;
@@ -813,6 +813,7 @@ public final class ActiveServices {
            String title;
            String msg;
            String[] pkgs;
            long oldestStartTime = System.currentTimeMillis(); // now
            if (active.size() == 1) {
                intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
                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);
                msg = context.getString(R.string.foreground_service_tap_for_details);
                pkgs = new String[] { active.get(0).mPackageName };
                oldestStartTime = active.get(0).mStartTime;
            } else {
                intent = new Intent(Settings.ACTION_FOREGROUND_SERVICES_SETTINGS);
                pkgs = new String[active.size()];
                for (int i = 0; i < active.size(); i++) {
                    pkgs[i] = active.get(i).mPackageName;
                    oldestStartTime = Math.min(oldestStartTime, active.get(i).mStartTime);
                }
                intent.putExtra("packages", pkgs);
                title = context.getString(
@@ -841,9 +844,10 @@ public final class ActiveServices {
                    new Notification.Builder(context,
                            SystemNotificationChannels.FOREGROUND_SERVICE)
                            .addExtras(notificationBundle)
                            .setSmallIcon(R.drawable.ic_check_circle_24px)
                            .setSmallIcon(R.drawable.stat_sys_vitals)
                            .setOngoing(true)
                            .setShowWhen(false)
                            .setShowWhen(oldestStartTime > 0)
                            .setWhen(oldestStartTime)
                            .setColor(context.getColor(
                                    com.android.internal.R.color.system_notification_accent_color))
                            .setContentTitle(title)