AImage: don't allow ~AImageReader to run before AImages are deleted.
We can never be sure whether ~AImageReader() has run to completion or not in AImage::close(). So we move clean up to another AImageReader method and make sure that's called when in AImageReader_delete. AImage now contains an sp<> to AImageReader so we can be sure that its members wouldn't have been destroyed by ~AImageReader and we can check whether AImageReader_delete has been called on it. This also prevents us from deadlocking since AImage_delete could also cause ~AImageReader to run with AImageReader::mLock held in AImage::close(). Bug: 137571625 Bug: 137694217 Test: enroll; auth Test: cts native AImageReader, camera, graphics tests Merged-In: If5803cb6fcb6f4800032069872daaeac1cd36ed2 Change-Id: If5803cb6fcb6f4800032069872daaeac1cd36ed2 (cherry picked from commit 9e0302fc) Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
Loading
Please register or sign in to comment