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>
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>
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
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>
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
* Change I87ec20e3b0c9e9559963bebe7221f51e1dd4d7f3 made assumptions
that aren't true
Change-Id: I898362c1888ab46afbfad3ecbf8a94a70d2f6fd7
(cherry picked from commit 8f04a50d7cb945deb9da5920948f1eef8ab88857)
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
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
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
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
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>
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>
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>
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>
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>