Commit graph

712 commits

Author SHA1 Message Date
ripee
875be9a479
Merge pull request #33 from LineageOS/lineage-17.1
Aug 12, 2021
2021-08-13 12:05:31 +02:00
ShevT
8add9d2329 touch: Move device specfic defines to a header
Change-Id: I81dcbea5393cf3426357e659f89ede050cf567fb
2021-08-12 07:44:28 +02:00
Kevin F. Haggerty
2d56e19f2a libril: Build non-inlined android_atomic methods
* All of the libsec-ril*.so libraries reference these symbols, but
  Google finally dropped the non-inlined versions from libcutils with
  Android 8.0. This could be handled with shims in numerous device
  trees, but shim semantics and implementation aren't exactly stable
  and we can handle it more cleanly here in one place.
* See LineageOS/android_system_core@103e8f560

Change-Id: I787372b739f3ace0d9cbbc33e4bffafa6876665e
2021-08-08 01:38:22 +02:00
ripee
b1e6ee4869 RR-ify 2021-02-22 10:19:53 +01:00
Bruno Martins
7346e66642 fastcharge: Make user setting persistent
Change-Id: I4ff051d6f9685e94022eab32035bfe86a65264b8
2021-01-22 21:23:45 +01:00
Francescodario Cuzzocrea
2eef4358aa samsung: hidl: add fastcharge implementation
* On samsung, kernel exposes a sysfs node to disable fastcharge at
   will, depending on what the user sets in battery settings UI.

 * Disabling fast charge may be useful for reducing the heat produced by
   the device while charging, or for extending the lifespan of the battery

 * This commit introduces the fastcharge HIDL, which writes in the node

              /sys/class/sec/switch/afc_disable

   0 or 1 depeding on user selection.
   0 means that fastcharge is enabled, while 1 means that fastcharge is
     disabled

Change-Id: I369ba9c437b3a83a88c2ce74d603b7d7ddd9cfbb
2021-01-22 21:23:34 +01:00
Arian
f0653e7655 samsung: doze: Allow to wake the screen on gestures instead of pulsing
Co-authored-by: Nauval Rizky <enuma.alrizky@gmail.com>
Co-authored-by: Fabian Leutenegger <fabian.leutenegger@bluewin.ch>
Change-Id: I1e74f8eafa51843e77d2d8c514c646a4494327cd
2021-01-13 15:29:13 +01:00
Bruno Martins
c8752ed568 samsung: doze: Drop unnecessary permissions
Maybe it is just a leftover, but these permissions are certainly
not needed for the current doze implementation.

Change-Id: I9bc83eee591e0a8c258a5fa8b8443652729aeaa4
2021-01-13 15:25:14 +01:00
Henrique Silva
63f95addbc samsung: doze: Fix AoD default pref
* Fixes non-working pulse notifications from sensors until user toggles
  the main switch and also sets the proper initial status of the
  AoD preference for the devices that have the feature available.

Signed-off-by: Henrique Silva <jhenrique09.mcz@hotmail.com>
Change-Id: I8e554decca3734b165fdc722d904d90713666db9
2021-01-13 15:25:10 +01:00
Luca Stefani
a8d747939e samsung: doze: Move Utils.checkDozeService in an handler
* There's no need to manually write to the gestures prefs
  as long we are sure the handler is run after we return true
  in the onPreferenceChangeListner

Change-Id: I090c0c6c91267aff69c45365b95b5f5e26d07b07
2021-01-13 15:25:05 +01:00
Luca Stefani
f443a3af8a samsung: doze: Make AOD preference not persistent
Change-Id: I9d80e94de02d35c85765302a01b53020824dd0ff
2021-01-13 15:25:00 +01:00
Bruno Martins
7db026234f samsung: doze: Add AOD support to Ambient Display
* This makes the always on display mode feature visible for those
   devices that explicitly set it as available via AOSP overlay.
   Should only be enabled on devices where the display has been tuned
   to be power efficient in DOZE and/or DOZE_SUSPEND states.

Change-Id: If543936f9421dd7a6c0be594f7cb76afb227e34b
2021-01-13 15:24:55 +01:00
ezio84
af08e80c28 samsung: doze: use ExecutorService for listener registration
Replicate what Google did for SystemUI in this commit.
fabc743bcf

Registering a sensor seems to be an expensive operation,
and we do it on each screen-on event, so moving it to
an asynchronous task looks like a good idea anyway.

By moving all non-essential binder calls of the main thread or to the
next frame, we bring this down to 5ms, such that window animation
and Keyguard animation starts about at the same time.

The interesting part about the ExecutorService:
"Memory consistency effects: Actions in a thread prior to the submission
of a Runnable or Callable task to an ExecutorService happen-before any
actions taken by that task, which in turn happen-before the result is
retrieved via Future.get()."
(from https://developer.android.com/reference/java/util/concurrent/ExecutorService)

Change-Id: I4f37bb9a7dc9d7775d587d4ebd4b6619f3b77e81
2021-01-13 15:24:41 +01:00
Bruno Martins
31c0675e72 samsung: doze: Apply a major refactor
* Introduce a main switch to actually enable/disable doze globally
 * Move preferences handling out of SamsungDozeService class and
   create Utils class to hold all helper methods.

Change-Id: Idb40650296d50352b4a985d2068f14cda6cb4aaf
2021-01-13 15:24:36 +01:00
Bruno Martins
d86ce9428b samsung: doze: Kill proximity wake feature
This will be reworked later on.

Change-Id: I47e2b0a0c7814ac6a0f33e0016d1c52c7afe222b
2021-01-13 15:24:28 +01:00
Francescodario Cuzzocrea
6d6c0500f3 libsecril-client: add support for P libsec-ril.so
* From P onward samsung changed the socket name in libsec-ril.so from
   Multiclient to VND_Multiclient.

 * In order to not break compatibility with older RIL stack guard this
   behind TARGET_USES_VND_SECRIL.

 * This is mostly relevant when using P (or newer) prebuilt ril stack
   coupled with OSS audio hal from hw/samsung, which depends on OSS
   libsecril-client to provide connection to the RIL daemon.

Change-Id: Iab5d07f2301d33216bbdf3e18f844522e32fadce
2020-12-23 17:00:29 +01:00
Kevin F. Haggerty
8f04a50d7c
livedisplay: Set sysfs ownership/perms on init for qcom
* Change I87ec20e3b0c9e9559963bebe7221f51e1dd4d7f3 made assumptions
  that aren't true

Change-Id: I898362c1888ab46afbfad3ecbf8a94a70d2f6fd7
2020-11-01 10:44:53 -07:00
Tim Zimmermann
5cf721c577
power-libperfmgr: move double tap to wake out of setInteractive()
enabling/disabling DT2W inside setInteractive() doesn't work correctly
on some newer samsung devices so enable/disable it only when the setting
has changed and on boot

Change-Id: I3a5d8471e007e5f78c7df8da3cc629fb452e72d9
2020-09-07 14:09:32 +02:00
Francescodario Cuzzocrea
55be8ed074 hidl:thermal: Add README.md and template config
Change-Id: Ie7d3b0bccacb7568cd4523483452eb386d21fc9e
2020-07-23 19:00:17 +02:00
Francescodario Cuzzocrea
01daaa0a6d hidl:thermal: Rebrand to Samsung
Change-Id: I9119f21538c99143a5d0ec810ec1a0a7b43cacc9
2020-07-23 19:00:07 +02:00
Francescodario Cuzzocrea
bd62c30a6c hidl: Import pixel thermal HAL
* imported from https://android.googlesource.com/platform/hardware/google/pixel/+/refs/tags/android-10.0.0_r40
 * commit 2f5b7f6916cde0633e0276c4ff5fe3d1f84d1d21

Change-Id: I032cb6aa43245e974c14fbae5c030a9e11d7b840
2020-07-23 18:57:58 +02:00
Andreas Schneider
7b15efd076 hidl:sensors: Dump sensor information if verbose is turned on
This is useful for improving the sensors HAL.

Change-Id: I41430974b40e14095396aaf645b8b37d08b13710
2020-07-16 17:09:02 +02:00
Andreas Schneider
0b60aa2746 power-libperfmgr: Always wait after changing DOUBLE_TAP_TO_WAKE
This avoids that we enter a screen state where it doesn't react anymore
if you quickly turn off and on the screen.

Change-Id: I8d7fc756d1631e9f739dbe10554b58ba0c0c5576
2020-07-09 09:15:20 +02:00
Andreas Schneider
f53128d8d8 power-libperfmgr: Fix dt2w after boot
Change-Id: Ia6172d2f1a54900b8859eef55f07d37a6eab8487
2020-07-07 08:31:55 +02:00
Jesse Chan
9bb34cb0ae fingerprint: inscreen: remove dimming on Press
Not neccessary for our FOD sensor.

Change-Id: Id35ecfa99e99b12e4662fedbd3b158f57825b53e
2020-07-03 12:50:36 +02:00
Jesse Chan
ec166e56e2 fingerprint: inscreen: enable FOD in TSP in initialization
Samsung enables FOD in TS driver (fod_enable) at all times except
a small number of optical FOD sensor that doesn't have BiometricFeature
.FEATURE_SUPPORT_AOD. As optical type sensor support is not implemented
currently, this HAL is only used on device that has FOD always-on.

This change follows behavior of stock firmware and without toggling of
FOD enable state FOD should be more stable.

Plus it allows setInteractive and config_powerDecoupleInteractiveModeFromDisplay
to function properly with FOD. Currently setInteractive(0) happens before
a onShowFODView (which is the current point to call fod_enable) can be
triggered by the Doze, as TS driver only handles command when it is enabled,
FOD doesn't work when there is a setInteractive(0) that disables TS.

Change-Id: I22291cc62d81ffdaa5edd3f684f9788b0c0650c2
2020-07-03 12:50:36 +02:00
Andreas Schneider
3b4d392992 power-libperfmgr: Correctly implement DT2W support
Change-Id: I9ed6e8886322c787ae69f2f79eb7c9b664ce08d7
2020-07-03 08:24:19 +02:00
Jesse Chan
1d1b2d4b2e power-libperfmgr: add a Power Hint template with common nodes
Change-Id: I12c0e8e33b49f0eeffba43f520272ec76451511f
Signed-off-by: Jesse Chan <jc@lineageos.org>
2020-07-02 09:22:55 +02:00
Jesse Chan
0caf630148 power-libperfmgr: implement Lineage perf profiles
Change-Id: Ia247ee65a668689168be009a59355d97ce4f2cca
2020-07-02 09:22:55 +02:00
Jesse Chan
ac485bae7a power-libperfmgr: add a DOUBLE_TAP_TO_WAKE hint
Change-Id: I656b5eb836fb0c41fed8802efa51cbae9fdbc0c0
2020-07-02 09:22:55 +02:00
Jesse Chan
c59eae188a power-libperfmgr: add a NOT_INTERACTIVE hint for setInteractive
Change-Id: I0797c47e0b1d8bfee644f0028eaabd7650e39913
Signed-off-by: Jesse Chan <jc@lineageos.org>
2020-07-02 09:22:55 +02:00
Jesse Chan
6e68f025eb power-libperfmgr: add an updateHint function for simple hint ops
Change-Id: I2e64f23b5435f7262b36acd52916b5ac795dd106
2020-07-02 09:22:55 +02:00
Jesse Chan
7fad4a5d2c power-libperfmgr: declare override="true" in manifest
Change-Id: If8349ca7b8102c3ffee545d1065d0e7d08d22652
2020-07-02 09:22:55 +02:00
Jesse Chan
2b6ad18415 power-libperfmgr: initialize powerHAL when boot is completed
Change-Id: I801b3aba05ef0be14c7af1969ddf9318c05ef64c
2020-07-02 09:22:55 +02:00
Andreas Schneider
2a8ecf2fc1 power-libperfmgr: Give access to radio group
The LCD and touchscreen nodes are owned by system:radio on Exynos
devices.

Change-Id: I465f68fac9e7a73392940a58ce70f9afacad47b7
2020-07-02 09:21:33 +02:00
Jesse Chan
f834ac2741 power-libperfmgr: remove Google-specific camera and audio hints
Change-Id: I65285ca8c7248bd1e55d3800862e96c00f00effd
2020-07-01 21:40:27 +08:00
Jesse Chan
9e9ba0a5b8 power-libperfmgr: remove Google-specific display LPM control
Change-Id: If58f38b99bf6fbd73f6b6ab2144293c63e18b600
Signed-off-by: Jesse Chan <jc@lineageos.org>
2020-07-01 21:40:27 +08:00
Jesse Chan
5830e772d6 power-libperfmgr: simply wait if idle state node is not present
Change-Id: I93dd97e5437761d2d969f93a5af0cae864fd0a65
Signed-off-by: Jesse Chan <jc@lineageos.org>
2020-07-01 21:40:23 +08:00
Jesse Chan
f1e23cabb6 power-libperfmgr: adapt and rebrand for hardware/samsung
Change-Id: I8aa9a712ac7cbc6085928f7cdb9e6ada8ed5e3fe
2020-06-28 01:41:01 +08:00
Jesse Chan
87f97d145b samsung: hidl: import Pixel libperfmgr Power HAL
hardware/google/pixel/power-libperfmgr from android-10.0.0_r39

Change-Id: I969f76219e6507627d3689b3c2dc025983bcfde4
Signed-off-by: Jesse Chan <jc@lineageos.org>
2020-06-28 01:41:00 +08:00
Andreas Schneider
ccd5c4c52b hidl: Add standard timed_out vibrator service
Change-Id: I48164e9adfa52cd223c5a2925fa3b48417a6e50c
2020-06-09 10:21:40 +02:00
Linux4
cbdc389458 hidl: powershare: add vintf manifest fragment
Change-Id: I7fddba246ce58127192b7cebcaa09da667e33c91
2020-06-09 10:21:05 +02:00
Jesse Chan
33903e1349 fingerprint: inscreen: add vintf manifest fragment
Change-Id: Ie9579e4dea63fd8210f0d3a0a0fa41bd3202d352
2020-06-09 10:20:58 +02:00
Michael Bestas
fb7bd7cc79 Automatic translation import
Change-Id: I7f11df70b63f3b068d9aac0d1e9ef1476f79c029
2020-05-23 18:20:03 +03:00
Jesse Chan
561a3e7edc sensors: set max range of proximity sensor to 1
Samsung's proximity sensor type is binary in nature.
There are only two state: FAR and NEAR.

However, Samsung uses values between min and max for
other purposes like proximity detection during Always-On
Display.

This breaks proximity detection during Doze for AOSP as
AOSP only considers the proximity sensor in FAR state
when the value equals or larger than max.

Thus, this change sets the max to 1 so any > 1 value
would be considered as FAR and the behavior of this vendor
proximity sensor type matches the behavior expected by AOSP.

Change-Id: I56af8e2ae743b47e3c4894e5ef68ce0b54e5cfdb
2020-05-19 11:27:32 +02:00
Jesse Chan
5502112367 fingerprint: inscreen: allow to set_fod_rect at boot
We found that stock firmware calculates the fod rect
from resolution and a set of inscreen fingerprint
sensor position data at boot and then use set_fod_rect
command to tell the Kernel TSP driver.

Then the Kernel TSP driver wrote it to "sponge"
(presumably firmware of touchscreen panel).

It is not yet known what exactly was done with this
data but it is good to keep in line with stock
firmware when we can.

Change-Id: Id44d399a8dc482c7d6f320a3bbfea1282ac4f83a
Signed-off-by: Jesse Chan <jc@lineageos.org>
2020-05-16 17:41:10 +02:00
Jesse Chan
4c9e74f53b fingerprint: inscreen: enable sensor on ShowFODView
Enabling sensor on Press is slow and frequent on/off
switching on Press/Release leads to unexpected results.

Looking into Kernel, the purpose of FOD_ENABLE/FOD_DISABLE
commands are to save battery. (ts->lowpower_mode) It is not
meant to handle fingerprint authentication on Press/Release.

It is expected that FOD is in ENABLED state whenever the user
is EXPECTED to use fingerprint authentication soon.

Thus, this patch moved FOD_ENABLE/FOD_DISABLE from
OnPress/onRelease to onShowFODView/onHideFODView so the
fingerprint authentication can be faster and the logic makes
more sense.

Change-Id: Id94b71acd55038d6eda7a1a89dde5fdf5a1e298f
Signed-off-by: Jesse Chan <jc@lineageos.org>
2020-05-16 17:41:10 +02:00
Andreas Schneider
b8a230d4d0 sensors: get the full list of sensors
Samsung uses a special OperationMode (5555).

Thanks to Pierre-Hugues HUSSON for the hint.

Change-Id: I037ff5bf5a1edd65b616480d1c43cef8e61ba999
Signed-off-by: Jesse Chan <jc@lineageos.org>
2020-05-16 10:30:26 +08:00
Willi Ye
80c90e970e sensors: map Samsung proximity sensor type to generic
Samsung uses their own com.samsung.sensor.physical_proximity
type instead of SENSOR_TYPE_PROXIMITY of Android.

This makes proximity sensor unavailable for us as we only
look for SENSOR_TYPE_PROXIMITY.

Thus, this change maps Samsung's vendor-specific proximity
sensor type to generic one.

Change-Id: I64f6558876e1398dfbea0e5c0eb76aa1aafd2dfd
Signed-off-by: Jesse Chan <jc@lineageos.org>
2020-05-15 22:15:57 +08:00
Willi Ye
834dfaa39b sensors: get rid of com.samsung.permission.SSENSOR
Samsung uses a permission com.samsung.permission.SSENSOR
for Samsung-specfic sensors. Android obviously does not
have that and the default is denied when there is no
permission. As such, those sensors are inaccessible.

Thus, this change removes this permission from those sensors
so we can use them.

Android does not require special permissions for most sensors
so this change doesn't attach additional permission requirements
to those sensors.

However, note that it is possible that some sensitive sensors
introduced by Samsung in the future may use SSENSOR permission
and for privacy reasons they should be handled separately with
appropriate permission control attached.

Change-Id: Ia3033898722039b285e522e226074238508f6093
Signed-off-by: Jesse Chan <jc@lineageos.org>
2020-05-15 22:06:48 +08:00