cameraSensor.options.cameraInfo.set(Camera.CameraInfo.CAMERA_FACING_BACK);
cameraSensor.options.width.set(width);
cameraSensor.options.height.set(height);
cameraSensor.options.previewFpsRangeMin.set(4 * 1000);
cameraSensor.options.previewFpsRangeMax.set(16 * 1000);
<BUG>frame.addSensor(cameraSensor);
CameraChannel cameraProvider = new CameraChannel();

cameraProvider.options.sampleRate.set((double) frameRate);

cameraSensor.addProvider(cameraProvider);
switch (type)</BUG>
{

cameraSensor.options.cameraInfo.set(Camera.CameraInfo.CAMERA_FACING_BACK);
cameraSensor.options.width.set(width);
cameraSensor.options.height.set(height);
cameraSensor.options.previewFpsRangeMin.set(4 * 1000);
cameraSensor.options.previewFpsRangeMax.set(16 * 1000);
CameraChannel cameraChannel = new CameraChannel();
cameraChannel.options.sampleRate.set((double) frameRate);
frame.addSensor(cameraSensor,cameraChannel);
switch (type)
{
