Loading core/java/android/os/BaseBundle.java +5 −5 Original line number Diff line number Diff line Loading @@ -471,10 +471,10 @@ public class BaseBundle { map.erase(); map.ensureCapacity(count); } int numLazyValues = 0; int[] numLazyValues = new int[]{0}; try { numLazyValues = parcelledData.readArrayMap(map, count, !parcelledByNative, /* lazy */ ownsParcel, mClassLoader); parcelledData.readArrayMap(map, count, !parcelledByNative, /* lazy */ ownsParcel, mClassLoader, numLazyValues); } catch (BadParcelableException e) { if (sShouldDefuse) { Log.w(TAG, "Failed to parse Bundle, but defusing quietly", e); Loading @@ -485,14 +485,14 @@ public class BaseBundle { } 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 @@ -5335,7 +5335,7 @@ public final class Parcel { private void readArrayMapInternal(@NonNull ArrayMap<? super String, Object> outVal, int size, @Nullable ClassLoader loader) { readArrayMap(outVal, size, /* sorted */ true, /* lazy */ false, loader); readArrayMap(outVal, size, /* sorted */ true, /* lazy */ false, loader, null); } /** Loading @@ -5345,17 +5345,16 @@ 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 ClassLoader loader) { int lazyValues = 0; void readArrayMap(ArrayMap<? super String, Object> map, int size, boolean sorted, boolean lazy, @Nullable ClassLoader loader, int[] lazyValueCount) { while (size > 0) { String key = readString(); Object value = (lazy) ? readLazyValue(loader) : readValue(loader); if (value instanceof LazyValue) { lazyValues++; lazyValueCount[0]++; } if (sorted) { map.append(key, value); Loading @@ -5367,7 +5366,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 @@ -471,10 +471,10 @@ public class BaseBundle { map.erase(); map.ensureCapacity(count); } int numLazyValues = 0; int[] numLazyValues = new int[]{0}; try { numLazyValues = parcelledData.readArrayMap(map, count, !parcelledByNative, /* lazy */ ownsParcel, mClassLoader); parcelledData.readArrayMap(map, count, !parcelledByNative, /* lazy */ ownsParcel, mClassLoader, numLazyValues); } catch (BadParcelableException e) { if (sShouldDefuse) { Log.w(TAG, "Failed to parse Bundle, but defusing quietly", e); Loading @@ -485,14 +485,14 @@ public class BaseBundle { } 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 @@ -5335,7 +5335,7 @@ public final class Parcel { private void readArrayMapInternal(@NonNull ArrayMap<? super String, Object> outVal, int size, @Nullable ClassLoader loader) { readArrayMap(outVal, size, /* sorted */ true, /* lazy */ false, loader); readArrayMap(outVal, size, /* sorted */ true, /* lazy */ false, loader, null); } /** Loading @@ -5345,17 +5345,16 @@ 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 ClassLoader loader) { int lazyValues = 0; void readArrayMap(ArrayMap<? super String, Object> map, int size, boolean sorted, boolean lazy, @Nullable ClassLoader loader, int[] lazyValueCount) { while (size > 0) { String key = readString(); Object value = (lazy) ? readLazyValue(loader) : readValue(loader); if (value instanceof LazyValue) { lazyValues++; lazyValueCount[0]++; } if (sorted) { map.append(key, value); Loading @@ -5367,7 +5366,6 @@ public final class Parcel { if (sorted) { map.validate(); } return lazyValues; } /** Loading