summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@android.com>2010-11-11 08:48:43 -0800
committerBrad Fitzpatrick <bradfitz@android.com>2010-11-11 08:48:43 -0800
commit76629102b911a376eb49e7cffe2a4fb0e43aab55 (patch)
tree4db230417438b6265c1b4f242a85bb8e4f2e0443 /src/com
parentcc13e0b2e431275475c2f518297ff64322a54809 (diff)
downloadpackages_apps_settings-76629102b911a376eb49e7cffe2a4fb0e43aab55.zip
packages_apps_settings-76629102b911a376eb49e7cffe2a4fb0e43aab55.tar.gz
packages_apps_settings-76629102b911a376eb49e7cffe2a4fb0e43aab55.tar.bz2
Don't complain about /proc usage in Settings killing animations.
Change-Id: If6c2b5dc2244ac4b921e45daeb8e0052306e2c54
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/settings/applications/RunningProcessesView.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/settings/applications/RunningProcessesView.java b/src/com/android/settings/applications/RunningProcessesView.java
index 958adbd..ef5adac 100644
--- a/src/com/android/settings/applications/RunningProcessesView.java
+++ b/src/com/android/settings/applications/RunningProcessesView.java
@@ -24,6 +24,7 @@ import android.app.Fragment;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Bundle;
+import android.os.StrictMode;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.preference.PreferenceActivity;
@@ -335,6 +336,10 @@ public class RunningProcessesView extends FrameLayout
}
private long readAvailMem() {
+ // Permit disk reads here, as /proc/meminfo isn't really "on
+ // disk" and should be fast. TODO: make BlockGuard ignore
+ // /proc/ and /sys/ files perhaps?
+ StrictMode.ThreadPolicy savedPolicy = StrictMode.allowThreadDiskReads();
try {
long memFree = 0;
long memCached = 0;
@@ -357,6 +362,8 @@ public class RunningProcessesView extends FrameLayout
return memFree + memCached;
} catch (java.io.FileNotFoundException e) {
} catch (java.io.IOException e) {
+ } finally {
+ StrictMode.setThreadPolicy(savedPolicy);
}
return 0;
}