GitHub/LineageOS/android_hardware_samsung.git
2 years agosamsung: Remove call to unexisting makefile
Bruno Martins [Thu, 13 Jan 2022 20:56:37 +0000 (20:56 +0000)]
samsung: Remove call to unexisting makefile

This got removed in commit 211de19.

Change-Id: I239bb58f981cfb9d74b08650c8b6986f815189f7

2 years agoaidl: light: Use pragma once
Bruno Martins [Thu, 13 Jan 2022 20:04:02 +0000 (20:04 +0000)]
aidl: light: Use pragma once

Change-Id: I517d22da79659803c1271f79cb089710efbeba2f

2 years agoaidl: Remove unused makefile
Bruno Martins [Thu, 13 Jan 2022 20:00:26 +0000 (20:00 +0000)]
aidl: Remove unused makefile

Change-Id: I19514a76be9d0f415cbbdca289a47324c765dc61

2 years agosamsung: add secril_config_svc
Tim Zimmermann [Sat, 4 Dec 2021 05:40:16 +0000 (06:40 +0100)]
samsung: add secril_config_svc

* Used for loading multisim related props from EFS

Change-Id: I9db6244cf3396eee8c13a5a58941c35a33fca412

2 years agofingerprint: implement gestures
Tim Zimmermann [Mon, 29 Nov 2021 19:51:07 +0000 (20:51 +0100)]
fingerprint: implement gestures

Change-Id: I66dfe09e569fcaea295649cce69350f4d4003eb4

2 years agofingerprint: implement ss_fingerprint_request
Jesse Chan [Mon, 29 Jun 2020 16:46:14 +0000 (00:46 +0800)]
fingerprint: implement ss_fingerprint_request

Change-Id: I8f2936a48a318889b4e5d66fe21ca93e7c4c4a5c
Signed-off-by: Jesse Chan <jc@lineageos.org>
2 years agoaidl: vibrator: improve amplitude values
Tim Zimmermann [Tue, 23 Nov 2021 20:50:14 +0000 (21:50 +0100)]
aidl: vibrator: improve amplitude values

Change-Id: Ic1c08841e00a927c138663880f4e6361e59453bd

2 years agosamsung: vibrator: convert to AIDL implementation
Tim Zimmermann [Tue, 23 Nov 2021 19:45:19 +0000 (20:45 +0100)]
samsung: vibrator: convert to AIDL implementation

Change-Id: I785178a05d323a02b557cdd6fc22db49eb952df0

2 years agosamsung: light: convert to AIDL implementation
Tim Zimmermann [Wed, 24 Nov 2021 16:27:06 +0000 (17:27 +0100)]
samsung: light: convert to AIDL implementation

Change-Id: Id3860ca6e84ea77766322cbd43239e9cebecbc73

2 years agohidl: fingerprint: Uprev to 2.3
TheScarastic [Sat, 30 Oct 2021 06:30:42 +0000 (08:30 +0200)]
hidl: fingerprint: Uprev to 2.3

 * Move fingerprint HIDL to 2.3
 * Remove Lineage FOD HIDL

[Linux4: Autodetect if fingerprint is udfps]

Change-Id: I8c628d2ee9158b45eeb04dd324b56ef3697296b7

2 years ago[thermal] Use new jsoncpp API
Haibo Huang [Thu, 25 Feb 2021 19:10:04 +0000 (11:10 -0800)]
[thermal] Use new jsoncpp API

Reader / StyledWriter are deprecated upstream

Bug: 170642246
Change-Id: Ib46040b61ed2701ea4881a0c0a306685a15b51a4

2 years agoaidl: power: Remove Lineage perf profiles remnants
Michael Benedict [Thu, 13 Jan 2022 18:09:21 +0000 (01:09 +0700)]
aidl: power: Remove Lineage perf profiles remnants

Change-Id: Id57c582c1d3619d1231890f5a20f1c899a6a6a67

2 years agoSpecify version for aidl_interface explicitly
Jeongik Cha [Mon, 15 Feb 2021 08:48:31 +0000 (17:48 +0900)]
Specify version for aidl_interface explicitly

Bug: 150578172
Test: m
Change-Id: I9714cd4416fe0ce23e57cd7db162bfb45b0f84d5

2 years agopower: add a property for config file
Wei Wang [Fri, 13 Nov 2020 18:59:00 +0000 (10:59 -0800)]
power: add a property for config file

Test: build
Bug: 173222103
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: I14e7e0aa349e446f6889cbfc9a914f5314438e6b

2 years agoaidl: power: Drop Lineage perf profiles support
Bruno Martins [Thu, 13 Jan 2022 15:22:48 +0000 (15:22 +0000)]
aidl: power: Drop Lineage perf profiles support

Change-Id: Iea27471971d679733b688794dbbe1edcb86746e0

2 years agoPower: advertise power headers are deprecated
Wei Wang [Thu, 22 Oct 2020 23:21:39 +0000 (16:21 -0700)]
Power: advertise power headers are deprecated

Test: Build
Bug: 169065024
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: I3cef3aff4bb2394571a3de13e535283722c308ed

2 years agoPower: add support for devices without display idle signals
Wei Wang [Wed, 21 Oct 2020 19:15:30 +0000 (12:15 -0700)]
Power: add support for devices without display idle signals

To workaround b/141025174, adding support for devices without display
idle signals. Also added a property to override idle display function.

Besides the idle signal support, this CL also makes touch boost duration
tunable through several new vendor properties. It also named display
idle monitor thread and cleans out the obsolete HIDL Power HAL
implementation.

Bug: 168080943
Bug: 169065024
Bug: 171494137
Test: Boot and trace
Change-Id: I76067d10958654d539624ec4cac8f346103e67bc

2 years agoRevert "power-libperfmgr: simply wait if idle state node is not present"
Arian [Wed, 13 Oct 2021 10:44:09 +0000 (12:44 +0200)]
Revert "power-libperfmgr: simply wait if idle state node is not present"

This reverts commit 297888275a44b3ce0e75fb1b50bea5108fc67459.

Change-Id: Iefee44a1f407729e76cb693832bad4998141c42b

2 years agohidl: power: Kill legacy and libperfmgr power implementations
LuK1337 [Sat, 16 Oct 2021 23:21:51 +0000 (01:21 +0200)]
hidl: power: Kill legacy and libperfmgr power implementations

Everyone must switch to aidl now.

Change-Id: I9e812bf3f13dcdf40650c23dee3d5f33ad8fc79d

3 years agohidl: LiveDisplay: init: correct config mkdir location for system builds
synt4x93 [Sat, 18 Sep 2021 15:59:36 +0000 (16:59 +0100)]
hidl: LiveDisplay: init: correct config mkdir location for system builds

Change-Id: Id46c6b142bbb09943ba61f1cf9421c84c7bf51e6

3 years agohidl: LiveDisplay: DisplayModes: support system builds
synt4x93 [Thu, 16 Sep 2021 23:05:52 +0000 (00:05 +0100)]
hidl: LiveDisplay: DisplayModes: support system builds

Change-Id: I795714efeac1770671ff690fac90cde147b26394

3 years agolibril: initialise RIL_CallForwardInfo to 0 when requesting status
Danny Wood [Fri, 10 Sep 2021 14:15:05 +0000 (15:15 +0100)]
libril: initialise RIL_CallForwardInfo to 0 when requesting status

Some devices have extra pointers in this structure that if non-zero
causes libsec-ril.so to segfault

Change-Id: I9fd07a4747ef0fb1388ebbec472f2dda8dea4003

3 years agotouch: Move device specfic defines to a header
ShevT [Thu, 5 Aug 2021 10:30:59 +0000 (13:30 +0300)]
touch: Move device specfic defines to a header

Change-Id: I81dcbea5393cf3426357e659f89ede050cf567fb

3 years agoaidl: power-libperfmgr: Make powerhint.json.template pass tests
LuK1337 [Tue, 25 May 2021 23:21:00 +0000 (01:21 +0200)]
aidl: power-libperfmgr: Make powerhint.json.template pass tests

Test: ./perfmgr_config_verifier -c powerhint.json.template
Change-Id: Ib137b46257cd84687a8ded0cf94424b6c353943e

3 years agosamsung: fastcharge: chown sysfs node on init
Jan Altensen [Tue, 4 May 2021 00:24:03 +0000 (02:24 +0200)]
samsung: fastcharge: chown sysfs node on init

Change-Id: I04d04b89534293cda68fe2499b9dca4fe962c804

3 years agosamsung: add nfc to gitignore
Jan Altensen [Sat, 24 Apr 2021 17:13:21 +0000 (19:13 +0200)]
samsung: add nfc to gitignore

Change-Id: Ic797a5aceb15d32a2e1aab1ba5ad6ccb48aca1d7

3 years agoRevert "Revert "aidl: power-libperfmgr: Re-implement lineage perf hint""
David Marble [Mon, 22 Mar 2021 04:40:14 +0000 (05:40 +0100)]
Revert "Revert "aidl: power-libperfmgr: Re-implement lineage perf hint""

This reverts commit 03a61ae886e05cda81fe0da76354aab4258ecbe6.

Reason for revert: r-perf-profiles has been merged.

Change-Id: I8e5cef59d03d7f6e571d6677f40b6a730120971c

3 years agoRevert "aidl: power-libperfmgr: Re-implement lineage perf hint"
Michael Benedict [Sat, 20 Mar 2021 18:50:06 +0000 (01:50 +0700)]
Revert "aidl: power-libperfmgr: Re-implement lineage perf hint"

* The patch was merged pre-maturely before r-perf-profiles topic got merged. Lets wait properly this time and be patient.

This reverts commit c50258fca0d28826c91e661653017f67aa3e05b3.

Change-Id: I60129f3886b9ab570a3d19b1e4cef9084ab87533

3 years agoaidl: power-libperfmgr: Re-implement lineage perf hint
Michael Benedict [Fri, 5 Mar 2021 06:21:54 +0000 (13:21 +0700)]
aidl: power-libperfmgr: Re-implement lineage perf hint

Signed-off-by: Michael Benedict <michaelbt@live.com>
Co-authored-by: Jesse Chan <jc@lineageos.org>
Co-authored-by: dianlujitao <dianlujitao@lineageos.org>
Co-authored-by: Tim Zimmermann <tim@linux4.de>
Change-Id: I14fde0fee5a0294a8f546746a3eb29b2974a8fe7

3 years agoaidl: power-libperfmgr: Sync powerhint template with aidl hal changes
Michael Benedict [Sun, 14 Mar 2021 07:14:50 +0000 (14:14 +0700)]
aidl: power-libperfmgr: Sync powerhint template with aidl hal changes

* adapted from https://github.com/LineageOS/android_device_google_coral/commit/3e0c3f06a77bd6cfcca57a51b1159f9b77b28c3b

Signed-off-by: Michael Benedict <michaelbt@live.com>
Change-Id: Ib97ea5b007dc5e0e650938785218aeb365d358ff

3 years agoaidl: power-libperfmgr: Re-implement interactive and DT2W hints
Michael Benedict [Sun, 14 Mar 2021 05:19:23 +0000 (12:19 +0700)]
aidl: power-libperfmgr: Re-implement interactive and DT2W hints

* also change NOT_INTERACTIVE to INTERACTIVE so it can be used with
fallthrough

Signed-off-by: Michael Benedict <michaelbt@live.com>
Change-Id: I1af27d2503b98bd873c8fe84a1028cd46e7a4a53

3 years agoaidl: power-libperfmgr: Squash some of previous hidl power-libperfmgr commits
Michael Benedict [Sun, 14 Mar 2021 05:13:43 +0000 (12:13 +0700)]
aidl: power-libperfmgr: Squash some of previous hidl power-libperfmgr commits

These commits are adapted for aidl counterpart.
power-libperfmgr: adapt and rebrand for hardware/samsung
power-libperfmgr: simply wait if idle state node is not present
power-libperfmgr: remove Google-specific display LPM control
power-libperfmgr: remove Google-specific camera and audio hints
power-libperfmgr: Give access to radio group
power-libperfmgr: initialize powerHAL when boot is completed
power-libperfmgr: declare override="true" in manifest
power-libperfmgr: add a Power Hint template with common nodes

Notes:
* Interactive, DT2W, and Lineage perf hint will be re-implemented outside of this commit.

Signed-off-by: Michael Benedict <michaelbt@live.com>
Co-authored-by: Jesse Chan <jc@lineageos.org>
Change-Id: I7034cb083bd20ec3a62ec338f5cbfb3e3ba7a0ff

3 years agosamsung: aidl: Import Pixel Power HAL aidl impl
Michael Benedict [Sun, 27 Dec 2020 09:45:17 +0000 (16:45 +0700)]
samsung: aidl: Import Pixel Power HAL aidl impl

* from tag android-11.0.0_r18

Signed-off-by: Michael Benedict <michaelbt@live.com>
Change-Id: Ic1408f7d68463379514b62ef2f811bd1102467e1

3 years agosensors: 2.1: Squash previous sensors commits
Willi Ye [Tue, 19 Jan 2021 19:08:25 +0000 (20:08 +0100)]
sensors: 2.1: Squash previous sensors commits

sensors: 2.1: 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

sensors: 2.1: 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

sensors: 2.1: 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

hidl:sensors: 2.1 Dump sensor information if verbose is turned on

This is useful for improving the sensors HAL.

Change-Id: I41430974b40e14095396aaf645b8b37d08b13710

sensors: 2.1: declare override="true" in manifest

Change-Id: If8349ca7b8102c3ffee545d1065d0e7d08d22652

3 years agosensors: 2.1: rename to samsung-multihal
josip-k [Sat, 16 Jan 2021 16:02:17 +0000 (17:02 +0100)]
sensors: 2.1: rename to samsung-multihal

Signed-off-by: josip-k <d3hum4niz3d@gmail.com>
Change-Id: Idfc6be9cd54dba45fc23ae0078fa08c8f9e5805f

3 years agosensors: 2.1: import HalProxy* sources
josip-k [Sat, 16 Jan 2021 15:51:38 +0000 (16:51 +0100)]
sensors: 2.1: import HalProxy* sources

    * hardware/interfaces/sensors/common/default/2.X/multihal/HalProxy*
    from android-11.0.0_r27

Signed-off-by: josip-k <d3hum4niz3d@gmail.com>
Change-Id: I8911af77b8aafa20dd4657918192059a706d33c1

3 years agosamsung: hidl: import default sensors 2.1 multihal
josip-k [Tue, 19 Jan 2021 18:35:43 +0000 (19:35 +0100)]
samsung: hidl: import default sensors 2.1 multihal

    * hardware/interfaces/sensors/2.1/multihal from android-11.0.0_r27

Signed-off-by: josip-k <d3hum4niz3d@gmail.com>
Change-Id: I253755c6a46873c04b65d4c14fea65e3c5308f0b

3 years agosamsung: sensors: move sensors HAL 1.0 impl to versioned subdir
josip-k [Sat, 16 Jan 2021 15:38:28 +0000 (16:38 +0100)]
samsung: sensors: move sensors HAL 1.0 impl to versioned subdir

    * Newer samsung devices require 2.X implementation of the sensor
    HAL, in order to avoid issues with importing 2.X service to existing
    directory, move each to its subdir

Signed-off-by: josip-k <d3hum4niz3d@gmail.com>
Change-Id: If6fc05c166ba488e0be90ec59c9c79ac29c92d79

3 years agosamsung: doze: Use all shared resources from devicesettings
Bruno Martins [Wed, 6 Jan 2021 20:51:54 +0000 (20:51 +0000)]
samsung: doze: Use all shared resources from devicesettings

Change-Id: Icd7f381c574ea36eb4d797cefd60ba9f1a0941bd

3 years agosamsung: AdvancedDisplay: Use all shared resources from devicesettings
Bruno Martins [Wed, 6 Jan 2021 20:51:54 +0000 (20:51 +0000)]
samsung: AdvancedDisplay: Use all shared resources from devicesettings

Orig-Change-Id: Icd7f381c574ea36eb4d797cefd60ba9f1a0941bd
Change-Id: I8171db59a5841e4d1f50263ace9092f986edc971

3 years agosamsung: AdvancedDisplay: Migrate to androidx
Jan Altensen [Sat, 7 Sep 2019 19:10:20 +0000 (21:10 +0200)]
samsung: AdvancedDisplay: Migrate to androidx

Change-Id: I9f6f936120e6eac06c78525f3692207ff58c991f

3 years agofastcharge: Make user setting persistent
Bruno Martins [Mon, 18 Jan 2021 22:31:07 +0000 (22:31 +0000)]
fastcharge: Make user setting persistent

Change-Id: I4ff051d6f9685e94022eab32035bfe86a65264b8

3 years agofastcharge: drop libhwbinder/libhidltransport dependency
Jan Altensen [Thu, 10 Sep 2020 21:39:19 +0000 (23:39 +0200)]
fastcharge: drop libhwbinder/libhidltransport dependency

Change-Id: I1405348bcdfb63d2234d6dfa4af6e03a319d33f7

3 years agosamsung: hidl: add fastcharge implementation
Francescodario Cuzzocrea [Thu, 24 Dec 2020 15:00:30 +0000 (16:00 +0100)]
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

3 years agosamsung: doze: Allow to wake the screen on gestures instead of pulsing
Arian [Wed, 14 Oct 2020 21:06:47 +0000 (23:06 +0200)]
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

3 years agosamsung: doze: Drop unnecessary permissions
Bruno Martins [Sat, 26 Dec 2020 20:23:49 +0000 (20:23 +0000)]
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

3 years agosamsung: doze: Fix AoD default pref
Henrique Silva [Thu, 17 Jan 2019 23:40:14 +0000 (21:40 -0200)]
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

3 years agosamsung: doze: Move Utils.checkDozeService in an handler
Luca Stefani [Tue, 8 Jan 2019 13:56:52 +0000 (14:56 +0100)]
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

3 years agosamsung: doze: Make AOD preference not persistent
Luca Stefani [Tue, 8 Jan 2019 14:15:43 +0000 (15:15 +0100)]
samsung: doze: Make AOD preference not persistent

Change-Id: I9d80e94de02d35c85765302a01b53020824dd0ff

3 years agosamsung: doze: Add AOD support to Ambient Display
Bruno Martins [Tue, 1 Jan 2019 12:39:38 +0000 (12:39 +0000)]
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

3 years agosamsung: doze: use ExecutorService for listener registration
ezio84 [Thu, 14 Jun 2018 13:00:19 +0000 (15:00 +0200)]
samsung: doze: use ExecutorService for listener registration

Replicate what Google did for SystemUI in this commit.
https://github.com/aosp-mirror/platform_frameworks_base/commit/fabc743bcf6e6623e530545c4b31285ea642f087

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

3 years agosamsung: doze: Apply a major refactor
Bruno Martins [Sat, 26 Dec 2020 14:55:22 +0000 (14:55 +0000)]
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

3 years agosamsung: doze: Kill proximity wake feature
Bruno Martins [Sat, 26 Dec 2020 17:02:30 +0000 (17:02 +0000)]
samsung: doze: Kill proximity wake feature

This will be reworked later on.

Change-Id: I47e2b0a0c7814ac6a0f33e0016d1c52c7afe222b

3 years agomacloader: Add 2 more semco mac ranges
Ataberk Özen [Sun, 10 Jan 2021 20:19:43 +0000 (21:19 +0100)]
macloader: Add 2 more semco mac ranges

* Found in Samsung Galaxy J4+ and J6+
* Confirmed with https://www.wireshark.org/tools/oui-lookup.html
 70:FD:46 Samsung Electronics Co.,Ltd
 D0:7F:A0 Samsung Electronics Co.,Ltd

Change-Id: Ic067e92b70143b23d15d41d5d40f483aeed19770

3 years agolibsecril-client: add support for P libsec-ril.so
Francescodario Cuzzocrea [Mon, 23 Nov 2020 20:52:33 +0000 (21:52 +0100)]
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
(cherry picked from commit 6d6c0500f3139f84163eefefc8e19dcc934ef26a)

3 years agothermal: add sensor logging in thermalWatcherCallbackFunc
TeYuan Wang [Wed, 18 Mar 2020 14:12:16 +0000 (22:12 +0800)]
thermal: add sensor logging in thermalWatcherCallbackFunc

Bug: 151818536
Test: Log can be printed as below:
      I/android.hardware.thermal@2.0-service.pixel(  889): skin-therm-monitor: 50

Change-Id: Iefd24ff48ead9c2da55640742abcb158e9b181c2
Signed-off-by: TeYuan Wang <kamewang@google.com>
3 years agothermal: remove redundant cdev_to_watch registration
TeYuan Wang [Thu, 19 Mar 2020 13:24:00 +0000 (21:24 +0800)]
thermal: remove redundant cdev_to_watch registration

cdev_to_watch fd causes pollOnce function return immediatly.
Because thermalhal does not monitor cdev status now,
so remove cdev_to_watch fd to avoid threadLoop busy problem.

Bug: 151897840
Test: Verified thermalhal notifythrottling via emul_temp
      thermalhal will not keep busy.
Change-Id: I999c9b843dde5870d83d8305d5517196188fa819
Signed-off-by: TeYuan Wang <kamewang@google.com>
3 years agothermal: Fix bugprone-use-after-move.
Josh Gao [Wed, 18 Mar 2020 02:27:13 +0000 (19:27 -0700)]
thermal: Fix bugprone-use-after-move.

fd was moved out of, so we were adding -1 to the looper.

Bug: http://b/150783499
Test: treehugger

(cherry picked from commit 56ed76601d2fa5f1a1e6f7f24d79975a69f43a39)

Change-Id: Ib571f32078fd9adb91a1e619110330583b75482b

3 years agothermal: Optimize uevent monitor timeout mechanism
TeYuan Wang [Mon, 9 Mar 2020 11:17:56 +0000 (19:17 +0800)]
thermal: Optimize uevent monitor timeout mechanism

If non-thermal uevents keep triggered, thermalhal will
not hit uevent timeout to update temperature.

Bug: 138257706
Test: pts-tradefed run pts -m PtsThermalHalTestCases

Change-Id: I8470b95f34ff3867e1a9c677e3712d8c8deb3a3c
Signed-off-by: TeYuan Wang <kamewang@google.com>
3 years agothermal: Add thermal logging daemon
Wei Wang [Wed, 20 Nov 2019 20:00:21 +0000 (12:00 -0800)]
thermal: Add thermal logging daemon

Bug: 126562025
Bug: 144859663
Test: build and check thermal logging
Change-Id: I996546110f4d66b3ff8052cb46000fe0e5f7b0da

3 years agothermal: Adds missing interface for vendor.thermal-hal-2-0.
Daniel Norman [Wed, 10 Jul 2019 21:21:52 +0000 (14:21 -0700)]
thermal: Adds missing interface for vendor.thermal-hal-2-0.

init_rc files require the entire interface inheritance hierarchy to
be listed, since e.g. all 1.0::IThermal functions are also implemented
by 2.0::IThermal.

Bug: 118016875
Test: builds & passes existing tests.
Merged-In: I3fe1bc5e103fc3dd631f5dabc3408803dbdcbd60
Change-Id: I3fe1bc5e103fc3dd631f5dabc3408803dbdcbd60

4 years agolivedisplay: Set sysfs ownership/perms on init for qcom lineage-18.0
Kevin F. Haggerty [Sun, 1 Nov 2020 17:36:32 +0000 (10:36 -0700)]
livedisplay: Set sysfs ownership/perms on init for qcom

* Change I87ec20e3b0c9e9559963bebe7221f51e1dd4d7f3 made assumptions
  that aren't true

Change-Id: I898362c1888ab46afbfad3ecbf8a94a70d2f6fd7
(cherry picked from commit 8f04a50d7cb945deb9da5920948f1eef8ab88857)

4 years agosamsung: convert dtbhtoolExynos to blueprint
Jan Altensen [Thu, 10 Sep 2020 22:08:00 +0000 (00:08 +0200)]
samsung: convert dtbhtoolExynos to blueprint

Change-Id: I0f9aff67e76ac47f792e92fca4802b50f893d37c

4 years agosamsung: mkbootimg: remove recovery.id generation
Jan Altensen [Mon, 21 Sep 2020 20:07:01 +0000 (22:07 +0200)]
samsung: mkbootimg: remove recovery.id generation

 * this is not a thing anymore

Change-Id: I5eddbf4ddc2dcd0becf22b295e0a880d34446ac7

4 years agolibril: Remove unused includes.
Elliott Hughes [Thu, 8 Aug 2019 16:54:29 +0000 (09:54 -0700)]
libril: Remove unused includes.

Test: treehugger
Change-Id: Id6ee53aa0e2a83ef40ce9219092f8a0f519b3471

4 years agoloki_tool: convert to blueprint
Jan Altensen [Fri, 11 Sep 2020 11:16:32 +0000 (13:16 +0200)]
loki_tool: convert to blueprint

Change-Id: Id35492c9f671c265d4b637eb4d536e812f48282b

4 years agosamsung: drop libhwbinder/libhidltransport dependency
Jan Altensen [Thu, 10 Sep 2020 21:39:19 +0000 (23:39 +0200)]
samsung: drop libhwbinder/libhidltransport dependency

Change-Id: Iaa0232ba6ab8235454340416b0995994c908a2ee

4 years agopower-libperfmgr: import hardware/google/pixel namespace
Jan Altensen [Thu, 10 Sep 2020 21:36:41 +0000 (23:36 +0200)]
power-libperfmgr: import hardware/google/pixel namespace

Change-Id: Ic8a339f082d965d412cb3c3a4af7ecd726d2de32

4 years agopower-libperfmgr: move double tap to wake out of setInteractive()
Tim Zimmermann [Mon, 7 Sep 2020 11:07:43 +0000 (13:07 +0200)]
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

4 years agohidl:thermal: Add README.md and template config
Francescodario Cuzzocrea [Sun, 19 Jul 2020 17:48:12 +0000 (19:48 +0200)]
hidl:thermal: Add README.md and template config

Change-Id: Ie7d3b0bccacb7568cd4523483452eb386d21fc9e

4 years agohidl:thermal: Rebrand to Samsung
Francescodario Cuzzocrea [Wed, 15 Jul 2020 17:59:28 +0000 (19:59 +0200)]
hidl:thermal: Rebrand to Samsung

Change-Id: I9119f21538c99143a5d0ec810ec1a0a7b43cacc9

4 years agohidl: Import pixel thermal HAL
Francescodario Cuzzocrea [Wed, 15 Jul 2020 17:56:58 +0000 (19:56 +0200)]
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

4 years agohidl:sensors: Dump sensor information if verbose is turned on
Andreas Schneider [Thu, 16 Jul 2020 15:07:39 +0000 (17:07 +0200)]
hidl:sensors: Dump sensor information if verbose is turned on

This is useful for improving the sensors HAL.

Change-Id: I41430974b40e14095396aaf645b8b37d08b13710

4 years agopower-libperfmgr: Always wait after changing DOUBLE_TAP_TO_WAKE
Andreas Schneider [Thu, 9 Jul 2020 07:12:44 +0000 (09:12 +0200)]
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

4 years agopower-libperfmgr: Fix dt2w after boot
Andreas Schneider [Tue, 7 Jul 2020 06:10:35 +0000 (08:10 +0200)]
power-libperfmgr: Fix dt2w after boot

Change-Id: Ia6172d2f1a54900b8859eef55f07d37a6eab8487

4 years agofingerprint: inscreen: remove dimming on Press
Jesse Chan [Wed, 1 Jul 2020 11:58:07 +0000 (19:58 +0800)]
fingerprint: inscreen: remove dimming on Press

Not neccessary for our FOD sensor.

Change-Id: Id35ecfa99e99b12e4662fedbd3b158f57825b53e

4 years agofingerprint: inscreen: enable FOD in TSP in initialization
Jesse Chan [Wed, 1 Jul 2020 11:43:55 +0000 (19:43 +0800)]
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

4 years agopower-libperfmgr: Correctly implement DT2W support
Andreas Schneider [Wed, 1 Jul 2020 06:23:57 +0000 (08:23 +0200)]
power-libperfmgr: Correctly implement DT2W support

Change-Id: I9ed6e8886322c787ae69f2f79eb7c9b664ce08d7

4 years agopower-libperfmgr: add a Power Hint template with common nodes
Jesse Chan [Sat, 13 Jun 2020 11:44:01 +0000 (19:44 +0800)]
power-libperfmgr: add a Power Hint template with common nodes

Change-Id: I12c0e8e33b49f0eeffba43f520272ec76451511f
Signed-off-by: Jesse Chan <jc@lineageos.org>
4 years agopower-libperfmgr: implement Lineage perf profiles
Jesse Chan [Tue, 30 Jun 2020 14:22:42 +0000 (22:22 +0800)]
power-libperfmgr: implement Lineage perf profiles

Change-Id: Ia247ee65a668689168be009a59355d97ce4f2cca

4 years agopower-libperfmgr: add a DOUBLE_TAP_TO_WAKE hint
Jesse Chan [Tue, 30 Jun 2020 13:19:08 +0000 (21:19 +0800)]
power-libperfmgr: add a DOUBLE_TAP_TO_WAKE hint

Change-Id: I656b5eb836fb0c41fed8802efa51cbae9fdbc0c0

4 years agopower-libperfmgr: add a NOT_INTERACTIVE hint for setInteractive
Jesse Chan [Tue, 30 Jun 2020 13:01:06 +0000 (21:01 +0800)]
power-libperfmgr: add a NOT_INTERACTIVE hint for setInteractive

Change-Id: I0797c47e0b1d8bfee644f0028eaabd7650e39913
Signed-off-by: Jesse Chan <jc@lineageos.org>
4 years agopower-libperfmgr: add an updateHint function for simple hint ops
Jesse Chan [Tue, 30 Jun 2020 13:13:53 +0000 (21:13 +0800)]
power-libperfmgr: add an updateHint function for simple hint ops

Change-Id: I2e64f23b5435f7262b36acd52916b5ac795dd106

4 years agopower-libperfmgr: declare override="true" in manifest
Jesse Chan [Mon, 29 Jun 2020 04:38:58 +0000 (12:38 +0800)]
power-libperfmgr: declare override="true" in manifest

Change-Id: If8349ca7b8102c3ffee545d1065d0e7d08d22652

4 years agopower-libperfmgr: initialize powerHAL when boot is completed
Jesse Chan [Mon, 29 Jun 2020 04:32:17 +0000 (12:32 +0800)]
power-libperfmgr: initialize powerHAL when boot is completed

Change-Id: I801b3aba05ef0be14c7af1969ddf9318c05ef64c

4 years agopower-libperfmgr: Give access to radio group
Andreas Schneider [Wed, 1 Jul 2020 08:04:49 +0000 (10:04 +0200)]
power-libperfmgr: Give access to radio group

The LCD and touchscreen nodes are owned by system:radio on Exynos
devices.

Change-Id: I465f68fac9e7a73392940a58ce70f9afacad47b7

4 years agopower-libperfmgr: remove Google-specific camera and audio hints
Jesse Chan [Mon, 29 Jun 2020 04:26:29 +0000 (12:26 +0800)]
power-libperfmgr: remove Google-specific camera and audio hints

Change-Id: I65285ca8c7248bd1e55d3800862e96c00f00effd

4 years agopower-libperfmgr: remove Google-specific display LPM control
Jesse Chan [Sat, 13 Jun 2020 04:06:26 +0000 (12:06 +0800)]
power-libperfmgr: remove Google-specific display LPM control

Change-Id: If58f38b99bf6fbd73f6b6ab2144293c63e18b600
Signed-off-by: Jesse Chan <jc@lineageos.org>
4 years agopower-libperfmgr: simply wait if idle state node is not present
Jesse Chan [Sat, 13 Jun 2020 03:52:12 +0000 (11:52 +0800)]
power-libperfmgr: simply wait if idle state node is not present

Change-Id: I93dd97e5437761d2d969f93a5af0cae864fd0a65
Signed-off-by: Jesse Chan <jc@lineageos.org>
4 years agopower-libperfmgr: adapt and rebrand for hardware/samsung
Jesse Chan [Sat, 13 Jun 2020 03:22:14 +0000 (11:22 +0800)]
power-libperfmgr: adapt and rebrand for hardware/samsung

Change-Id: I8aa9a712ac7cbc6085928f7cdb9e6ada8ed5e3fe

4 years agosamsung: hidl: import Pixel libperfmgr Power HAL
Jesse Chan [Sat, 13 Jun 2020 03:17:52 +0000 (11:17 +0800)]
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>
4 years agohidl: Add standard timed_out vibrator service
Andreas Schneider [Mon, 25 May 2020 15:10:35 +0000 (17:10 +0200)]
hidl: Add standard timed_out vibrator service

Change-Id: I48164e9adfa52cd223c5a2925fa3b48417a6e50c

4 years agohidl: powershare: add vintf manifest fragment
Linux4 [Fri, 22 May 2020 12:47:04 +0000 (14:47 +0200)]
hidl: powershare: add vintf manifest fragment

Change-Id: I7fddba246ce58127192b7cebcaa09da667e33c91

4 years agofingerprint: inscreen: add vintf manifest fragment
Jesse Chan [Thu, 21 May 2020 13:42:06 +0000 (21:42 +0800)]
fingerprint: inscreen: add vintf manifest fragment

Change-Id: Ie9579e4dea63fd8210f0d3a0a0fa41bd3202d352

4 years agoAutomatic translation import
Michael Bestas [Sat, 23 May 2020 15:20:03 +0000 (18:20 +0300)]
Automatic translation import

Change-Id: I7f11df70b63f3b068d9aac0d1e9ef1476f79c029

4 years agosensors: set max range of proximity sensor to 1
Jesse Chan [Sat, 16 May 2020 13:17:25 +0000 (21:17 +0800)]
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

4 years agofingerprint: inscreen: allow to set_fod_rect at boot
Jesse Chan [Fri, 8 May 2020 16:26:54 +0000 (00:26 +0800)]
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>
4 years agofingerprint: inscreen: enable sensor on ShowFODView
Jesse Chan [Fri, 8 May 2020 16:08:23 +0000 (00:08 +0800)]
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>
4 years agosensors: get the full list of sensors
Andreas Schneider [Fri, 24 Apr 2020 14:57:08 +0000 (16:57 +0200)]
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>
4 years agosensors: map Samsung proximity sensor type to generic
Willi Ye [Sun, 8 Sep 2019 16:23:04 +0000 (18:23 +0200)]
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>