Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 624d50f0 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick
Browse files

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
parent 3f24a5b3
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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();