OSDN Git Service

Make sure to null SurfaceTexture when destroyed.
authorSascha Haeberling <haeberling@google.com>
Thu, 5 Feb 2015 02:39:23 +0000 (18:39 -0800)
committerSascha Haeberling <haeberling@google.com>
Thu, 5 Feb 2015 02:39:23 +0000 (18:39 -0800)
commit82a5c17b22c8b29ee1b601d362a3742de75fece7
tree690374485847dd8bb1c4d3cb92deb39d9c623406
parent27d31d88e64a2075c87bb6f3969bdd99cd9ceaea
Make sure to null SurfaceTexture when destroyed.

  Bug: 19149830

This will prevent unnecessary camera open events. We assume that when a
SurfaceTexture is present at the time we resume, that it is usable and
we can initialize the camera. Not nulling it causes the camera to be
initialized on a potentially invalid Surface. Once the Surface becomes
available, we'd close and re-open the camera, which slows down our
resume times.

By nulling the SurfaceTexture when it gets destroyed we make sure to not
initialize the camera in resume an instead wait for the proper callback.

This might get rid of the HDR+ resume issue we've been seeing as well.

Change-Id: I71837aeda79c2f7516e64bdb10c12d39f728c0ca
src/com/android/camera/CaptureModule.java