am 8776bd54: am cad60dc8: am 72bc7651: am cbb94a27: Merge "More debugging for issue #17656716: Unhandled exception in Window Manager" into lmp-dev

* commit '8776bd549ed4db7c5e2e5f487d043e8d1b53ff12':
  More debugging for issue #17656716: Unhandled exception in Window Manager
This commit is contained in:
Dianne Hackborn
2014-09-26 23:42:02 +00:00
committed by Android Git Automerger

View File

@@ -387,10 +387,26 @@ public class Binder implements IBinder {
}
}
static void checkParcel(Parcel parcel, String msg) {
static void checkParcel(IBinder obj, int code, Parcel parcel, String msg) {
if (parcel.dataSize() >= 800*1024) {
// Trying to send > 800k, this is way too much
Slog.wtfStack(TAG, msg + parcel.dataSize());
StringBuilder sb = new StringBuilder();
sb.append(msg);
sb.append(": on ");
sb.append(obj);
sb.append(" calling ");
sb.append(code);
sb.append(" size ");
sb.append(parcel.dataSize());
sb.append(" (data: ");
parcel.setDataPosition(0);
sb.append(parcel.readInt());
sb.append(", ");
sb.append(parcel.readInt());
sb.append(", ");
sb.append(parcel.readInt());
sb.append(")");
Slog.wtfStack(TAG, sb.toString());
}
}
@@ -432,7 +448,7 @@ public class Binder implements IBinder {
reply.writeException(re);
res = true;
}
checkParcel(reply, "Unreasonably large binder reply buffer: ");
checkParcel(this, code, reply, "Unreasonably large binder reply buffer");
reply.recycle();
data.recycle();
return res;
@@ -448,7 +464,7 @@ final class BinderProxy implements IBinder {
}
public boolean transact(int code, Parcel data, Parcel reply, int flags) throws RemoteException {
Binder.checkParcel(data, "Unreasonably large binder buffer: ");
Binder.checkParcel(this, code, data, "Unreasonably large binder buffer");
return transactNative(code, data, reply, flags);
}