sm8350-common: vibrator: remove unused effect stream handling

This commit is contained in:
Cosmin Tanislav 2021-09-05 14:50:24 +03:00
parent 002ef25ab4
commit 1e781f9173
2 changed files with 0 additions and 18 deletions

View File

@ -12,7 +12,6 @@ cc_library_shared {
"libcutils", "libcutils",
"libutils", "libutils",
"liblog", "liblog",
"libqtivibratoreffect",
"libbinder_ndk", "libbinder_ndk",
"android.hardware.vibrator-ndk_platform", "android.hardware.vibrator-ndk_platform",
], ],

View File

@ -39,9 +39,6 @@
#include <thread> #include <thread>
#include "include/Vibrator.h" #include "include/Vibrator.h"
#ifdef USE_EFFECT_STREAM
#include "effect.h"
#endif
namespace aidl { namespace aidl {
namespace android { namespace android {
@ -184,9 +181,6 @@ int InputFFDevice::play(int effectId, uint32_t timeoutMs, long *playLengthMs) {
struct input_event play; struct input_event play;
int16_t data[CUSTOM_DATA_LEN] = {0, 0, 0}; int16_t data[CUSTOM_DATA_LEN] = {0, 0, 0};
int ret; int ret;
#ifdef USE_EFFECT_STREAM
const struct effect_stream *stream;
#endif
/* For QMAA compliance, return OK even if vibrator device doesn't exist */ /* For QMAA compliance, return OK even if vibrator device doesn't exist */
if (mVibraFd == INVALID_VALUE) { if (mVibraFd == INVALID_VALUE) {
@ -213,13 +207,6 @@ int InputFFDevice::play(int effectId, uint32_t timeoutMs, long *playLengthMs) {
effect.u.periodic.magnitude = mCurrMagnitude; effect.u.periodic.magnitude = mCurrMagnitude;
effect.u.periodic.custom_data = data; effect.u.periodic.custom_data = data;
effect.u.periodic.custom_len = sizeof(int16_t) * CUSTOM_DATA_LEN; effect.u.periodic.custom_len = sizeof(int16_t) * CUSTOM_DATA_LEN;
#ifdef USE_EFFECT_STREAM
stream = get_effect_stream(effectId);
if (stream != NULL) {
effect.u.periodic.custom_data = (int16_t *)stream;
effect.u.periodic.custom_len = sizeof(*stream);
}
#endif
} else { } else {
effect.type = FF_CONSTANT; effect.type = FF_CONSTANT;
effect.u.constant.level = mCurrMagnitude; effect.u.constant.level = mCurrMagnitude;
@ -238,10 +225,6 @@ int InputFFDevice::play(int effectId, uint32_t timeoutMs, long *playLengthMs) {
mCurrAppId = effect.id; mCurrAppId = effect.id;
if (effectId != INVALID_VALUE && playLengthMs != NULL) { if (effectId != INVALID_VALUE && playLengthMs != NULL) {
*playLengthMs = data[1] * 1000 + data[2]; *playLengthMs = data[1] * 1000 + data[2];
#ifdef USE_EFFECT_STREAM
if (stream != NULL && stream->play_rate_hz != 0)
*playLengthMs = ((stream->length * 1000) / stream->play_rate_hz) + 1;
#endif
} }
play.value = 1; play.value = 1;