Loading cmds/idlcli/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ package { cc_defaults { name: "idlcli-defaults", shared_libs: [ "android.hardware.vibrator-V2-ndk", "android.hardware.vibrator-V3-ndk", "android.hardware.vibrator@1.0", "android.hardware.vibrator@1.1", "android.hardware.vibrator@1.2", Loading cmds/idlcli/vibrator.h +1 −1 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ inline ndk::ScopedAStatus NullptrStatus() { template <typename I> inline auto getService(std::string name) { const auto instance = std::string() + I::descriptor + "/" + name; auto vibBinder = ndk::SpAIBinder(AServiceManager_getService(instance.c_str())); auto vibBinder = ndk::SpAIBinder(AServiceManager_checkService(instance.c_str())); return I::fromBinder(vibBinder); } Loading services/vibratorservice/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ cc_library_shared { "libhidlbase", "liblog", "libutils", "android.hardware.vibrator-V2-ndk", "android.hardware.vibrator-V3-ndk", "android.hardware.vibrator@1.0", "android.hardware.vibrator@1.1", "android.hardware.vibrator@1.2", Loading services/vibratorservice/VibratorHalWrapper.cpp +14 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ using aidl::android::hardware::vibrator::CompositePrimitive; using aidl::android::hardware::vibrator::Effect; using aidl::android::hardware::vibrator::EffectStrength; using aidl::android::hardware::vibrator::PrimitivePwle; using aidl::android::hardware::vibrator::VendorEffect; using std::chrono::milliseconds; Loading Loading @@ -96,6 +97,11 @@ Info HalWrapper::getInfo() { return mInfoCache.get(); } HalResult<void> HalWrapper::performVendorEffect(const VendorEffect&, const std::function<void()>&) { ALOGV("Skipped performVendorEffect because it's not available in Vibrator HAL"); return HalResult<void>::unsupported(); } HalResult<milliseconds> HalWrapper::performComposedEffect(const std::vector<CompositeEffect>&, const std::function<void()>&) { ALOGV("Skipped performComposedEffect because it's not available in Vibrator HAL"); Loading Loading @@ -271,6 +277,13 @@ HalResult<milliseconds> AidlHalWrapper::performEffect( return ret; } HalResult<void> AidlHalWrapper::performVendorEffect( const VendorEffect& effect, const std::function<void()>& completionCallback) { // This method should always support callbacks, so no need to double check. auto cb = ndk::SharedRefBase::make<HalCallbackWrapper>(completionCallback); return HalResultFactory::fromStatus(getHal()->performVendorEffect(effect, cb)); } HalResult<milliseconds> AidlHalWrapper::performComposedEffect( const std::vector<CompositeEffect>& primitives, const std::function<void()>& completionCallback) { Loading Loading @@ -351,7 +364,7 @@ HalResult<std::vector<milliseconds>> AidlHalWrapper::getPrimitiveDurationsIntern } if (halResult.isFailed()) { // Fail entire request if one request has failed. return HalResult<std::vector<milliseconds>>::failed(status.getMessage()); return HalResult<std::vector<milliseconds>>::failed(halResult.errorMessage()); } durations[primitiveIdx] = milliseconds(duration); } Loading services/vibratorservice/benchmarks/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ cc_benchmark { "liblog", "libutils", "libvibratorservice", "android.hardware.vibrator-V2-ndk", "android.hardware.vibrator-V3-ndk", "android.hardware.vibrator@1.0", "android.hardware.vibrator@1.1", "android.hardware.vibrator@1.2", Loading Loading
cmds/idlcli/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ package { cc_defaults { name: "idlcli-defaults", shared_libs: [ "android.hardware.vibrator-V2-ndk", "android.hardware.vibrator-V3-ndk", "android.hardware.vibrator@1.0", "android.hardware.vibrator@1.1", "android.hardware.vibrator@1.2", Loading
cmds/idlcli/vibrator.h +1 −1 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ inline ndk::ScopedAStatus NullptrStatus() { template <typename I> inline auto getService(std::string name) { const auto instance = std::string() + I::descriptor + "/" + name; auto vibBinder = ndk::SpAIBinder(AServiceManager_getService(instance.c_str())); auto vibBinder = ndk::SpAIBinder(AServiceManager_checkService(instance.c_str())); return I::fromBinder(vibBinder); } Loading
services/vibratorservice/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ cc_library_shared { "libhidlbase", "liblog", "libutils", "android.hardware.vibrator-V2-ndk", "android.hardware.vibrator-V3-ndk", "android.hardware.vibrator@1.0", "android.hardware.vibrator@1.1", "android.hardware.vibrator@1.2", Loading
services/vibratorservice/VibratorHalWrapper.cpp +14 −1 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ using aidl::android::hardware::vibrator::CompositePrimitive; using aidl::android::hardware::vibrator::Effect; using aidl::android::hardware::vibrator::EffectStrength; using aidl::android::hardware::vibrator::PrimitivePwle; using aidl::android::hardware::vibrator::VendorEffect; using std::chrono::milliseconds; Loading Loading @@ -96,6 +97,11 @@ Info HalWrapper::getInfo() { return mInfoCache.get(); } HalResult<void> HalWrapper::performVendorEffect(const VendorEffect&, const std::function<void()>&) { ALOGV("Skipped performVendorEffect because it's not available in Vibrator HAL"); return HalResult<void>::unsupported(); } HalResult<milliseconds> HalWrapper::performComposedEffect(const std::vector<CompositeEffect>&, const std::function<void()>&) { ALOGV("Skipped performComposedEffect because it's not available in Vibrator HAL"); Loading Loading @@ -271,6 +277,13 @@ HalResult<milliseconds> AidlHalWrapper::performEffect( return ret; } HalResult<void> AidlHalWrapper::performVendorEffect( const VendorEffect& effect, const std::function<void()>& completionCallback) { // This method should always support callbacks, so no need to double check. auto cb = ndk::SharedRefBase::make<HalCallbackWrapper>(completionCallback); return HalResultFactory::fromStatus(getHal()->performVendorEffect(effect, cb)); } HalResult<milliseconds> AidlHalWrapper::performComposedEffect( const std::vector<CompositeEffect>& primitives, const std::function<void()>& completionCallback) { Loading Loading @@ -351,7 +364,7 @@ HalResult<std::vector<milliseconds>> AidlHalWrapper::getPrimitiveDurationsIntern } if (halResult.isFailed()) { // Fail entire request if one request has failed. return HalResult<std::vector<milliseconds>>::failed(status.getMessage()); return HalResult<std::vector<milliseconds>>::failed(halResult.errorMessage()); } durations[primitiveIdx] = milliseconds(duration); } Loading
services/vibratorservice/benchmarks/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ cc_benchmark { "liblog", "libutils", "libvibratorservice", "android.hardware.vibrator-V2-ndk", "android.hardware.vibrator-V3-ndk", "android.hardware.vibrator@1.0", "android.hardware.vibrator@1.1", "android.hardware.vibrator@1.2", Loading