Merge changes from topic "Vibrator_manager_project_path" into tm-qpr-dev am: 86104145dc
Original change: https://googleplex-android-review.googlesource.com/c/device/google/felix/+/20178023 Change-Id: I6715418630566ac59967478173756618c19f2db7 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
f92aeb45ce
12 changed files with 95 additions and 92 deletions
|
@ -190,7 +190,10 @@ PRODUCT_VENDOR_PROPERTIES += \
|
||||||
|
|
||||||
# Vibrator HAL
|
# Vibrator HAL
|
||||||
PRODUCT_PRODUCT_PROPERTIES +=\
|
PRODUCT_PRODUCT_PROPERTIES +=\
|
||||||
ro.vendor.vibrator.hal.long.frequency.shift=0
|
ro.vendor.vibrator.hal.long.frequency.shift=0 \
|
||||||
|
ro.vendor.vibrator.hal.chirp.enabled=1 \
|
||||||
|
ro.vendor.vibrator.hal.gpio.num=44 \
|
||||||
|
ro.vendor.vibrator.hal.gpio.shift=2
|
||||||
ACTUATOR_MODEL := luxshare_ict_lt_xlra1906d
|
ACTUATOR_MODEL := luxshare_ict_lt_xlra1906d
|
||||||
|
|
||||||
# Fingerprint
|
# Fingerprint
|
||||||
|
|
|
@ -80,25 +80,6 @@ cc_binary {
|
||||||
shared_libs: [
|
shared_libs: [
|
||||||
"android.hardware.vibrator-impl.cs40l26-private",
|
"android.hardware.vibrator-impl.cs40l26-private",
|
||||||
],
|
],
|
||||||
cflags: [
|
|
||||||
"-DLOG_TAG=\"android.hardware.vibrator-cs40l26-private\"",
|
|
||||||
],
|
|
||||||
proprietary: true,
|
|
||||||
}
|
|
||||||
|
|
||||||
cc_binary {
|
|
||||||
name: "android.hardware.vibrator-service.cs40l26-dual-private",
|
|
||||||
defaults: ["VibratorHalCs40l26BinaryDefaultsPrivate"],
|
|
||||||
init_rc: ["android.hardware.vibrator-service.cs40l26-dual-private.rc"],
|
|
||||||
vintf_fragments: ["android.hardware.vibrator-service.cs40l26-dual-private.xml"],
|
|
||||||
srcs: ["service.cpp"],
|
|
||||||
shared_libs: [
|
|
||||||
"android.hardware.vibrator-impl.cs40l26-private",
|
|
||||||
],
|
|
||||||
cflags: [
|
|
||||||
"-DVIBRATOR_NAME=\"dual\"",
|
|
||||||
"-DLOG_TAG=\"android.hardware.vibrator-cs40l26-dual-private\"",
|
|
||||||
],
|
|
||||||
proprietary: true,
|
proprietary: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,8 +92,5 @@ cc_binary {
|
||||||
shared_libs: [
|
shared_libs: [
|
||||||
"android.hardware.vibrator-impl.cs40l26-private",
|
"android.hardware.vibrator-impl.cs40l26-private",
|
||||||
],
|
],
|
||||||
cflags: [
|
|
||||||
"-DLOG_TAG=\"android.hardware.vibrator-cs40l26-stereo-private\"",
|
|
||||||
],
|
|
||||||
proprietary: true,
|
proprietary: true,
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,13 +54,13 @@ class VibMgrHwApi : public VibratorManager::HwApi {
|
||||||
}
|
}
|
||||||
mGPIOPin = utils::getProperty(mPropertyPrefix + "gpio.num", DEBUG_GPI_PIN);
|
mGPIOPin = utils::getProperty(mPropertyPrefix + "gpio.num", DEBUG_GPI_PIN);
|
||||||
if (mGPIOPin == DEBUG_GPI_PIN) {
|
if (mGPIOPin == DEBUG_GPI_PIN) {
|
||||||
ALOGE("GetGPIO: Fail to get the GPIO num: %s", strerror(errno));
|
ALOGE("GetGPIO: Failed to get the GPIO num: %s", strerror(errno));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
mGPIOShift = utils::getProperty(mPropertyPrefix + "gpio.shift", DEBUG_GPI_PIN_SHIFT);
|
mGPIOShift = utils::getProperty(mPropertyPrefix + "gpio.shift", DEBUG_GPI_PIN_SHIFT);
|
||||||
|
|
||||||
if (mGPIOShift == DEBUG_GPI_PIN_SHIFT) {
|
if (mGPIOShift == DEBUG_GPI_PIN_SHIFT) {
|
||||||
ALOGE("GetGPIO: Fail to get the GPIO shift num: %s", strerror(errno));
|
ALOGE("GetGPIO: Failed to get the GPIO shift num: %s", strerror(errno));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,6 +100,18 @@ static constexpr float PWLE_BW_MAP_SIZE =
|
||||||
*/
|
*/
|
||||||
static constexpr uint32_t GPIO_TRIGGER_CONFIG = 0x9100;
|
static constexpr uint32_t GPIO_TRIGGER_CONFIG = 0x9100;
|
||||||
|
|
||||||
|
const char *kHAPNAME = std::getenv("HAPTIC_NAME");
|
||||||
|
#undef ALOGV
|
||||||
|
#define ALOGV(...) ((void)ALOG(LOG_VERBOSE, kHAPNAME, __VA_ARGS__))
|
||||||
|
#undef ALOGD
|
||||||
|
#define ALOGD(...) ((void)ALOG(LOG_DEBUG, kHAPNAME, __VA_ARGS__))
|
||||||
|
#undef ALOGI
|
||||||
|
#define ALOGI(...) ((void)ALOG(LOG_INFO, kHAPNAME, __VA_ARGS__))
|
||||||
|
#undef ALOGW
|
||||||
|
#define ALOGW(...) ((void)ALOG(LOG_WARN, kHAPNAME, __VA_ARGS__))
|
||||||
|
#undef ALOGE
|
||||||
|
#define ALOGE(...) ((void)ALOG(LOG_ERROR, kHAPNAME, __VA_ARGS__))
|
||||||
|
|
||||||
static uint16_t amplitudeToScale(float amplitude, float maximum) {
|
static uint16_t amplitudeToScale(float amplitude, float maximum) {
|
||||||
float ratio = 100; /* Unit: % */
|
float ratio = 100; /* Unit: % */
|
||||||
if (maximum != 0)
|
if (maximum != 0)
|
||||||
|
@ -248,7 +260,7 @@ Vibrator::Vibrator(std::unique_ptr<HwApi> hwapi, std::unique_ptr<HwCal> hwcal)
|
||||||
for (uint8_t retry = 0; retry < 10; retry++) {
|
for (uint8_t retry = 0; retry < 10; retry++) {
|
||||||
ret = glob(inputEventPathName, 0, nullptr, &inputEventPaths);
|
ret = glob(inputEventPathName, 0, nullptr, &inputEventPaths);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
ALOGE("Fail to get input event paths (%d): %s", errno, strerror(errno));
|
ALOGE("Failed to get input event paths (%d): %s", errno, strerror(errno));
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < inputEventPaths.gl_pathc; i++) {
|
for (int i = 0; i < inputEventPaths.gl_pathc; i++) {
|
||||||
fd = TEMP_FAILURE_RETRY(open(inputEventPaths.gl_pathv[i], O_RDWR));
|
fd = TEMP_FAILURE_RETRY(open(inputEventPaths.gl_pathv[i], O_RDWR));
|
||||||
|
@ -278,7 +290,7 @@ Vibrator::Vibrator(std::unique_ptr<HwApi> hwapi, std::unique_ptr<HwCal> hwcal)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mInputFd.ok()) {
|
if (!mInputFd.ok()) {
|
||||||
ALOGE("Fail to get an input event with name %s", inputEventName);
|
ALOGE("Failed to get an input event with name %s", inputEventName);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ALOGE("The input name %s is not cs40l26_input or cs40l26_dual_input", inputEventName);
|
ALOGE("The input name %s is not cs40l26_input or cs40l26_dual_input", inputEventName);
|
||||||
|
@ -1360,7 +1372,7 @@ void Vibrator::waitForComplete(std::shared_ptr<IVibratorCallback> &&callback) {
|
||||||
|
|
||||||
if (!mHwApi->pollVibeState(VIBE_STATE_HAPTIC,
|
if (!mHwApi->pollVibeState(VIBE_STATE_HAPTIC,
|
||||||
(mSyncedCallback) ? POLLING_TIMEOUT_IN_SYNC : POLLING_TIMEOUT)) {
|
(mSyncedCallback) ? POLLING_TIMEOUT_IN_SYNC : POLLING_TIMEOUT)) {
|
||||||
ALOGV("Fail to get state \"Haptic\"");
|
ALOGV("Failed to get state \"Haptic\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
mHwApi->pollVibeState(VIBE_STATE_STOPPED);
|
mHwApi->pollVibeState(VIBE_STATE_STOPPED);
|
||||||
|
|
|
@ -27,6 +27,18 @@ namespace android {
|
||||||
namespace hardware {
|
namespace hardware {
|
||||||
namespace vibrator {
|
namespace vibrator {
|
||||||
|
|
||||||
|
const char *kHAPMGRNAME = std::getenv("HAPTIC_MGR_NAME");
|
||||||
|
#undef ALOGV
|
||||||
|
#define ALOGV(...) ((void)ALOG(LOG_VERBOSE, kHAPMGRNAME, __VA_ARGS__))
|
||||||
|
#undef ALOGD
|
||||||
|
#define ALOGD(...) ((void)ALOG(LOG_DEBUG, kHAPMGRNAME, __VA_ARGS__))
|
||||||
|
#undef ALOGI
|
||||||
|
#define ALOGI(...) ((void)ALOG(LOG_INFO, kHAPMGRNAME, __VA_ARGS__))
|
||||||
|
#undef ALOGW
|
||||||
|
#define ALOGW(...) ((void)ALOG(LOG_WARN, kHAPMGRNAME, __VA_ARGS__))
|
||||||
|
#undef ALOGE
|
||||||
|
#define ALOGE(...) ((void)ALOG(LOG_ERROR, kHAPMGRNAME, __VA_ARGS__))
|
||||||
|
|
||||||
using ::android::sp;
|
using ::android::sp;
|
||||||
using ::android::binder::Status;
|
using ::android::binder::Status;
|
||||||
using ::android::hardware::vibrator::BnVibratorSyncCallback;
|
using ::android::hardware::vibrator::BnVibratorSyncCallback;
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
on property:vendor.all.modules.ready=1
|
|
||||||
wait /sys/bus/i2c/devices/i2c-cs40l26a-dual/calibration/redc_cal_time_ms
|
|
||||||
|
|
||||||
mkdir /mnt/vendor/persist/haptics 0770 system system
|
|
||||||
chmod 770 /mnt/vendor/persist/haptics
|
|
||||||
chmod 440 /mnt/vendor/persist/haptics/cs40l26_dual.cal
|
|
||||||
chown system system /mnt/vendor/persist/haptics
|
|
||||||
chown system system /mnt/vendor/persist/haptics/cs40l26_dual.cal
|
|
||||||
|
|
||||||
chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/calibration/f0_stored
|
|
||||||
chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/calibration/q_stored
|
|
||||||
chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/calibration/redc_stored
|
|
||||||
chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/default/vibe_state
|
|
||||||
chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/default/num_waves
|
|
||||||
chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/default/f0_offset
|
|
||||||
chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/default/owt_free_space
|
|
||||||
chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/default/f0_comp_enable
|
|
||||||
chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/default/redc_comp_enable
|
|
||||||
chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/default/delay_before_stop_playback_us
|
|
||||||
|
|
||||||
enable vendor.vibrator.cs40l26-dual
|
|
||||||
|
|
||||||
service vendor.vibrator.cs40l26-dual /vendor/bin/hw/android.hardware.vibrator-service.cs40l26-dual-private
|
|
||||||
class hal
|
|
||||||
user system
|
|
||||||
group system input
|
|
||||||
|
|
||||||
setenv INPUT_EVENT_NAME cs40l26_dual_input
|
|
||||||
setenv INPUT_EVENT_PATH /dev/input/event*
|
|
||||||
setenv PROPERTY_PREFIX ro.vendor.vibrator.hal.
|
|
||||||
setenv CALIBRATION_FILEPATH /mnt/vendor/persist/haptics/cs40l26_dual.cal
|
|
||||||
|
|
||||||
setenv HWAPI_PATH_PREFIX /sys/bus/i2c/devices/i2c-cs40l26a-dual/
|
|
||||||
setenv HWAPI_DEBUG_PATHS "
|
|
||||||
calibration/f0_stored
|
|
||||||
calibration/redc_stored
|
|
||||||
calibration/q_stored
|
|
||||||
default/vibe_state
|
|
||||||
default/num_waves
|
|
||||||
default/f0_offset
|
|
||||||
default/owt_free_space
|
|
||||||
default/f0_comp_enable
|
|
||||||
default/redc_comp_enable
|
|
||||||
default/delay_before_stop_playback_us
|
|
||||||
"
|
|
||||||
|
|
||||||
disabled
|
|
|
@ -1,7 +0,0 @@
|
||||||
<manifest version="1.0" type="device">
|
|
||||||
<hal format="aidl">
|
|
||||||
<name>android.hardware.vibrator</name>
|
|
||||||
<version>2</version>
|
|
||||||
<fqname>IVibrator/dual</fqname>
|
|
||||||
</hal>
|
|
||||||
</manifest>
|
|
|
@ -4,27 +4,41 @@ on property:vendor.all.modules.ready=1
|
||||||
mkdir /mnt/vendor/persist/haptics 0770 system system
|
mkdir /mnt/vendor/persist/haptics 0770 system system
|
||||||
chmod 770 /mnt/vendor/persist/haptics
|
chmod 770 /mnt/vendor/persist/haptics
|
||||||
chmod 440 /mnt/vendor/persist/haptics/cs40l26.cal
|
chmod 440 /mnt/vendor/persist/haptics/cs40l26.cal
|
||||||
|
chmod 440 /mnt/vendor/persist/haptics/cs40l26_dual.cal
|
||||||
chown system system /mnt/vendor/persist/haptics
|
chown system system /mnt/vendor/persist/haptics
|
||||||
chown system system /mnt/vendor/persist/haptics/cs40l26.cal
|
chown system system /mnt/vendor/persist/haptics/cs40l26.cal
|
||||||
|
chown system system /mnt/vendor/persist/haptics/cs40l26_dual.cal
|
||||||
|
|
||||||
chown system system /sys/bus/i2c/devices/i2c-cs40l26a/calibration/f0_stored
|
chown system system /sys/bus/i2c/devices/i2c-cs40l26a/calibration/f0_stored
|
||||||
|
chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/calibration/f0_stored
|
||||||
chown system system /sys/bus/i2c/devices/i2c-cs40l26a/calibration/q_stored
|
chown system system /sys/bus/i2c/devices/i2c-cs40l26a/calibration/q_stored
|
||||||
|
chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/calibration/q_stored
|
||||||
chown system system /sys/bus/i2c/devices/i2c-cs40l26a/calibration/redc_stored
|
chown system system /sys/bus/i2c/devices/i2c-cs40l26a/calibration/redc_stored
|
||||||
|
chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/calibration/redc_stored
|
||||||
chown system system /sys/bus/i2c/devices/i2c-cs40l26a/default/vibe_state
|
chown system system /sys/bus/i2c/devices/i2c-cs40l26a/default/vibe_state
|
||||||
|
chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/default/vibe_state
|
||||||
chown system system /sys/bus/i2c/devices/i2c-cs40l26a/default/num_waves
|
chown system system /sys/bus/i2c/devices/i2c-cs40l26a/default/num_waves
|
||||||
|
chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/default/num_waves
|
||||||
chown system system /sys/bus/i2c/devices/i2c-cs40l26a/default/f0_offset
|
chown system system /sys/bus/i2c/devices/i2c-cs40l26a/default/f0_offset
|
||||||
|
chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/default/f0_offset
|
||||||
chown system system /sys/bus/i2c/devices/i2c-cs40l26a/default/owt_free_space
|
chown system system /sys/bus/i2c/devices/i2c-cs40l26a/default/owt_free_space
|
||||||
|
chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/default/owt_free_space
|
||||||
chown system system /sys/bus/i2c/devices/i2c-cs40l26a/default/f0_comp_enable
|
chown system system /sys/bus/i2c/devices/i2c-cs40l26a/default/f0_comp_enable
|
||||||
|
chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/default/f0_comp_enable
|
||||||
chown system system /sys/bus/i2c/devices/i2c-cs40l26a/default/redc_comp_enable
|
chown system system /sys/bus/i2c/devices/i2c-cs40l26a/default/redc_comp_enable
|
||||||
|
chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/default/redc_comp_enable
|
||||||
chown system system /sys/bus/i2c/devices/i2c-cs40l26a/default/delay_before_stop_playback_us
|
chown system system /sys/bus/i2c/devices/i2c-cs40l26a/default/delay_before_stop_playback_us
|
||||||
|
chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/default/delay_before_stop_playback_us
|
||||||
|
|
||||||
enable vendor.vibrator.cs40l26
|
enable vendor.vibrator.cs40l26
|
||||||
|
enable vendor.vibrator.cs40l26-dual
|
||||||
|
|
||||||
service vendor.vibrator.cs40l26 /vendor/bin/hw/android.hardware.vibrator-service.cs40l26-private
|
service vendor.vibrator.cs40l26 /vendor/bin/hw/android.hardware.vibrator-service.cs40l26-private
|
||||||
class hal
|
class hal
|
||||||
user system
|
user system
|
||||||
group system input
|
group system input
|
||||||
|
|
||||||
|
setenv HAPTIC_NAME HapticsBase
|
||||||
setenv INPUT_EVENT_NAME cs40l26_input
|
setenv INPUT_EVENT_NAME cs40l26_input
|
||||||
setenv INPUT_EVENT_PATH /dev/input/event*
|
setenv INPUT_EVENT_PATH /dev/input/event*
|
||||||
setenv PROPERTY_PREFIX ro.vendor.vibrator.hal.
|
setenv PROPERTY_PREFIX ro.vendor.vibrator.hal.
|
||||||
|
@ -45,3 +59,30 @@ service vendor.vibrator.cs40l26 /vendor/bin/hw/android.hardware.vibrator-service
|
||||||
"
|
"
|
||||||
|
|
||||||
disabled
|
disabled
|
||||||
|
|
||||||
|
service vendor.vibrator.cs40l26-dual /vendor/bin/hw/android.hardware.vibrator-service.cs40l26-private
|
||||||
|
class hal
|
||||||
|
user system
|
||||||
|
group system input
|
||||||
|
|
||||||
|
setenv HAPTIC_NAME HapticsFlip
|
||||||
|
setenv INPUT_EVENT_NAME cs40l26_dual_input
|
||||||
|
setenv INPUT_EVENT_PATH /dev/input/event*
|
||||||
|
setenv PROPERTY_PREFIX ro.vendor.vibrator.hal.
|
||||||
|
setenv CALIBRATION_FILEPATH /mnt/vendor/persist/haptics/cs40l26_dual.cal
|
||||||
|
|
||||||
|
setenv HWAPI_PATH_PREFIX /sys/bus/i2c/devices/i2c-cs40l26a-dual/
|
||||||
|
setenv HWAPI_DEBUG_PATHS "
|
||||||
|
calibration/f0_stored
|
||||||
|
calibration/redc_stored
|
||||||
|
calibration/q_stored
|
||||||
|
default/vibe_state
|
||||||
|
default/num_waves
|
||||||
|
default/f0_offset
|
||||||
|
default/owt_free_space
|
||||||
|
default/f0_comp_enable
|
||||||
|
default/redc_comp_enable
|
||||||
|
default/delay_before_stop_playback_us
|
||||||
|
"
|
||||||
|
|
||||||
|
disabled
|
||||||
|
|
|
@ -4,4 +4,9 @@
|
||||||
<version>2</version>
|
<version>2</version>
|
||||||
<fqname>IVibrator/default</fqname>
|
<fqname>IVibrator/default</fqname>
|
||||||
</hal>
|
</hal>
|
||||||
|
<hal format="aidl">
|
||||||
|
<name>android.hardware.vibrator</name>
|
||||||
|
<version>2</version>
|
||||||
|
<fqname>IVibrator/dual</fqname>
|
||||||
|
</hal>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
|
@ -9,6 +9,7 @@ service vendor.vibrator.cs40l26-stereo /vendor/bin/hw/android.hardware.vibrator-
|
||||||
user root
|
user root
|
||||||
group root
|
group root
|
||||||
|
|
||||||
|
setenv HAPTIC_MGR_NAME HapticsMgr
|
||||||
setenv PROPERTY_PREFIX ro.vendor.vibrator.hal.
|
setenv PROPERTY_PREFIX ro.vendor.vibrator.hal.
|
||||||
|
|
||||||
disabled
|
disabled
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
PRODUCT_PACKAGES += \
|
PRODUCT_PACKAGES += \
|
||||||
android.hardware.vibrator-service.cs40l26-private \
|
android.hardware.vibrator-service.cs40l26-private \
|
||||||
android.hardware.vibrator-service.cs40l26-dual-private \
|
android.hardware.vibrator-service.cs40l26-stereo-private
|
||||||
android.hardware.vibrator-service.cs40l26-stereo-private \
|
|
||||||
|
|
||||||
BOARD_SEPOLICY_DIRS += \
|
BOARD_SEPOLICY_DIRS += \
|
||||||
device/google/felix-sepolicy/vibrator/common \
|
hardware/google/pixel-sepolicy/vibrator/common \
|
||||||
device/google/felix-sepolicy/vibrator/cs40l26
|
hardware/google/pixel-sepolicy/vibrator/cs40l26
|
||||||
|
|
|
@ -32,17 +32,23 @@ using ::android::sp;
|
||||||
using ::android::String16;
|
using ::android::String16;
|
||||||
using ::android::hardware::vibrator::VibratorSync;
|
using ::android::hardware::vibrator::VibratorSync;
|
||||||
|
|
||||||
#if !defined(VIBRATOR_NAME)
|
|
||||||
#define VIBRATOR_NAME "default"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
const char *inputEventName = std::getenv("INPUT_EVENT_NAME");
|
||||||
|
std::string vibName = "";
|
||||||
|
if (strstr(inputEventName, "cs40l26_input") != nullptr) {
|
||||||
|
vibName.assign("default");
|
||||||
|
} else if (strstr(inputEventName, "cs40l26_dual_input") != nullptr) {
|
||||||
|
vibName.assign("dual");
|
||||||
|
} else {
|
||||||
|
ALOGE("Failed to init vibrator HAL");
|
||||||
|
return EXIT_FAILURE; // should not reach
|
||||||
|
}
|
||||||
auto svc = ndk::SharedRefBase::make<Vibrator>(std::make_unique<HwApi>(),
|
auto svc = ndk::SharedRefBase::make<Vibrator>(std::make_unique<HwApi>(),
|
||||||
std::make_unique<HwCal>());
|
std::make_unique<HwCal>());
|
||||||
const auto svcName = std::string() + svc->descriptor + "/" + VIBRATOR_NAME;
|
const auto svcName = std::string() + svc->descriptor + "/" + vibName;
|
||||||
|
|
||||||
auto ext = sp<VibratorSync>::make(svc);
|
auto ext = sp<VibratorSync>::make(svc);
|
||||||
const auto extName = std::stringstream() << ext->descriptor << "/" << VIBRATOR_NAME;
|
const auto extName = std::stringstream() << ext->descriptor << "/" << vibName;
|
||||||
|
|
||||||
ProcessState::initWithDriver("/dev/vndbinder");
|
ProcessState::initWithDriver("/dev/vndbinder");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue