Commit Graph

14 Commits

Author SHA1 Message Date
LuK1337 6dc9270fe0 sm8150-common: sensors: Relocate als_correction_service to /system_ext
Change-Id: I866406c174180e54b57ddb021a500d6bd0f3388a
2023-05-03 05:04:42 +02:00
LibXZR 93f86ceace sm8150-common: sensors: Rework screen capture logic
Moving to asynchronous capture listener allows us to fix previous race
on GraphicBuffer and make sure it won't be blocked by any incident e.g.
fence timeout.

Also, guard updateScreenBuffer() with mutex to make sure lastScreenUpdate
can be updated safely.

Extends ThreadPoolMaxThreadCount to 1 because 0 is a confusing value.
Although we set max threads to 0 previously, extra binder thread was
still started according to the warning message in startThreadPool(),
which led to the race noted above as sigaction can also be run on binder
thread.

Also add verbose logging so we can do quick debugging with LOG_NDEBUG=0.

Change-Id: I4733919bc20b3c1b382e60b71c5ceaa10dedaf49
Signed-off-by: LibXZR <i@xzr.moe>
2023-05-03 05:04:42 +02:00
Pranav 487af89e03
sm8150-common: sensors: Switch to ScreenshotClient::captureDisplay
Change-Id: I59057c31b5ce714cbb6abbd574be2d5d9248f4b1
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
2022-03-03 15:25:07 +09:00
LuK1337 e28bfe6156
sm8150-common: sensors: Move to AOSP Soong conditionals
Change-Id: I220357b268053463044e2780ae70dfff3bb5a301
2022-03-03 15:24:54 +09:00
LuK1337 fb250f82ed
sm8150-common: sensors: Bring back naruto light support
Also drop full treble flag as we are no longer
violating Treble SELinux tests.

Change-Id: If6802dc13c3ac56fa2e5cd032f3daad71958bffb
2021-04-03 06:56:29 +05:30
LuK1337 5def802c72
sm8150-common: Import sensors/2.0/multihal
Change-Id: I2615438912974f2f0f57fd96b930d4bd11d0de5b
2021-04-03 06:56:28 +05:30
LuK1337 eb4b31c557
sm8150-common: Import OOS 11 changes
* Redo blobs list based on OnePlus sm8250-common
* Retire lights HAL
* Retire custom sensors HAL for time being
* Reimport rootdir
* Reimport seccomp
* Update audio configs
* Update priv app perms whitelist
* Update properties
* Update sec_config
* Update wifi configs

Change-Id: I2b56f03c1d3e4d0d9693d82e96e8501695ebfd74
2021-04-03 06:53:28 +05:30
Steven Moreland d34a0026cf
sm8150-common: Remove libhwbinder/libhidltransport deps
Since these were combined into libhidlbase.

Bug: 135686713
Test: build only (libhwbinder/libhidltransport are empty)
Change-Id: Iba2cd20b8b20fac3e7564de6b853b475fd4ebd2a
2021-04-03 06:48:10 +05:30
Peter Cai 3c734f274b sm8150-common: sensors: Start service with /dev/binder
* On Android 10, the default binder interface is set according to
  whether the service is system or vendor, whereas on pre-10 every
  service runs on /dev/binder by default. This breaks our service due to
  its dependency on SurfaceFlinger, which is not found on
  /dev/vndbinder.

Change-Id: I15584c40db4d432877994274205d7615565ef33b
2019-10-06 19:59:40 +02:00
Peter Cai c755db349f sm8150-common: sensors: Adapt to libgui changes of Android 10
Change-Id: Id3490e62be999d5d2653e80c25cc2274dc03f03d
2019-10-06 19:59:40 +02:00
Peter Cai 8c8601125f
sm8150-common: sensors: use soong config instead of properties 2019-07-15 12:24:51 +08:00
LuK1337 a7c1c683a9 sm8150-common: sensors: Switch to libgui_vendor
Change-Id: I4ff1fcefb0d3429f0fbbb6e79bdbc3357cbb3c8e
2019-07-07 12:53:46 +02:00
Peter Cai a37dbb2a5a
sm8150-common: sensors: calculate correction for light sensor
* On OnePlus 7 series phones, the light sensor is placed under the
display. This means that light from the display can affect the reading
of the sensor, messing up the auto brightness algorithm.
* This is an attempt to address this by reading the pixel values right
around the sensor, estimate its brightness and substract it from the
original readings. It requires the following properties to be set:

- persist.vendor.sensors.light.location_{x,y}
  The position of the sensor in terms of the coordinates on screen
- persist.vendor.sensors.light.full_white_reading
  The reading of the light sensor when all the pixels around it are
  white and with full brightness

* This also depends on `libgui` from `frameworks/native` to be available
in vendor namespace. The module was already part of VNDK in AOSP, but
it's VNDK-SP which means it is not available to normal vendor HALs. For
now, we can just patch the `Android.bp` of `libgui` to set
`vendor_available: true`.
2019-06-27 14:06:45 +08:00
Peter Cai 9c7485da81
sm8150-common: import sensors multihal
* with a full vendor image, we can modify the sensors hal as we want. We
can replace the reported sensor type directly from HAL, instead of
relying on a framework patch.
2019-06-25 19:17:37 +08:00