vibrator: Add a threshold to filter out some short vibration cases am: 214cb227e2
Original change: https://googleplex-android-review.googlesource.com/c/device/google/redfin/+/12308086 Change-Id: I49204d3b883ba93d3681b3494a98cc8d75b2fc2e
This commit is contained in:
commit
84312007e5
|
@ -75,6 +75,7 @@ static struct timespec sGetTime;
|
||||||
#define SENSOR_DATA_NUM 20
|
#define SENSOR_DATA_NUM 20
|
||||||
// Set sensing period to 2s
|
// Set sensing period to 2s
|
||||||
#define SENSING_PERIOD 2000000000
|
#define SENSING_PERIOD 2000000000
|
||||||
|
#define VIBRATION_MOTION_TIME_THRESHOLD 100
|
||||||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
||||||
|
|
||||||
int GSensorCallback(__attribute__((unused)) int fd, __attribute__((unused)) int events,
|
int GSensorCallback(__attribute__((unused)) int fd, __attribute__((unused)) int events,
|
||||||
|
@ -500,7 +501,9 @@ ndk::ScopedAStatus Vibrator::on(int32_t timeoutMs,
|
||||||
if (temperature > TEMP_UPPER_BOUND) {
|
if (temperature > TEMP_UPPER_BOUND) {
|
||||||
mSteadyConfig->odClamp = &mSteadyTargetOdClamp[0];
|
mSteadyConfig->odClamp = &mSteadyTargetOdClamp[0];
|
||||||
mSteadyConfig->olLraPeriod = mSteadyOlLraPeriod;
|
mSteadyConfig->olLraPeriod = mSteadyOlLraPeriod;
|
||||||
if (!motionAwareness()) {
|
// TODO: b/162346934 This a compromise way to bypass the motion
|
||||||
|
// awareness delay
|
||||||
|
if ((timeoutMs > VIBRATION_MOTION_TIME_THRESHOLD) && (!motionAwareness())) {
|
||||||
return on(timeoutMs, RTP_MODE, mSteadyConfig, 2);
|
return on(timeoutMs, RTP_MODE, mSteadyConfig, 2);
|
||||||
}
|
}
|
||||||
} else if (temperature < TEMP_LOWER_BOUND) {
|
} else if (temperature < TEMP_LOWER_BOUND) {
|
||||||
|
|
Loading…
Reference in New Issue