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
Loading
Please register or sign in to comment