OSDN Git Service

Disable large-ish parcel logging.
authorJeff Sharkey <jsharkey@android.com>
Fri, 17 Mar 2017 16:25:07 +0000 (10:25 -0600)
committerJeff Sharkey <jsharkey@android.com>
Fri, 17 Mar 2017 16:25:10 +0000 (10:25 -0600)
This logging was originally added to track down very large log
messages that were causing Binder transactions to fail.  We fixed
a handful of bugs that could have been causing this over in 32575987,
so this logging should no longer be needed in live builds.  (In fact,
this logging is being triggered often enough to push other important
debugging information out of logs.)

Test: builds, boots
Bug: 36372780
Change-Id: I640192fbec35693673a2f22b7a82ce54f27937da

core/java/android/app/ApplicationErrorReport.java
core/java/android/os/Binder.java
core/java/android/os/StrictMode.java

index 9f1a539..e645261 100644 (file)
@@ -22,6 +22,7 @@ import android.content.Intent;
 import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
+import android.os.Binder;
 import android.os.Parcel;
 import android.os.Parcelable;
 import android.os.SystemProperties;
@@ -430,7 +431,7 @@ public class ApplicationErrorReport implements Parcelable {
             dest.writeInt(throwLineNumber);
             dest.writeString(stackTrace);
             int total = dest.dataPosition()-start;
-            if (total > 20*1024) {
+            if (Binder.CHECK_PARCEL_SIZE && total > 20*1024) {
                 Slog.d("Error", "ERR: exClass=" + exceptionClassName);
                 Slog.d("Error", "ERR: exMsg=" + exceptionMessage);
                 Slog.d("Error", "ERR: file=" + throwFileName);
index 0136979..7906707 100644 (file)
@@ -66,7 +66,8 @@ public class Binder implements IBinder {
      * of classes can potentially create leaks.
      */
     private static final boolean FIND_POTENTIAL_LEAKS = false;
-    private static final boolean CHECK_PARCEL_SIZE = false;
+    /** @hide */
+    public static final boolean CHECK_PARCEL_SIZE = false;
     static final String TAG = "Binder";
 
     /** @hide */
index caea202..f503b3a 100644 (file)
@@ -2638,7 +2638,7 @@ public final class StrictMode {
             dest.writeString(broadcastIntentAction);
             dest.writeStringArray(tags);
             int total = dest.dataPosition()-start;
-            if (total > 10*1024) {
+            if (Binder.CHECK_PARCEL_SIZE && total > 10*1024) {
                 Slog.d(TAG, "VIO: policy=" + policy + " dur=" + durationMillis
                         + " numLoop=" + violationNumThisLoop
                         + " anim=" + numAnimationsRunning