Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62de78c2 authored by Danny Baumann's avatar Danny Baumann Committed by Scott Mertz
Browse files

Fix camera usage tracking.

When a Camera object is finalized, it notifies the torch service that
it's no longer using the camera. This call used to not check whether the
caller actually is still using the camera and called release() before,
so depending on timing of the finalizer, it could happen that e.g. the
camera app released the camera user record of the torch app, leading to
the torch usage not being detected on next usage of the camera app.

Fix that by checking whether the caller of onCameraClosed() actually
owned the camera prior to releasing the record.
Also fix synchronization between accesses.

Change-Id: Ic01cbc3c89ab8d855e4613bfa1b2f548de919b73
parent 3dc63a16
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment