N4 CaptureModule was not wired up properly to close the device when it
closed. There's still an issue that the synchronization is incorrect,
i.e. we don't guarentee close has completed before we open it again.
There's a fix so that we can use OnCameraAvailable listener to only open
the camera when it is available.
Bug:
19332637
Change-Id: Ie88acb3a9f75a5896606dd660c005de0dc82dc3c
}
}, mExecutor);
}
+ callback.onCallback(mState.get());
}
@Override
private static final Log.Tag TAG = new Log.Tag("ModulesInfo");
/** Selects CaptureModule if true, PhotoModule if false. */
- // TODO: DO __NOT__ TURN ON BY DEFAULT FOR NEXUS4
private static final boolean ENABLE_CAPTURE_MODULE = ApiHelper.HAS_CAMERA_2_API
&& (ApiHelper.IS_NEXUS_5 || ApiHelper.IS_NEXUS_6 || ApiHelper.IS_NEXUS_9);
Loggers.tagFactory()));
lifetime.add(imageReader);
+ lifetime.add(device);
List<Surface> outputSurfaces = new ArrayList<>();
outputSurfaces.add(imageReader.getSurface());
// TODO delete frameNumber from FocusStateListener callback. It
// is optional and never actually used.
long frameNumber = -1;
- listener.onFocusStatusUpdate(AutoFocusHelper.stateFromCamera2State(afState),
- frameNumber);
+ if(listener !=null) {
+ listener.onFocusStatusUpdate(AutoFocusHelper.stateFromCamera2State(afState),
+ frameNumber);
+ }
}
});
}