Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,11 @@ public ListenableFuture<Void> detachPreviewSurface() {
mExecutor.execute(
() -> {
if (!mIsShutdown) {
setWindowSurface(mAdditionalContext, null);
if (mAdditionalContext != 0) {
setWindowSurface(mAdditionalContext, null);
} else if (DEBUG) {
Log.d(TAG, "!!! mAdditionalContext null during detachPreviewSurface");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the impact of this value being 0? Should this log be at a higher level?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This files a bit weird as far as logging goes. All logs are debug level and the DEBUG flag can only be set at development. This is primarily because liveness doesn't have a logger that can be used.

As far as mAdditionalContext being 0. Its initial value is 0. The value is supposed to be set when attachPreviewSurface is called. It appears that that has failed and the value is never set when the surface is destroyed.

This is an edge case failure by what appears to be a manufacturer/hardware bug based on reports. The liveness challenge is likely to fail because it appears the surface isn't getting set properly. But this should hopefully allow the liveness flow to present an onError failure rather than an app force close.

}
mAdditionalTransformation.mSurfaceSize = null;
}
completer.set(null);
Expand Down