* commit '38646c19d8badea143113c0dc48ccdacb18badc4': Work on issue #17656716: Unhandled exception in Window Manager
This commit is contained in:
@@ -27,6 +27,7 @@ import android.os.Parcelable;
|
||||
import android.os.SystemProperties;
|
||||
import android.provider.Settings;
|
||||
import android.util.Printer;
|
||||
import android.util.Slog;
|
||||
import com.android.internal.util.FastPrintWriter;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
@@ -378,6 +379,7 @@ public class ApplicationErrorReport implements Parcelable {
|
||||
* Save a CrashInfo instance to a parcel.
|
||||
*/
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
int start = dest.dataPosition();
|
||||
dest.writeString(exceptionClassName);
|
||||
dest.writeString(exceptionMessage);
|
||||
dest.writeString(throwFileName);
|
||||
@@ -385,6 +387,16 @@ public class ApplicationErrorReport implements Parcelable {
|
||||
dest.writeString(throwMethodName);
|
||||
dest.writeInt(throwLineNumber);
|
||||
dest.writeString(stackTrace);
|
||||
int total = dest.dataPosition()-start;
|
||||
if (total > 100*1024) {
|
||||
Slog.d("Error", "ERR: exClass=" + exceptionClassName);
|
||||
Slog.d("Error", "ERR: exMsg=" + exceptionMessage);
|
||||
Slog.d("Error", "ERR: file=" + throwFileName);
|
||||
Slog.d("Error", "ERR: class=" + throwClassName);
|
||||
Slog.d("Error", "ERR: method=" + throwMethodName + " line=" + throwLineNumber);
|
||||
Slog.d("Error", "ERR: stack=" + stackTrace);
|
||||
Slog.d("Error", "ERR: TOTAL BYTES WRITTEN: " + (dest.dataPosition()-start));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -49,6 +49,7 @@ 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;
|
||||
static final String TAG = "Binder";
|
||||
|
||||
/**
|
||||
@@ -388,7 +389,7 @@ public class Binder implements IBinder {
|
||||
}
|
||||
|
||||
static void checkParcel(IBinder obj, int code, Parcel parcel, String msg) {
|
||||
if (parcel.dataSize() >= 800*1024) {
|
||||
if (CHECK_PARCEL_SIZE && parcel.dataSize() >= 800*1024) {
|
||||
// Trying to send > 800k, this is way too much
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(msg);
|
||||
|
||||
@@ -28,6 +28,7 @@ import android.util.ArrayMap;
|
||||
import android.util.Log;
|
||||
import android.util.Printer;
|
||||
import android.util.Singleton;
|
||||
import android.util.Slog;
|
||||
import android.view.IWindowManager;
|
||||
|
||||
import com.android.internal.os.RuntimeInit;
|
||||
@@ -40,6 +41,7 @@ import dalvik.system.VMDebug;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
@@ -1688,7 +1690,13 @@ public final class StrictMode {
|
||||
} else {
|
||||
p.writeInt(violations.size());
|
||||
for (int i = 0; i < violations.size(); ++i) {
|
||||
int start = p.dataPosition();
|
||||
violations.get(i).writeToParcel(p, 0 /* unused flags? */);
|
||||
int size = p.dataPosition()-start;
|
||||
if (size > 100*1024) {
|
||||
Slog.d(TAG, "Wrote violation #" + i + " of " + violations.size() + ": "
|
||||
+ (p.dataPosition()-start) + " bytes");
|
||||
}
|
||||
}
|
||||
if (LOG_V) Log.d(TAG, "wrote violations to response parcel; num=" + violations.size());
|
||||
violations.clear(); // somewhat redundant, as we're about to null the threadlocal
|
||||
@@ -2176,6 +2184,7 @@ public final class StrictMode {
|
||||
*/
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
crashInfo.writeToParcel(dest, flags);
|
||||
int start = dest.dataPosition();
|
||||
dest.writeInt(policy);
|
||||
dest.writeInt(durationMillis);
|
||||
dest.writeInt(violationNumThisLoop);
|
||||
@@ -2184,6 +2193,17 @@ public final class StrictMode {
|
||||
dest.writeLong(numInstances);
|
||||
dest.writeString(broadcastIntentAction);
|
||||
dest.writeStringArray(tags);
|
||||
int total = dest.dataPosition()-start;
|
||||
if (total > 100*1024) {
|
||||
Slog.d(TAG, "VIO: policy=" + policy + " dur=" + durationMillis
|
||||
+ " numLoop=" + violationNumThisLoop
|
||||
+ " anim=" + numAnimationsRunning
|
||||
+ " uptime=" + violationUptimeMillis
|
||||
+ " numInst=" + numInstances);
|
||||
Slog.d(TAG, "VIO: action=" + broadcastIntentAction);
|
||||
Slog.d(TAG, "VIO: tags=" + Arrays.toString(tags));
|
||||
Slog.d(TAG, "VIO: TOTAL BYTES WRITTEN: " + (dest.dataPosition()-start));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6748,6 +6748,9 @@ public final class BatteryStatsImpl extends BatteryStats {
|
||||
|| getLowDischargeAmountSinceCharge() >= 60)
|
||||
|| (getHighDischargeAmountSinceCharge() >= 60
|
||||
&& mHistoryBuffer.dataSize() >= MAX_HISTORY_BUFFER)) {
|
||||
Slog.i(TAG, "Resetting battery stats: level=" + level + " status=" + oldStatus
|
||||
+ " lowAmount=" + getLowDischargeAmountSinceCharge()
|
||||
+ " highAmount=" + getHighDischargeAmountSinceCharge());
|
||||
// Before we write, collect a snapshot of the final aggregated
|
||||
// stats to be reported in the next checkin. Only do this if we have
|
||||
// a sufficient amount of data to make it interesting.
|
||||
|
||||
Reference in New Issue
Block a user