Loading core/java/android/os/BaseBundle.java +5 −5 Original line number Diff line number Diff line Loading @@ -480,10 +480,10 @@ public class BaseBundle implements Parcel.ClassLoaderProvider { map.erase(); map.ensureCapacity(count); } int numLazyValues = 0; int[] numLazyValues = new int[]{0}; try { numLazyValues = parcelledData.readArrayMap(map, count, !parcelledByNative, /* lazy */ ownsParcel, this); parcelledData.readArrayMap(map, count, !parcelledByNative, /* lazy */ ownsParcel, this, numLazyValues); } catch (BadParcelableException e) { if (sShouldDefuse) { Log.w(TAG, "Failed to parse Bundle, but defusing quietly", e); Loading @@ -494,14 +494,14 @@ public class BaseBundle implements Parcel.ClassLoaderProvider { } finally { mWeakParcelledData = null; if (ownsParcel) { if (numLazyValues == 0) { if (numLazyValues[0] == 0) { recycleParcel(parcelledData); } else { mWeakParcelledData = new WeakReference<>(parcelledData); } } mLazyValues = numLazyValues; mLazyValues = numLazyValues[0]; mParcelledByNative = false; mMap = map; // Set field last as it is volatile Loading core/java/android/os/Parcel.java +5 −7 Original line number Diff line number Diff line Loading @@ -5565,7 +5565,7 @@ public final class Parcel { private void readArrayMapInternal(@NonNull ArrayMap<? super String, Object> outVal, int size, @Nullable ClassLoaderProvider loaderProvider) { readArrayMap(outVal, size, /* sorted */ true, /* lazy */ false, loaderProvider); readArrayMap(outVal, size, /* sorted */ true, /* lazy */ false, loaderProvider, null); } /** Loading @@ -5575,18 +5575,17 @@ public final class Parcel { * @param lazy Whether to populate the map with lazy {@link Function} objects for * length-prefixed values. See {@link Parcel#readLazyValue(ClassLoader)} for more * details. * @return a count of the lazy values in the map * @param lazyValueCount number of lazy values added here * @hide */ int readArrayMap(ArrayMap<? super String, Object> map, int size, boolean sorted, boolean lazy, @Nullable ClassLoaderProvider loaderProvider) { int lazyValues = 0; void readArrayMap(ArrayMap<? super String, Object> map, int size, boolean sorted, boolean lazy, @Nullable ClassLoaderProvider loaderProvider, int[] lazyValueCount) { while (size > 0) { String key = readString(); Object value = (lazy) ? readLazyValue(loaderProvider) : readValue( getClassLoader(loaderProvider)); if (value instanceof LazyValue) { lazyValues++; lazyValueCount[0]++; } if (sorted) { map.append(key, value); Loading @@ -5598,7 +5597,6 @@ public final class Parcel { if (sorted) { map.validate(); } return lazyValues; } /** Loading Loading
core/java/android/os/BaseBundle.java +5 −5 Original line number Diff line number Diff line Loading @@ -480,10 +480,10 @@ public class BaseBundle implements Parcel.ClassLoaderProvider { map.erase(); map.ensureCapacity(count); } int numLazyValues = 0; int[] numLazyValues = new int[]{0}; try { numLazyValues = parcelledData.readArrayMap(map, count, !parcelledByNative, /* lazy */ ownsParcel, this); parcelledData.readArrayMap(map, count, !parcelledByNative, /* lazy */ ownsParcel, this, numLazyValues); } catch (BadParcelableException e) { if (sShouldDefuse) { Log.w(TAG, "Failed to parse Bundle, but defusing quietly", e); Loading @@ -494,14 +494,14 @@ public class BaseBundle implements Parcel.ClassLoaderProvider { } finally { mWeakParcelledData = null; if (ownsParcel) { if (numLazyValues == 0) { if (numLazyValues[0] == 0) { recycleParcel(parcelledData); } else { mWeakParcelledData = new WeakReference<>(parcelledData); } } mLazyValues = numLazyValues; mLazyValues = numLazyValues[0]; mParcelledByNative = false; mMap = map; // Set field last as it is volatile Loading
core/java/android/os/Parcel.java +5 −7 Original line number Diff line number Diff line Loading @@ -5565,7 +5565,7 @@ public final class Parcel { private void readArrayMapInternal(@NonNull ArrayMap<? super String, Object> outVal, int size, @Nullable ClassLoaderProvider loaderProvider) { readArrayMap(outVal, size, /* sorted */ true, /* lazy */ false, loaderProvider); readArrayMap(outVal, size, /* sorted */ true, /* lazy */ false, loaderProvider, null); } /** Loading @@ -5575,18 +5575,17 @@ public final class Parcel { * @param lazy Whether to populate the map with lazy {@link Function} objects for * length-prefixed values. See {@link Parcel#readLazyValue(ClassLoader)} for more * details. * @return a count of the lazy values in the map * @param lazyValueCount number of lazy values added here * @hide */ int readArrayMap(ArrayMap<? super String, Object> map, int size, boolean sorted, boolean lazy, @Nullable ClassLoaderProvider loaderProvider) { int lazyValues = 0; void readArrayMap(ArrayMap<? super String, Object> map, int size, boolean sorted, boolean lazy, @Nullable ClassLoaderProvider loaderProvider, int[] lazyValueCount) { while (size > 0) { String key = readString(); Object value = (lazy) ? readLazyValue(loaderProvider) : readValue( getClassLoader(loaderProvider)); if (value instanceof LazyValue) { lazyValues++; lazyValueCount[0]++; } if (sorted) { map.append(key, value); Loading @@ -5598,7 +5597,6 @@ public final class Parcel { if (sorted) { map.validate(); } return lazyValues; } /** Loading