Fix AeModeAndLock test cases.

Bug: 36103813

Change-Id: Ie2e9938f6ae607f5fced5048c5ff5e41e4f7836b
This commit is contained in:
Yuchen He
2017-05-11 18:49:22 -07:00
parent e048a214a9
commit e256bc9f66

View File

@@ -1139,8 +1139,17 @@ public class StaticMetadata {
}
List<Integer> modeList = new ArrayList<Integer>();
for (int mode : modes) {
modeList.add(mode);
// Skip vendor-added modes
if (mode <= CameraMetadata.CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE) {
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());
// All camera device must support ON
@@ -1227,7 +1236,17 @@ public class StaticMetadata {
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()) {
// Some LEGACY mode devices do not support AF OFF
checkTrueForKey(key, " All camera devices must support OFF mode",
@@ -1417,6 +1436,16 @@ public class StaticMetadata {
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.
* Prioritizes maximizing the min FPS, then the max FPS without lowering min FPS.