Move process stats screen into memory screen.

 - Move process stats from developer options to top level
   settings item.
 - Some minor UI changes to the top of the page
 - Major UI updates to detail page, now shows info with processes
   as pref categories and services as prefs, with a way to kill
   them (taken from Running Services page).
 - Some major refactorings in code, in attempt to make it more
   usable
 - Added color bar on per app basis to visualize the avg/max
   relationship
 - Updated the way avg is calculated across multiple entries in
   ProcStatsPackageEntry to be more accurate
 - Change the way max memory is calculated in
   ProcStatsPackageEntry to be less accurate but more useful

Bug: 19443802
Change-Id: Ia6aaabe42c415c50997a09bfb814a6f6e5731772
diff --git a/res/drawable/ic_cancel.xml b/res/drawable/ic_cancel.xml
new file mode 100644
index 0000000..b90c18c
--- /dev/null
+++ b/res/drawable/ic_cancel.xml
@@ -0,0 +1,25 @@
+<!--
+    Copyright (C) 2015 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="24dp"
+        android:height="24dp"
+        android:viewportWidth="48.0"
+        android:viewportHeight="48.0">
+
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M24.0,4.0C12.9,4.0 4.0,12.9 4.0,24.0s8.9,20.0 20.0,20.0c11.1,0.0 20.0,-8.9 20.0,-20.0S35.1,4.0 24.0,4.0zM34.0,31.2L31.2,34.0L24.0,26.8L16.8,34.0L14.0,31.2l7.2,-7.2L14.0,16.8l2.8,-2.8l7.2,7.2l7.2,-7.2l2.8,2.8L26.8,24.0L34.0,31.2z"/>
+</vector>
diff --git a/res/drawable/ic_settings_memory.xml b/res/drawable/ic_settings_memory.xml
new file mode 100644
index 0000000..a459465
--- /dev/null
+++ b/res/drawable/ic_settings_memory.xml
@@ -0,0 +1,37 @@
+<!--
+     Copyright (C) 2015 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="32dp"
+        android:height="32dp"
+        android:viewportWidth="24.0"
+        android:viewportHeight="24.0">
+    <path
+        android:pathData="M6.0,4.0l0.0,16.0 12.0,0.0 0.0,-16.0 -12.0,0.0z
+        M6.0,5.25l0,1.5 -3,0 0,-1.5 3,0z
+        M6.0,9.25l0,1.5 -3,0 0,-1.5 3,0z
+        M6.0,13.25l0,1.5 -3,0 0,-1.5 3,0z
+        M6.0,17.25l0,1.5 -3,0 0,-1.5 3,0z
+        M21.0,5.25l0,1.5 -3,0 0,-1.5 3,0z
+        M21.0,9.25l0,1.5 -3,0 0,-1.5 3,0z
+        M21.0,13.25l0,1.5 -3,0 0,-1.5 3,0z
+        M21.0,17.25l0,1.5 -3,0 0,-1.5 3,0z
+
+        M11.5,14.5l1,0 0,3 -1,0 0,-3z
+        M13.25,14.5l1,0 0,3 -1,0 0,-3z
+        M15.0,14.5l1,0 0,3 -1,0 0,-3z
+        "
+        android:fillColor="#ff009587" />
+</vector>
diff --git a/res/layout/app_item_linear_color.xml b/res/layout/app_item_linear_color.xml
new file mode 100755
index 0000000..62eebb9
--- /dev/null
+++ b/res/layout/app_item_linear_color.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2015 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:minHeight="?android:attr/listPreferredItemHeight"
+    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
+    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
+    android:paddingTop="8dip"
+    android:paddingBottom="8dip">
+
+    <ImageView
+        android:id="@android:id/icon"
+        android:layout_width="@android:dimen/app_icon_size"
+        android:layout_height="@android:dimen/app_icon_size"
+        android:layout_marginEnd="8dip"
+        android:scaleType="centerInside"
+        android:contentDescription="@null"
+        android:duplicateParentState="true" />
+
+    <LinearLayout
+        android:layout_width="0dp"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        android:orientation="vertical"
+        android:duplicateParentState="true">
+
+        <TextView
+            android:id="@android:id/title"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="2dip"
+            android:singleLine="true"
+            android:ellipsize="marquee"
+            android:textAppearance="@android:style/TextAppearance.Material.Subhead"
+            android:textAlignment="viewStart"
+            android:duplicateParentState="true" />
+
+        <TextView
+            android:id="@android:id/summary"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textAppearance="@android:style/TextAppearance.Material.Body1"
+            android:textColor="?android:attr/textColorSecondary"
+            android:textAlignment="viewStart"
+            android:duplicateParentState="true" />
+
+    </LinearLayout>
+
+    <com.android.settings.applications.LinearColorBar
+        android:id="@+id/linear_color_bar"
+        android:layout_width="0dp"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        android:layout_marginTop="5dp"
+        android:layout_marginBottom="5dp"
+        android:duplicateParentState="true" />
+
+</LinearLayout>
diff --git a/res/layout/cancel_pref_widget.xml b/res/layout/cancel_pref_widget.xml
new file mode 100644
index 0000000..0b3ef21
--- /dev/null
+++ b/res/layout/cancel_pref_widget.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/cancel"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:clickable="true"
+    android:src="@drawable/ic_cancel"
+    />
diff --git a/res/layout/memory_key.xml b/res/layout/memory_key.xml
new file mode 100644
index 0000000..62db2fc
--- /dev/null
+++ b/res/layout/memory_key.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:gravity="center_vertical|end"
+    android:layout_marginBottom="5dp" >
+
+    <ImageView
+        android:layout_width="16dp"
+        android:layout_height="16dp"
+        android:scaleType="centerInside"
+        android:src="@color/memory_avg_use"
+        android:contentDescription="@null" />
+
+    <TextView
+        android:id="@+id/memory_avg"
+        android:text="@string/memory_avg_use"
+        android:textAppearance="@android:style/TextAppearance.Material.Body1"
+        android:textColor="?android:attr/textColorSecondary"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="8dp"
+        android:layout_marginEnd="16dp" />
+
+    <ImageView
+        android:layout_width="16dp"
+        android:layout_height="16dp"
+        android:scaleType="centerInside"
+        android:src="@color/memory_max_use"
+        android:contentDescription="@null" />
+
+    <TextView
+        android:id="@+id/memory_max"
+        android:text="@string/memory_max_use"
+        android:textAppearance="@android:style/TextAppearance.Material.Body1"
+        android:textColor="?android:attr/textColorSecondary"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="8dp"
+        android:layout_marginEnd="16dp" />
+
+</LinearLayout>
diff --git a/res/layout/proc_stats_ui.xml b/res/layout/proc_stats_ui.xml
new file mode 100644
index 0000000..5f78178
--- /dev/null
+++ b/res/layout/proc_stats_ui.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2015 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.
+-->
+
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/all_details"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
+    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
+    android:orientation="vertical">
+
+    <TextView
+        android:id="@+id/memory_state"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="20dp"
+        android:layout_marginBottom="10dp"
+        android:textAppearance="@android:style/TextAppearance.Material.Subhead"
+        />
+
+    <com.android.settings.applications.LinearColorBar
+        android:id="@+id/color_bar"
+        android:layout_width="match_parent"
+        android:layout_height="30dp"
+        />
+
+    <TextView
+        android:id="@+id/memory_used"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="2dp"
+        android:layout_marginBottom="10dp"
+        android:textAppearance="@android:style/TextAppearance.Material.Small"
+        android:textColor="?android:attr/textColorSecondary"
+        />
+
+    <include layout="@layout/memory_key" />
+
+</LinearLayout>
+
diff --git a/res/layout/process_preference_category.xml b/res/layout/process_preference_category.xml
new file mode 100644
index 0000000..18ea23c
--- /dev/null
+++ b/res/layout/process_preference_category.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:layout_marginBottom="16dip"
+    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
+    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
+    android:paddingTop="16dip">
+    <TextView
+        android:id="@android:id/title"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:textAppearance="@android:style/TextAppearance.Material.Body2"
+        android:textColor="?android:attr/colorAccent" />
+
+    <TextView
+        android:id="@android:id/summary"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentEnd="true"
+        android:textAppearance="@android:style/TextAppearance.Material.Body2"
+        android:textColor="?android:attr/colorAccent" />
+
+</RelativeLayout>
diff --git a/res/layout/process_stats_details.xml b/res/layout/process_stats_details.xml
index 738805a..aa402f6 100644
--- a/res/layout/process_stats_details.xml
+++ b/res/layout/process_stats_details.xml
@@ -14,68 +14,34 @@
      limitations under the License.
 -->
 
-<ScrollView
+<LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/all_details"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:clipToPadding="false"
-    android:scrollbarStyle="@integer/preference_scrollbar_style">
+    android:orientation="vertical"
+    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
+    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
 
-    <LinearLayout
-        android:id="@+id/all_details"
+    <com.android.settings.applications.LinearColorBar
+        android:id="@+id/color_bar"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:paddingTop="5dip"
-        android:paddingBottom="5dip"
-        android:orientation="vertical"
-        android:paddingStart="?android:attr/listPreferredItemPaddingStart"
-        android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
+        android:layout_height="40dp"
+        android:layout_marginTop="12dp"
+        android:layout_marginBottom="10dp"
+        />
 
-        <include layout="@layout/app_percentage_item" />
+    <include layout="@layout/memory_key" />
 
-        <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:orientation="vertical">
+    <!-- Force stop and report buttons -->
+    <LinearLayout
+        android:id="@+id/two_buttons_panel"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:paddingBottom="6dip"
+        android:orientation="vertical">
 
-            <!-- Force stop and report buttons -->
-            <LinearLayout
-                    android:id="@+id/two_buttons_panel"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:paddingBottom="6dip"
-                    android:orientation="vertical">
-
-                <include layout="@layout/two_buttons_panel"/>
-            </LinearLayout>
-
-            <LinearLayout
-                    android:id="@+id/processes"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="vertical">
-
-                <!-- Insert process items here -->
-
-            </LinearLayout>
-
-            <TextView
-                    android:id="@+id/services_label"
-                    style="?android:attr/listSeparatorTextViewStyle"
-                    android:text="@string/services_subtitle" />
-
-            <LinearLayout
-                    android:id="@+id/services"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="vertical">
-
-                <!-- Insert service items here -->
-
-            </LinearLayout>
-
-        </LinearLayout>
-
+        <include layout="@layout/two_buttons_panel"/>
     </LinearLayout>
 
-</ScrollView>
+</LinearLayout>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 25a7341..1fbfc18 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -86,4 +86,9 @@
     <color name="voice_interaction_highlight">#33b5e5</color>
 
     <drawable name="fp_enrollment_header_landscape">#009688</drawable>
+
+    <color name="memory_avg_use">#ff384248</color>
+    <color name="memory_max_use">#ff009587</color>
+    <color name="memory_remaining">#ffced7db</color>
+
 </resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 41b96c2..0b98428 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -4188,8 +4188,13 @@
     <!-- [CHAR LIMIT=NONE] Label for process stats, duration of time the stats are over;
          timeDuration is a duration such as "1h 30m" -->
     <string name="process_stats_total_duration"><xliff:g id="usedRam">%1$s</xliff:g>
-        of <xliff:g id="totalRam">%2$s</xliff:g> used over
+        of <xliff:g id="totalRam">%2$s</xliff:g> used over last
         <xliff:g id="timeDuration">%3$s</xliff:g></string>
+    <!-- [CHAR LIMIT=NONE] Label for process stats, duration of time the stats are over;
+         timeDuration is a duration such as "1h 30m" -->
+    <string name="process_stats_total_duration_percentage"><xliff:g id="percent" example="50%">%1$s</xliff:g>
+        of RAM used over
+        <xliff:g id="timeDuration">%2$s</xliff:g></string>
     <!-- [CHAR LIMIT=NONE] Label for process stats, text for stats type -->
     <string name="process_stats_type_background">Background</string>
     <!-- [CHAR LIMIT=NONE] Label for process stats, text for stats type -->
@@ -4197,7 +4202,7 @@
     <!-- [CHAR LIMIT=NONE] Label for process stats, text for stats type -->
     <string name="process_stats_type_cached">Cached</string>
     <!-- [CHAR LIMIT=NONE] Label for process stats, duration of time the stats are over -->
-    <string name="process_stats_memory_status">Device memory is currently
+    <string name="process_stats_memory_status">Memory is 
         <xliff:g id="memstate">%1$s</xliff:g></string>
     <!-- [CHAR LIMIT=NONE] Label OS "process" app -->
     <string name="process_stats_os_label">Android OS</string>
@@ -4251,6 +4256,9 @@
     <string name="menu_show_system">Show system</string>
     <!-- [CHAR LIMIT=NONE] Menu for manage apps to control whether system processes are hidden -->
     <string name="menu_hide_system">Hide system</string>
+    <!-- [CHAR LIMIT=NONE] Menu for process stats to control whether stats are shown
+         as percentages-->
+    <string name="menu_show_percentage">Show percentages</string>
     <!-- [CHAR LIMIT=NONE] Menu for process stats to control whether computation should be based
         on Uss (Unique Set Size) instead of Pss (Proportional Set Size) -->
     <string name="menu_use_uss">Use Uss</string>
@@ -6498,4 +6506,40 @@
     <!-- Description of the usage access setting [CHAR LIMIT=NONE] -->
     <string name="usage_access_description">Usage access allows an app to track what other apps you\'re using and how often, as well as your carrier, language settings, and other details.</string>
 
+    <!-- Title for screen showing recent memory usage of device [CHAR LIMIT=30]-->
+    <string name="memory_settings_title">Memory</string>
+
+    <!-- Title for screen showing recent memory usage of specific app [CHAR LIMIT=30]-->
+    <string name="memory_details_title">Memory details</string>
+
+    <!-- Description of app always running [CHAR LIMIT=45] -->
+    <string name="always_running">Always running</string>
+
+    <!-- Description of app sometimes running [CHAR LIMIT=45] -->
+    <string name="sometimes_running">Sometimes running</string>
+
+    <!-- Description of app rarely running [CHAR LIMIT=45] -->
+    <string name="rarely_running">Rarely running</string>
+
+    <!-- Maximum memory usage key [CHAR LIMIT=25] -->
+    <string name="memory_max_use">Maximum</string>
+
+    <!-- Average memory usage key [CHAR LIMIT=25] -->
+    <string name="memory_avg_use">Average</string>
+
+    <!-- Maximum memory used by an app [CHAR LIMIT=25] -->
+    <string name="memory_max_desc">Maximum <xliff:g id="memory" example="30MB">%1$s</xliff:g></string>
+
+    <!-- Average memory used by an app [CHAR LIMIT=25] -->
+    <string name="memory_avg_desc">Average <xliff:g id="memory" example="30MB">%1$s</xliff:g></string>
+
+    <!-- Formatting for memory description [CHAR LIMIT=25] -->
+    <string name="memory_use_running_format"><xliff:g id="memory" example="30MB">%1$s</xliff:g> / <xliff:g id="running" example="Always running">%2$s</xliff:g></string>
+
+    <!-- Label for process (singular) [CHAR LIMIT=25] -->
+    <string name="process">Process</string>
+
+    <!-- Label for process [CHAR LIMIT=25] -->
+    <string name="process_format">Process <xliff:g id="count" example="3">%1$d</xliff:g></string>
+
 </resources>
diff --git a/res/xml/app_memory_settings.xml b/res/xml/app_memory_settings.xml
new file mode 100644
index 0000000..2c3db21
--- /dev/null
+++ b/res/xml/app_memory_settings.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+                  android:title="@string/memory_details_title">
+
+    <com.android.settings.applications.LayoutPreference
+        android:key="details_header"
+        android:layout="@layout/process_stats_details" />
+
+</PreferenceScreen>
diff --git a/res/xml/dashboard_categories.xml b/res/xml/dashboard_categories.xml
index 78fe0e7..cdc1166 100644
--- a/res/xml/dashboard_categories.xml
+++ b/res/xml/dashboard_categories.xml
@@ -134,6 +134,14 @@
                 android:icon="@drawable/ic_settings_multiuser"
                 />
 
+        <!-- Memory -->
+        <dashboard-tile
+                android:id="@+id/manage_memory"
+                android:title="@string/memory_settings_title"
+                android:fragment="com.android.settings.applications.ProcessStatsUi"
+                android:icon="@drawable/ic_settings_memory"
+                />
+
         <!-- Manage NFC payment apps -->
         <dashboard-tile
                 android:id="@+id/nfc_payment_settings"
diff --git a/res/xml/development_prefs.xml b/res/xml/development_prefs.xml
index c36b3e7..6911892 100644
--- a/res/xml/development_prefs.xml
+++ b/res/xml/development_prefs.xml
@@ -54,12 +54,6 @@
         android:title="@string/oem_unlock_enable"
         android:summary="@string/oem_unlock_enable_summary"/>
 
-    <PreferenceScreen android:key="proc_stats"
-            android:title="@string/process_stats_summary_title"
-            android:summary="@string/process_stats_summary"
-            android:fragment="com.android.settings.applications.ProcessStatsUi">
-    </PreferenceScreen>
-
     <PreferenceScreen
         android:key="running_apps"
         android:title="@string/runningservices_settings_title"
diff --git a/res/xml/process_stats_summary.xml b/res/xml/process_stats_summary.xml
index fbd87fd..46bb160 100644
--- a/res/xml/process_stats_summary.xml
+++ b/res/xml/process_stats_summary.xml
@@ -14,12 +14,11 @@
      limitations under the License.
 -->
 
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
-        android:title="@string/app_memory_use"
-        android:key="app_list">
-    <Preference
-        style="?android:attr/preferenceInformationStyle"
-        android:key="mem_status"
-        android:persistent="false"
-    />
+<PreferenceScreen
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:title="@string/app_memory_use"
+    android:key="app_list">
+    <com.android.settings.applications.LayoutPreference
+        android:key="status_header"
+        android:layout="@layout/proc_stats_ui" />
 </PreferenceScreen>