0
我有一個Nexus 6P。我正在調查爲什麼OpenCamera已停止在Android N Developer Preview上工作(我不是開發人員,只是一名用戶)。我發現了以下的一段可能導致該問題的代碼:CameraControllerManager2.java:62Android N開發人員預覽:相機支持需要第三個值
我創建了一個新的Android項目,並增加了以下功能:
...
import android.hardware.camera2.CameraAccessException;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CameraManager;
import android.hardware.camera2.CameraMetadata;
...
public class MainActivity extends AppCompatActivity {
private String TAG = "MainActivity";
...
public void test(int cameraId) {
CameraManager manager = (CameraManager)this.getSystemService(Context.CAMERA_SERVICE);
try {
String cameraIdS = manager.getCameraIdList()[cameraId];
CameraCharacteristics characteristics = manager.getCameraCharacteristics(cameraIdS);
int support = characteristics.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL);
Log.d(TAG, "Camera support: " + support);
}
catch (CameraAccessException e) {
e.printStackTrace();
}
}
...
}
調用test(0)
,我的設備上的控制檯輸出:
04-22 15:16:54.263 11578-11578/test.myapplication D/MainActivity: Camera support: 3
當我仰望的support
(docs)的可能值,所以一定要0, 1 or 2,但support
是怎麼走的是VA 3?它應該是一個掩飾或更糟的事情發生?