Merge changes from topic "OutputConfigurationParcel" into sc-dev am: a0c39535ac
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14925783 Change-Id: I972c2af0f90febf466dc3a9451f90b5b5a40bb71
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -826,13 +825,7 @@ public final class OutputConfiguration implements Parcelable {
|
||||
new Parcelable.Creator<OutputConfiguration>() {
|
||||
@Override
|
||||
public OutputConfiguration createFromParcel(Parcel source) {
|
||||
try {
|
||||
OutputConfiguration outputConfiguration = new OutputConfiguration(source);
|
||||
return outputConfiguration;
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Exception creating OutputConfiguration from parcel", e);
|
||||
return null;
|
||||
}
|
||||
return new OutputConfiguration(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -854,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) {
|
||||
@@ -871,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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -146,13 +146,7 @@ public final class SessionConfiguration implements Parcelable {
|
||||
new Parcelable.Creator<SessionConfiguration> () {
|
||||
@Override
|
||||
public SessionConfiguration createFromParcel(Parcel source) {
|
||||
try {
|
||||
SessionConfiguration sessionConfiguration = new SessionConfiguration(source);
|
||||
return sessionConfiguration;
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Exception creating SessionConfiguration from parcel", e);
|
||||
return null;
|
||||
}
|
||||
return new SessionConfiguration(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,13 +36,7 @@ public final class VendorTagDescriptor implements Parcelable {
|
||||
new Parcelable.Creator<VendorTagDescriptor>() {
|
||||
@Override
|
||||
public VendorTagDescriptor createFromParcel(Parcel source) {
|
||||
try {
|
||||
VendorTagDescriptor vendorDescriptor = new VendorTagDescriptor(source);
|
||||
return vendorDescriptor;
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Exception creating VendorTagDescriptor from parcel", e);
|
||||
return null;
|
||||
}
|
||||
return new VendorTagDescriptor(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,13 +36,7 @@ public final class VendorTagDescriptorCache implements Parcelable {
|
||||
new Parcelable.Creator<VendorTagDescriptorCache>() {
|
||||
@Override
|
||||
public VendorTagDescriptorCache createFromParcel(Parcel source) {
|
||||
try {
|
||||
VendorTagDescriptorCache vendorDescriptorCache = new VendorTagDescriptorCache(source);
|
||||
return vendorDescriptorCache;
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Exception creating VendorTagDescriptorCache from parcel", e);
|
||||
return null;
|
||||
}
|
||||
return new VendorTagDescriptorCache(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user