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

Commit 3db15193 authored by Shuzhen Wang's avatar Shuzhen Wang
Browse files

Camera: Only call cacheDump for the current camera id

It's not necessary to call cacheDump on all active camera sessions.
We only need to call it for the caller's camera session.

The reason is that:
- The cached dump is cleared by any new `connect` call.
- The to-be closed session will be cached
- The current active session will either be cached when it's
  closed, or not cached which is okay because it will show up
  when dump() is called.

This change has the good side effect of addressing the NPE when 2
cameras are closed together. If 2 cameras are closed around the same
time, one camera's cacheDump could access pointers already deallocated
by the other camera's close call.

Flag: EXEMPT bugfix
Bug: 362645633
Bug: 413128173
Test: Open, close camera, and dumpsys
Change-Id: Ie9b7ba452106fb5f1773e6c65bad58eb311b1320
parent 14e69e69
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