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

Skip to content
Commit bd096f1e authored by malikakash's avatar malikakash
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: 286287541
Test: Tested locally.
Change-Id: Ia32babe51a31ef6dc2b9ae4570813396a75b76dc
parent 65d20692
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