summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@android.com>2010-11-09 14:25:12 -0800
committerBrad Fitzpatrick <bradfitz@android.com>2010-11-09 14:25:12 -0800
commit624d50f00dc3d672d676a2fbb405c61dfc875b28 (patch)
tree259a879b109d0c8a888e00c5ef90fbb6413d4e9f
parent3f24a5b34808e10472e30888108eae67e3c39530 (diff)
downloadframeworks_base-624d50f00dc3d672d676a2fbb405c61dfc875b28.zip
frameworks_base-624d50f00dc3d672d676a2fbb405c61dfc875b28.tar.gz
frameworks_base-624d50f00dc3d672d676a2fbb405c61dfc875b28.tar.bz2
Don't warn on reading from disk during initial class loading.
I'm going through the stacks that I filter out from the StrictMode reports and making sure the devices don't upload them to begin with when they're obviously legit and unavoidable. Change-Id: If87b3182b12140f5ddbe52fed059b592b2cc178c
-rw-r--r--core/java/android/app/LoadedApk.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/java/android/app/LoadedApk.java b/core/java/android/app/LoadedApk.java
index 7f24d27..03a98d1 100644
--- a/core/java/android/app/LoadedApk.java
+++ b/core/java/android/app/LoadedApk.java
@@ -35,6 +35,7 @@ import android.os.Handler;
import android.os.IBinder;
import android.os.Process;
import android.os.RemoteException;
+import android.os.StrictMode;
import android.util.AndroidRuntimeException;
import android.util.Slog;
@@ -285,10 +286,16 @@ final class LoadedApk {
if (ActivityThread.localLOGV)
Slog.v(ActivityThread.TAG, "Class path: " + zip + ", JNI path: " + mLibDir);
+ // Temporarily disable logging of disk reads on the Looper thread
+ // as this is early and necessary.
+ StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
+
mClassLoader =
ApplicationLoaders.getDefault().getClassLoader(
zip, mLibDir, mBaseClassLoader);
initializeJavaContextClassLoader();
+
+ StrictMode.setThreadPolicy(oldPolicy);
} else {
if (mBaseClassLoader == null) {
mClassLoader = ClassLoader.getSystemClassLoader();