高通android9.0 camera API1底层调用为HAL3而非HAL1,若需要调用HAL1的效果,打开摄像头需要按如下方法打开:
try {
Class<?> cameraCalzz = Class.forName("android.hardware.Camera");
Method openLegacy = cameraCalzz.getMethod("openLegacy", int.class, int.class);
camera = (Camera) openLegacy.invoke(null, cameraId, 0x100);//CAMERA_HAL_API_VERSION_1_0 = 0x100
} catch (Exception e) {
e.printStackTrace();
}
具体可参考:https://blog.csdn.net/zhuyong006/article/details/102480557