Merge "Fix AeModeAndLock test cases. Bug: 36103813" into oc-dev

am: 3671e9249b

Change-Id: I2ebc01dc54f654d60e03696490c681a656a7b958
This commit is contained in:
Yuchen He
2017-06-08 04:38:16 +00:00
committed by android-build-merger

View File

@@ -1139,8 +1139,17 @@ public class StaticMetadata {
} }
List<Integer> modeList = new ArrayList<Integer>(); List<Integer> modeList = new ArrayList<Integer>();
for (int mode : modes) { for (int mode : modes) {
// Skip vendor-added modes
if (mode <= CameraMetadata.CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE) {
modeList.add(mode); modeList.add(mode);
} }
}
checkTrueForKey(modesKey, "value is empty", !modeList.isEmpty());
modes = new int[modeList.size()];
for (int i = 0; i < modeList.size(); i++) {
modes[i] = modeList.get(i);
}
checkTrueForKey(modesKey, "value is empty", !modeList.isEmpty()); checkTrueForKey(modesKey, "value is empty", !modeList.isEmpty());
// All camera device must support ON // All camera device must support ON
@@ -1227,7 +1236,17 @@ public class StaticMetadata {
return new int[0]; return new int[0];
} }
List<Integer> modesList = Arrays.asList(CameraTestUtils.toObject(afModes)); List<Integer> modesList = new ArrayList<Integer>();
for (int afMode : afModes) {
// Skip vendor-added AF modes
if (afMode > CameraCharacteristics.CONTROL_AF_MODE_EDOF) continue;
modesList.add(afMode);
}
afModes = new int[modesList.size()];
for (int i = 0; i < modesList.size(); i++) {
afModes[i] = modesList.get(i);
}
if (isHardwareLevelLimitedOrBetter()) { if (isHardwareLevelLimitedOrBetter()) {
// Some LEGACY mode devices do not support AF OFF // Some LEGACY mode devices do not support AF OFF
checkTrueForKey(key, " All camera devices must support OFF mode", checkTrueForKey(key, " All camera devices must support OFF mode",
@@ -1417,6 +1436,16 @@ public class StaticMetadata {
return fpsRanges; return fpsRanges;
} }
public static String getAeModeName(int aeMode) {
return (aeMode >= AE_MODE_NAMES.length) ? String.format("VENDOR_AE_MODE_%d", aeMode) :
AE_MODE_NAMES[aeMode];
}
public static String getAfModeName(int afMode) {
return (afMode >= AF_MODE_NAMES.length) ? String.format("VENDOR_AF_MODE_%d", afMode) :
AF_MODE_NAMES[afMode];
}
/** /**
* Get the highest supported target FPS range. * Get the highest supported target FPS range.
* Prioritizes maximizing the min FPS, then the max FPS without lowering min FPS. * Prioritizes maximizing the min FPS, then the max FPS without lowering min FPS.