From 88cf7709cb7ed829980cb8ddac3d5c7ac945d772 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Mon, 23 Sep 2013 15:02:13 -0700 Subject: [PATCH] Implement issue #10895990: Better durations for proc stats Add new option to select data duration to show, with the default being 3 hours. Reworked how menus are updated to remove redundant code. Switch to using new proc stats service API for retrieving stats, which is more efficient and won't hit IPC limits. Fixed layout for details items to ellipsize long items. Change-Id: I1a0f8a4adf8fc330c2639077323c6379d23ad987 --- res/layout/power_usage_detail_item_text.xml | 2 + res/values/strings.xml | 10 + .../settings/applications/ProcessStatsUi.java | 177 ++++++++++-------- 3 files changed, 111 insertions(+), 78 deletions(-) diff --git a/res/layout/power_usage_detail_item_text.xml b/res/layout/power_usage_detail_item_text.xml index fb8c705ce7f..e4aee1b2b9f 100644 --- a/res/layout/power_usage_detail_item_text.xml +++ b/res/layout/power_usage_detail_item_text.xml @@ -26,7 +26,9 @@ android:textAppearance="?android:attr/textAppearanceMedium" android:textStyle="bold" android:singleLine="true" + android:ellipsize="middle" android:layout_alignParentStart="true" + android:layout_toStartOf="@+id/value" android:layout_marginBottom="4dip" android:layout_marginTop="4dip" android:layout_marginStart="4dip" /> diff --git a/res/values/strings.xml b/res/values/strings.xml index e3e21703762..370a811c229 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -3657,6 +3657,16 @@ Run time Services + + Duration + + 3 hours + + 6 hours + + 12 hours + + 1 day Show system