summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/hardware/camera2/params/OutputConfiguration.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/core/java/android/hardware/camera2/params/OutputConfiguration.java b/core/java/android/hardware/camera2/params/OutputConfiguration.java
index 1124b2665457..5bb7201eff65 100644
--- a/core/java/android/hardware/camera2/params/OutputConfiguration.java
+++ b/core/java/android/hardware/camera2/params/OutputConfiguration.java
@@ -735,8 +735,7 @@ public final class OutputConfiguration implements Parcelable {
source.readTypedList(surfaces, Surface.CREATOR);
String physicalCameraId = source.readString();
boolean isMultiResolutionOutput = source.readInt() == 1;
- ArrayList<Integer> sensorPixelModesUsed = new ArrayList<Integer>();
- source.readList(sensorPixelModesUsed, Integer.class.getClassLoader());
+ int[] sensorPixelModesUsed = source.createIntArray();
checkArgumentInRange(rotation, ROTATION_0, ROTATION_270, "Rotation constant");
mSurfaceGroupId = surfaceSetId;
@@ -760,7 +759,7 @@ public final class OutputConfiguration implements Parcelable {
}
mPhysicalCameraId = physicalCameraId;
mIsMultiResolution = isMultiResolutionOutput;
- mSensorPixelModesUsed = sensorPixelModesUsed;
+ mSensorPixelModesUsed = convertIntArrayToIntegerList(sensorPixelModesUsed);
}
/**
@@ -848,6 +847,17 @@ public final class OutputConfiguration implements Parcelable {
return integerArray;
}
+ private static ArrayList<Integer> convertIntArrayToIntegerList(int[] intArray) {
+ ArrayList<Integer> integerList = new ArrayList<Integer>();
+ if (intArray == null) {
+ return integerList;
+ }
+ for (int i = 0; i < intArray.length; i++) {
+ integerList.add(intArray[i]);
+ }
+ return integerList;
+ }
+
@Override
public void writeToParcel(Parcel dest, int flags) {
if (dest == null) {
@@ -865,7 +875,6 @@ public final class OutputConfiguration implements Parcelable {
dest.writeInt(mIsMultiResolution ? 1 : 0);
// writeList doesn't seem to work well with Integer list.
dest.writeIntArray(convertIntegerToIntList(mSensorPixelModesUsed));
- //dest.writeArray(mSensorPixelModesUsed.toArray());
}
/**