Loading core/java/android/app/assist/AssistStructure.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -141,10 +141,10 @@ public class AssistStructure implements Parcelable { if (DEBUG_PARCEL) Log.d(TAG, "Creating PooledStringWriter @ " + out.dataPosition()); if (DEBUG_PARCEL) Log.d(TAG, "Creating PooledStringWriter @ " + out.dataPosition()); PooledStringWriter pwriter = new PooledStringWriter(out); PooledStringWriter pwriter = new PooledStringWriter(out); while (writeNextEntryToParcel(as, out, pwriter)) { while (writeNextEntryToParcel(as, out, pwriter)) { // If the parcel contains more than 100K of data, then we are getting too // If the parcel is above the IPC limit, then we are getting too // large for a single IPC so stop here and let the caller come back when it // large for a single IPC so stop here and let the caller come back when it // is ready for more. // is ready for more. if (out.dataSize() > 1024*1024) { if (out.dataSize() > IBinder.MAX_IPC_SIZE) { if (DEBUG_PARCEL) Log.d(TAG, "Assist data size is " + out.dataSize() if (DEBUG_PARCEL) Log.d(TAG, "Assist data size is " + out.dataSize() + " @ pos " + out.dataPosition() + "; returning partial result"); + " @ pos " + out.dataPosition() + "; returning partial result"); out.writeInt(0); out.writeInt(0); Loading core/java/android/content/pm/ParceledListSlice.java +2 −3 Original line number Original line Diff line number Diff line Loading @@ -46,8 +46,7 @@ public class ParceledListSlice<T extends Parcelable> implements Parcelable { * TODO get this number from somewhere else. For now set it to a quarter of * TODO get this number from somewhere else. For now set it to a quarter of * the 1MB limit. * the 1MB limit. */ */ private static final int MAX_IPC_SIZE = 256 * 1024; private static final int MAX_IPC_SIZE = IBinder.MAX_IPC_SIZE; private static final int MAX_FIRST_IPC_SIZE = MAX_IPC_SIZE / 2; private final List<T> mList; private final List<T> mList; Loading Loading @@ -150,7 +149,7 @@ public class ParceledListSlice<T extends Parcelable> implements Parcelable { final Class<?> listElementClass = mList.get(0).getClass(); final Class<?> listElementClass = mList.get(0).getClass(); dest.writeParcelableCreator(mList.get(0)); dest.writeParcelableCreator(mList.get(0)); int i = 0; int i = 0; while (i < N && dest.dataSize() < MAX_FIRST_IPC_SIZE) { while (i < N && dest.dataSize() < MAX_IPC_SIZE) { dest.writeInt(1); dest.writeInt(1); final T parcelable = mList.get(i); final T parcelable = mList.get(i); Loading core/java/android/os/IBinder.java +8 −1 Original line number Original line Diff line number Diff line Loading @@ -150,6 +150,13 @@ public interface IBinder { */ */ int FLAG_ONEWAY = 0x00000001; int FLAG_ONEWAY = 0x00000001; /** * Limit that should be placed on IPC sizes to keep them safely under the * transaction buffer limit. * @hide */ public static final int MAX_IPC_SIZE = 64 * 1024; /** /** * Get the canonical name of the interface supported by this binder. * Get the canonical name of the interface supported by this binder. */ */ Loading Loading
core/java/android/app/assist/AssistStructure.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -141,10 +141,10 @@ public class AssistStructure implements Parcelable { if (DEBUG_PARCEL) Log.d(TAG, "Creating PooledStringWriter @ " + out.dataPosition()); if (DEBUG_PARCEL) Log.d(TAG, "Creating PooledStringWriter @ " + out.dataPosition()); PooledStringWriter pwriter = new PooledStringWriter(out); PooledStringWriter pwriter = new PooledStringWriter(out); while (writeNextEntryToParcel(as, out, pwriter)) { while (writeNextEntryToParcel(as, out, pwriter)) { // If the parcel contains more than 100K of data, then we are getting too // If the parcel is above the IPC limit, then we are getting too // large for a single IPC so stop here and let the caller come back when it // large for a single IPC so stop here and let the caller come back when it // is ready for more. // is ready for more. if (out.dataSize() > 1024*1024) { if (out.dataSize() > IBinder.MAX_IPC_SIZE) { if (DEBUG_PARCEL) Log.d(TAG, "Assist data size is " + out.dataSize() if (DEBUG_PARCEL) Log.d(TAG, "Assist data size is " + out.dataSize() + " @ pos " + out.dataPosition() + "; returning partial result"); + " @ pos " + out.dataPosition() + "; returning partial result"); out.writeInt(0); out.writeInt(0); Loading
core/java/android/content/pm/ParceledListSlice.java +2 −3 Original line number Original line Diff line number Diff line Loading @@ -46,8 +46,7 @@ public class ParceledListSlice<T extends Parcelable> implements Parcelable { * TODO get this number from somewhere else. For now set it to a quarter of * TODO get this number from somewhere else. For now set it to a quarter of * the 1MB limit. * the 1MB limit. */ */ private static final int MAX_IPC_SIZE = 256 * 1024; private static final int MAX_IPC_SIZE = IBinder.MAX_IPC_SIZE; private static final int MAX_FIRST_IPC_SIZE = MAX_IPC_SIZE / 2; private final List<T> mList; private final List<T> mList; Loading Loading @@ -150,7 +149,7 @@ public class ParceledListSlice<T extends Parcelable> implements Parcelable { final Class<?> listElementClass = mList.get(0).getClass(); final Class<?> listElementClass = mList.get(0).getClass(); dest.writeParcelableCreator(mList.get(0)); dest.writeParcelableCreator(mList.get(0)); int i = 0; int i = 0; while (i < N && dest.dataSize() < MAX_FIRST_IPC_SIZE) { while (i < N && dest.dataSize() < MAX_IPC_SIZE) { dest.writeInt(1); dest.writeInt(1); final T parcelable = mList.get(i); final T parcelable = mList.get(i); Loading
core/java/android/os/IBinder.java +8 −1 Original line number Original line Diff line number Diff line Loading @@ -150,6 +150,13 @@ public interface IBinder { */ */ int FLAG_ONEWAY = 0x00000001; int FLAG_ONEWAY = 0x00000001; /** * Limit that should be placed on IPC sizes to keep them safely under the * transaction buffer limit. * @hide */ public static final int MAX_IPC_SIZE = 64 * 1024; /** /** * Get the canonical name of the interface supported by this binder. * Get the canonical name of the interface supported by this binder. */ */ Loading