From ff3673c7f477b1d78e64a8bc28754552dcdc8826 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Sun, 15 Aug 2010 17:28:36 -0700 Subject: Make running services initial update async. Also fix the value show for an app's awake time. Change-Id: I801681d3a1d47a6bb1f3fb8cc5b0ef009201146f --- .../android/settings/applications/RunningProcessesView.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/com/android/settings/applications/RunningProcessesView.java') diff --git a/src/com/android/settings/applications/RunningProcessesView.java b/src/com/android/settings/applications/RunningProcessesView.java index f2d8e9e..1de67f7 100644 --- a/src/com/android/settings/applications/RunningProcessesView.java +++ b/src/com/android/settings/applications/RunningProcessesView.java @@ -64,6 +64,8 @@ public class RunningProcessesView extends FrameLayout RunningState mState; + Runnable mDataAvail; + StringBuilder mBuilder = new StringBuilder(128); RunningState.BaseItem mCurSelected; @@ -390,6 +392,11 @@ public class RunningProcessesView extends FrameLayout adapter.notifyDataSetChanged(); } + if (mDataAvail != null) { + mDataAvail.run(); + mDataAvail = null; + } + // This is the amount of available memory until we start killing // background services. long availMem = readAvailMem() - SECONDARY_SERVER_MEM; @@ -475,15 +482,19 @@ public class RunningProcessesView extends FrameLayout public void doPause() { mState.pause(); + mDataAvail = null; } - public void doResume() { + public boolean doResume(Runnable dataAvail) { mState.resume(this); if (mState.hasData()) { // If the state already has its data, then let's populate our // list right now to avoid flicker. refreshUi(true); + return true; } + mDataAvail = dataAvail; + return false; } public Object doRetainNonConfigurationInstance() { -- cgit v1.1