From 1cc5cc1ff76b11c85ea33798b1af900fd686181f Mon Sep 17 00:00:00 2001 From: mingwax Date: Tue, 22 Nov 2016 18:26:11 +0800 Subject: SnapdragonCamera: Fix Camera2 FC AlertDialog occur WindowLeaked The dialog occur WindowLeaked when attached the activity is destroyed. Add judgement whether the activity is finishing before show dialog, if true return, false show dialog. CRs-Fixed: 1082314 Change-Id: I28fab4c0253d2524a05e7e18a78d7651bdc9ce4a --- src/com/android/camera/CaptureModule.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index 42f94b6f5..249a17534 100644 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -867,6 +867,9 @@ public class CaptureModule implements CameraModule, PhotoController, @Override public void onConfigureFailed(CameraCaptureSession cameraCaptureSession) { Log.e(TAG, "cameracapturesession - onConfigureFailed "+id); + if (mActivity.isFinishing()) { + return; + } new AlertDialog.Builder(mActivity) .setTitle("Camera Initialization Failed") .setMessage("Closing SnapdragonCamera") -- cgit v1.2.3