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

Skip to content
Commit c2d11e13 authored by malikakash's avatar malikakash Committed by Akash Malik
Browse files

Use ERROR_CAMERA_DISCONNECTED on id remap

- There are many more advantages to using
  ERROR_DISCONNECTED instead of ERROR_DEVICE.
  - It won't impact app analytics and flag
    unnecessary errors to the app.
  - It's a much more common scenario to get
    disconnected than receing a device error,
    so apps are more likely to handle it -
    disconnect happens when another higher
    priority app wants to use the same camera,
    which can be common among multi-window
    scenarios.
- Previously, we were using ERROR_CAMERA_DEVICE.
  However, if an app tries to immediately reconnect
  on receiving that error, they are often able to
  connect before we have even finished disconnecting.
  This is because we need to release the mServiceLock
  before disconnecting.
- Whereas, the next time an app can call connect() after
  being disconnected() is likely onAvailable(), which is
  only triggered after we have fully disconnected().

Bug: 302145405
Test: Tested locally
Change-Id: I54a19ca71f7126bc46d9f2a3086d75af2e5d87ea
Merged-In: I54a19ca71f7126bc46d9f2a3086d75af2e5d87ea
Merged-In: Ia32babe51a31ef6dc2b9ae4570813396a75b76dc
parent 8bb76cf2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment