Merge "camera2: Fix parcelling of sensor pixel modes." into sc-dev

This commit is contained in:
TreeHugger Robot
2021-06-02 19:10:53 +00:00
committed by Android (Google) Code Review

View File

@@ -846,6 +846,14 @@ public final class OutputConfiguration implements Parcelable {
return 0; return 0;
} }
private static int[] convertIntegerToIntList(List<Integer> integerList) {
int[] integerArray = new int[integerList.size()];
for (int i = 0; i < integerList.size(); i++) {
integerArray[i] = integerList.get(i);
}
return integerArray;
}
@Override @Override
public void writeToParcel(Parcel dest, int flags) { public void writeToParcel(Parcel dest, int flags) {
if (dest == null) { if (dest == null) {
@@ -861,7 +869,9 @@ public final class OutputConfiguration implements Parcelable {
dest.writeTypedList(mSurfaces); dest.writeTypedList(mSurfaces);
dest.writeString(mPhysicalCameraId); dest.writeString(mPhysicalCameraId);
dest.writeInt(mIsMultiResolution ? 1 : 0); dest.writeInt(mIsMultiResolution ? 1 : 0);
dest.writeList(mSensorPixelModesUsed); // writeList doesn't seem to work well with Integer list.
dest.writeIntArray(convertIntegerToIntList(mSensorPixelModesUsed));
//dest.writeArray(mSensorPixelModesUsed.toArray());
} }
/** /**