Merge "Camera: Avoid possible NPE after extension session configuration"

This commit is contained in:
Treehugger Robot
2023-02-14 17:19:51 +00:00
committed by Gerrit Code Review

View File

@@ -528,8 +528,15 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes
boolean status = true;
synchronized (mInterfaceLock) {
try {
mSessionProcessor.onCaptureSessionStart(mRequestProcessor);
mInitialized = true;
if (mSessionProcessor != null) {
mSessionProcessor.onCaptureSessionStart(mRequestProcessor);
mInitialized = true;
} else {
Log.v(TAG, "Failed to start capture session, session released before " +
"extension start!");
status = false;
mCaptureSession.close();
}
} catch (RemoteException e) {
Log.e(TAG, "Failed to start capture session,"
+ " extension service does not respond!");