Loading core/java/android/os/BaseBundle.java +17 −9 Original line number Diff line number Diff line Loading @@ -65,11 +65,12 @@ public class BaseBundle { sShouldDefuse = shouldDefuse; } // A parcel cannot be obtained during compile-time initialization. Put the // empty parcel into an inner class that can be initialized separately. This // allows to initialize BaseBundle, and classes depending on it. /** {@hide} */ static final Parcel EMPTY_PARCEL; static { EMPTY_PARCEL = Parcel.obtain(); static final class NoImagePreloadHolder { public static final Parcel EMPTY_PARCEL = Parcel.obtain(); } // Invariant - exactly one of mMap / mParcelledData will be null Loading Loading @@ -156,8 +157,8 @@ public class BaseBundle { */ BaseBundle(BaseBundle b) { if (b.mParcelledData != null) { if (b.mParcelledData == EMPTY_PARCEL) { mParcelledData = EMPTY_PARCEL; if (b.isEmptyParcel()) { mParcelledData = NoImagePreloadHolder.EMPTY_PARCEL; } else { mParcelledData = Parcel.obtain(); mParcelledData.appendFrom(b.mParcelledData, 0, b.mParcelledData.dataSize()); Loading Loading @@ -236,7 +237,7 @@ public class BaseBundle { + "clobber all data inside!", new Throwable()); } if (mParcelledData == EMPTY_PARCEL) { if (isEmptyParcel()) { if (DEBUG) Log.d(TAG, "unparcel " + Integer.toHexString(System.identityHashCode(this)) + ": empty"); if (mMap == null) { Loading Loading @@ -284,6 +285,13 @@ public class BaseBundle { return mParcelledData != null; } /** * @hide */ public boolean isEmptyParcel() { return mParcelledData == NoImagePreloadHolder.EMPTY_PARCEL; } /** @hide */ ArrayMap<String, Object> getMap() { unparcel(); Loading Loading @@ -1368,7 +1376,7 @@ public class BaseBundle { // Keep implementation in sync with writeToParcel() in // frameworks/native/libs/binder/PersistableBundle.cpp. if (mParcelledData != null) { if (mParcelledData == EMPTY_PARCEL) { if (isEmptyParcel()) { parcel.writeInt(0); } else { int length = mParcelledData.dataSize(); Loading Loading @@ -1416,7 +1424,7 @@ public class BaseBundle { } else if (length == 0) { // Empty Bundle or end of data. mParcelledData = EMPTY_PARCEL; mParcelledData = NoImagePreloadHolder.EMPTY_PARCEL; return; } Loading core/java/android/os/Bundle.java +1 −4 Original line number Diff line number Diff line Loading @@ -38,12 +38,9 @@ public final class Bundle extends BaseBundle implements Cloneable, Parcelable { public static final Bundle EMPTY; static final Parcel EMPTY_PARCEL; static { EMPTY = new Bundle(); EMPTY.mMap = ArrayMap.EMPTY; EMPTY_PARCEL = BaseBundle.EMPTY_PARCEL; } /** Loading Loading @@ -1155,7 +1152,7 @@ public final class Bundle extends BaseBundle implements Cloneable, Parcelable { @Override public synchronized String toString() { if (mParcelledData != null) { if (mParcelledData == EMPTY_PARCEL) { if (isEmptyParcel()) { return "Bundle[EMPTY_PARCEL]"; } else { return "Bundle[mParcelledData.dataSize=" + Loading core/java/android/os/PersistableBundle.java +1 −3 Original line number Diff line number Diff line Loading @@ -38,12 +38,10 @@ public final class PersistableBundle extends BaseBundle implements Cloneable, Pa XmlUtils.WriteMapCallback { private static final String TAG_PERSISTABLEMAP = "pbundle_as_map"; public static final PersistableBundle EMPTY; static final Parcel EMPTY_PARCEL; static { EMPTY = new PersistableBundle(); EMPTY.mMap = ArrayMap.EMPTY; EMPTY_PARCEL = BaseBundle.EMPTY_PARCEL; } /** @hide */ Loading Loading @@ -278,7 +276,7 @@ public final class PersistableBundle extends BaseBundle implements Cloneable, Pa @Override synchronized public String toString() { if (mParcelledData != null) { if (mParcelledData == EMPTY_PARCEL) { if (isEmptyParcel()) { return "PersistableBundle[EMPTY_PARCEL]"; } else { return "PersistableBundle[mParcelledData.dataSize=" + Loading preloaded-classes +1 −0 Original line number Diff line number Diff line Loading @@ -1613,6 +1613,7 @@ android.os.AsyncTask$Status android.os.AsyncTask$WorkerRunnable android.os.BadParcelableException android.os.BaseBundle android.os.BaseBundle$NoImagePreloadHolder android.os.BatteryManager android.os.Binder android.os.BinderProxy Loading Loading
core/java/android/os/BaseBundle.java +17 −9 Original line number Diff line number Diff line Loading @@ -65,11 +65,12 @@ public class BaseBundle { sShouldDefuse = shouldDefuse; } // A parcel cannot be obtained during compile-time initialization. Put the // empty parcel into an inner class that can be initialized separately. This // allows to initialize BaseBundle, and classes depending on it. /** {@hide} */ static final Parcel EMPTY_PARCEL; static { EMPTY_PARCEL = Parcel.obtain(); static final class NoImagePreloadHolder { public static final Parcel EMPTY_PARCEL = Parcel.obtain(); } // Invariant - exactly one of mMap / mParcelledData will be null Loading Loading @@ -156,8 +157,8 @@ public class BaseBundle { */ BaseBundle(BaseBundle b) { if (b.mParcelledData != null) { if (b.mParcelledData == EMPTY_PARCEL) { mParcelledData = EMPTY_PARCEL; if (b.isEmptyParcel()) { mParcelledData = NoImagePreloadHolder.EMPTY_PARCEL; } else { mParcelledData = Parcel.obtain(); mParcelledData.appendFrom(b.mParcelledData, 0, b.mParcelledData.dataSize()); Loading Loading @@ -236,7 +237,7 @@ public class BaseBundle { + "clobber all data inside!", new Throwable()); } if (mParcelledData == EMPTY_PARCEL) { if (isEmptyParcel()) { if (DEBUG) Log.d(TAG, "unparcel " + Integer.toHexString(System.identityHashCode(this)) + ": empty"); if (mMap == null) { Loading Loading @@ -284,6 +285,13 @@ public class BaseBundle { return mParcelledData != null; } /** * @hide */ public boolean isEmptyParcel() { return mParcelledData == NoImagePreloadHolder.EMPTY_PARCEL; } /** @hide */ ArrayMap<String, Object> getMap() { unparcel(); Loading Loading @@ -1368,7 +1376,7 @@ public class BaseBundle { // Keep implementation in sync with writeToParcel() in // frameworks/native/libs/binder/PersistableBundle.cpp. if (mParcelledData != null) { if (mParcelledData == EMPTY_PARCEL) { if (isEmptyParcel()) { parcel.writeInt(0); } else { int length = mParcelledData.dataSize(); Loading Loading @@ -1416,7 +1424,7 @@ public class BaseBundle { } else if (length == 0) { // Empty Bundle or end of data. mParcelledData = EMPTY_PARCEL; mParcelledData = NoImagePreloadHolder.EMPTY_PARCEL; return; } Loading
core/java/android/os/Bundle.java +1 −4 Original line number Diff line number Diff line Loading @@ -38,12 +38,9 @@ public final class Bundle extends BaseBundle implements Cloneable, Parcelable { public static final Bundle EMPTY; static final Parcel EMPTY_PARCEL; static { EMPTY = new Bundle(); EMPTY.mMap = ArrayMap.EMPTY; EMPTY_PARCEL = BaseBundle.EMPTY_PARCEL; } /** Loading Loading @@ -1155,7 +1152,7 @@ public final class Bundle extends BaseBundle implements Cloneable, Parcelable { @Override public synchronized String toString() { if (mParcelledData != null) { if (mParcelledData == EMPTY_PARCEL) { if (isEmptyParcel()) { return "Bundle[EMPTY_PARCEL]"; } else { return "Bundle[mParcelledData.dataSize=" + Loading
core/java/android/os/PersistableBundle.java +1 −3 Original line number Diff line number Diff line Loading @@ -38,12 +38,10 @@ public final class PersistableBundle extends BaseBundle implements Cloneable, Pa XmlUtils.WriteMapCallback { private static final String TAG_PERSISTABLEMAP = "pbundle_as_map"; public static final PersistableBundle EMPTY; static final Parcel EMPTY_PARCEL; static { EMPTY = new PersistableBundle(); EMPTY.mMap = ArrayMap.EMPTY; EMPTY_PARCEL = BaseBundle.EMPTY_PARCEL; } /** @hide */ Loading Loading @@ -278,7 +276,7 @@ public final class PersistableBundle extends BaseBundle implements Cloneable, Pa @Override synchronized public String toString() { if (mParcelledData != null) { if (mParcelledData == EMPTY_PARCEL) { if (isEmptyParcel()) { return "PersistableBundle[EMPTY_PARCEL]"; } else { return "PersistableBundle[mParcelledData.dataSize=" + Loading
preloaded-classes +1 −0 Original line number Diff line number Diff line Loading @@ -1613,6 +1613,7 @@ android.os.AsyncTask$Status android.os.AsyncTask$WorkerRunnable android.os.BadParcelableException android.os.BaseBundle android.os.BaseBundle$NoImagePreloadHolder android.os.BatteryManager android.os.Binder android.os.BinderProxy Loading