Commit graph

746 commits

Author SHA1 Message Date
ripee
1a42b9d0ec
Merge pull request #32 from LineageOS/lineage-18.1
touch: Move device specfic defines to a header
2021-08-13 12:04:41 +02:00
ShevT
7cce6385ec touch: Move device specfic defines to a header
Change-Id: I81dcbea5393cf3426357e659f89ede050cf567fb
2021-08-08 17:15:57 +02:00
ripee
c6e2c910fe
Merge pull request #31 from LineageOS/lineage-18.1
aidl: power-libperfmgr: Make powerhint.json.template pass tests
2021-05-27 11:16:02 +02:00
LuK1337
630c074c34 aidl: power-libperfmgr: Make powerhint.json.template pass tests
Test: ./perfmgr_config_verifier -c powerhint.json.template
Change-Id: Ib137b46257cd84687a8ded0cf94424b6c353943e
2021-05-26 01:21:00 +02:00
ripee
367ba024a0
Merge pull request #30 from LineageOS/lineage-18.1
samsung: fastcharge: chown sysfs node on init
2021-05-04 23:38:19 +02:00
Jan Altensen
438a038413
samsung: fastcharge: chown sysfs node on init
Change-Id: I04d04b89534293cda68fe2499b9dca4fe962c804
2021-05-04 02:24:03 +02:00
ripee
8e81a56cf7
Merge pull request #29 from LineageOS/lineage-18.1
samsung: add nfc to gitignore
2021-04-30 18:22:26 +02:00
Jan Altensen
3357677918
samsung: add nfc to gitignore
Change-Id: Ic797a5aceb15d32a2e1aab1ba5ad6ccb48aca1d7
2021-04-24 19:13:48 +02:00
ripee
27d9e9253f Havoc-ify 2021-04-03 22:35:50 +02:00
David Marble
0dd1b6f447 Revert "Revert "aidl: power-libperfmgr: Re-implement lineage perf hint""
This reverts commit 03a61ae886.

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

Change-Id: I8e5cef59d03d7f6e571d6677f40b6a730120971c
2021-03-22 05:40:14 +01:00
Michael Benedict
03a61ae886
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 c50258fca0.

Change-Id: I60129f3886b9ab570a3d19b1e4cef9084ab87533
2021-03-21 01:52:57 +07:00
Michael Benedict
c50258fca0
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
2021-03-20 22:05:54 +07:00
Michael Benedict
3fe5163ee0
aidl: power-libperfmgr: Sync powerhint template with aidl hal changes
* adapted from 3e0c3f06a7

Signed-off-by: Michael Benedict <michaelbt@live.com>
Change-Id: Ib97ea5b007dc5e0e650938785218aeb365d358ff
2021-03-20 22:05:06 +07:00
Michael Benedict
a8d2f2cec7
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
2021-03-20 22:05:05 +07:00
Michael Benedict
3d431189e5
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
2021-03-18 16:29:08 +07:00
Michael Benedict
3598031c4d
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
2021-03-14 12:21:44 +07:00
Willi Ye
004df56ac2 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
2021-02-08 12:34:31 +01:00
josip-k
1090133b80 sensors: 2.1: rename to samsung-multihal
Signed-off-by: josip-k <d3hum4niz3d@gmail.com>
Change-Id: Idfc6be9cd54dba45fc23ae0078fa08c8f9e5805f
2021-02-08 12:34:31 +01:00
josip-k
ef443e192c 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
2021-02-08 12:34:31 +01:00
josip-k
49c7d97fea 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
2021-02-08 12:34:31 +01:00
josip-k
9c6bdafd89 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
2021-02-08 12:34:31 +01:00
Bruno Martins
51d37672fb samsung: doze: Use all shared resources from devicesettings
Change-Id: Icd7f381c574ea36eb4d797cefd60ba9f1a0941bd
2021-02-05 05:46:08 +01:00
Bruno Martins
a355cba436
samsung: AdvancedDisplay: Use all shared resources from devicesettings
Orig-Change-Id: Icd7f381c574ea36eb4d797cefd60ba9f1a0941bd
Change-Id: I8171db59a5841e4d1f50263ace9092f986edc971
2021-02-04 15:17:58 -07:00
Jan Altensen
252388e559
samsung: AdvancedDisplay: Migrate to androidx
Change-Id: I9f6f936120e6eac06c78525f3692207ff58c991f
2021-02-04 15:17:53 -07:00
Bruno Martins
02138ed10c fastcharge: Make user setting persistent
Change-Id: I4ff051d6f9685e94022eab32035bfe86a65264b8
2021-01-18 23:05:46 +00:00
Jan Altensen
6d4c3dc374 fastcharge: drop libhwbinder/libhidltransport dependency
Change-Id: I1405348bcdfb63d2234d6dfa4af6e03a319d33f7
2021-01-18 23:05:46 +00:00
Francescodario Cuzzocrea
2f88aeaf27 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-18 23:05:40 +00:00
Arian
c143344242 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:23:47 +01:00
Bruno Martins
67e48ea301 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:23:47 +01:00
Henrique Silva
9eae563ab3 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:23:47 +01:00
Luca Stefani
9a527bab46 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:23:47 +01:00
Luca Stefani
f69e8a5140 samsung: doze: Make AOD preference not persistent
Change-Id: I9d80e94de02d35c85765302a01b53020824dd0ff
2021-01-13 15:23:47 +01:00
Bruno Martins
42ed17551b 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:23:47 +01:00
ezio84
cc3bed76b0 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:23:47 +01:00
Bruno Martins
4a3c87d088 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:23:47 +01:00
Bruno Martins
8449b50d22 samsung: doze: Kill proximity wake feature
This will be reworked later on.

Change-Id: I47e2b0a0c7814ac6a0f33e0016d1c52c7afe222b
2021-01-13 15:23:47 +01:00
Ataberk Özen
be375b491f
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
2021-01-10 21:20:33 +01:00
Francescodario Cuzzocrea
4beff11d33 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 6d6c0500f3)
2020-12-25 17:03:01 +01:00
TeYuan Wang
e69adfd993 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>
2020-12-22 11:37:19 +01:00
TeYuan Wang
e2737f7c4e 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>
2020-12-22 11:37:11 +01:00
Josh Gao
998e4cfbfb 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
2020-12-22 11:37:02 +01:00
TeYuan Wang
cba0d8ef11 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>
2020-12-22 11:36:50 +01:00
Wei Wang
530ecc4dba thermal: Add thermal logging daemon
Bug: 126562025
Bug: 144859663
Test: build and check thermal logging
Change-Id: I996546110f4d66b3ff8052cb46000fe0e5f7b0da
2020-12-22 11:36:36 +01:00
Daniel Norman
00fbc5f977 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
2020-12-22 11:36:26 +01:00
Kevin F. Haggerty
882a78462a livedisplay: Set sysfs ownership/perms on init for qcom
* Change I87ec20e3b0c9e9559963bebe7221f51e1dd4d7f3 made assumptions
  that aren't true

Change-Id: I898362c1888ab46afbfad3ecbf8a94a70d2f6fd7
(cherry picked from commit 8f04a50d7c)
2020-11-01 19:46:35 +02:00
Jan Altensen
f78616bab3 samsung: convert dtbhtoolExynos to blueprint
Change-Id: I0f9aff67e76ac47f792e92fca4802b50f893d37c
2020-10-17 10:58:06 +02:00
Jan Altensen
59de5528ef samsung: mkbootimg: remove recovery.id generation
* this is not a thing anymore

Change-Id: I5eddbf4ddc2dcd0becf22b295e0a880d34446ac7
2020-09-21 23:56:10 +02:00
Elliott Hughes
3bbcb713e0 libril: Remove unused includes.
Test: treehugger
Change-Id: Id6ee53aa0e2a83ef40ce9219092f8a0f519b3471
2020-09-21 23:55:48 +02:00
Jan Altensen
01a9401350 loki_tool: convert to blueprint
Change-Id: Id35492c9f671c265d4b637eb4d536e812f48282b
2020-09-21 23:55:31 +02:00
Jan Altensen
fd91e5c17e
samsung: drop libhwbinder/libhidltransport dependency
Change-Id: Iaa0232ba6ab8235454340416b0995994c908a2ee
2020-09-14 03:46:45 +02:00