Synchronize on_ring_buffer_data_callback and writeRingbufferFiles

on_ring_buffer_data_callback callback is invoked on getting the
corresponding driver/firmware ringbuffer logs. This callback further
stores the ringbuffer data locally in cur_buffer. While the data is
getting updated through this callback, writeRingbufferFilesInternal
can get triggered from a different context which accesses the same buffer
-cur_buffer.
Synchronization is missing between these two contexts while accessing the
buffer and this commit attempts the same.

Bug: 153970986
Test: Manual - collect the bugreport and check the ring buffer logs.
Change-Id: Id99a517f4d72872b84b48c3df75dd29743f3e9b2
2 files changed
tree: 69d0b9b11016868c9124d4a652c5cbd7816c79c7
  1. biometrics/
  2. camera/
  3. cryptfshw/
  4. gnss/
  5. light/
  6. livedisplay/
  7. nfc/
  8. power/
  9. powershare/
  10. touch/
  11. trust/
  12. usb/
  13. vibrator/
  14. wifi/
  15. Android.bp
  16. update-makefiles.sh