Loading tests/extension/vibrator/aidl/default/CustomVibrator.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -57,4 +57,12 @@ ndk::ScopedAStatus CustomVibrator::perform(VendorEffect effect, return ndk::ScopedAStatus::ok(); } ndk::SpAIBinder CustomVibrator::createBinder() { auto binder = BnCustomVibrator::createBinder(); // e.g. AIBinder_setInheritRt(binder.get(), true); // e.g. AIBinder_setMinSchedulerPolicy(binder.get(), SCHED_NORMAL, 20); // e.g. AIBinder_setRequestingSid(binder.get(), true); return binder; } } // namespace aidl::android::hardware::tests::extension::vibrator tests/extension/vibrator/aidl/default/CustomVibrator.h +6 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,12 @@ class CustomVibrator : public BnCustomVibrator { ndk::ScopedAStatus perform(VendorEffect effect, const std::shared_ptr<IVibratorCallback>& callback, int32_t* _aidl_return) override; private: // override for AIBinder_setInheritRt, AIBinder_setMinSchedulerPolicy, or // AIBinder_setRequestingSid calling this in the constructor or elsewhere, the binder would // immediately be destroyed. ndk::SpAIBinder createBinder() override; }; } // namespace aidl::android::hardware::tests::extension::vibrator Loading
tests/extension/vibrator/aidl/default/CustomVibrator.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -57,4 +57,12 @@ ndk::ScopedAStatus CustomVibrator::perform(VendorEffect effect, return ndk::ScopedAStatus::ok(); } ndk::SpAIBinder CustomVibrator::createBinder() { auto binder = BnCustomVibrator::createBinder(); // e.g. AIBinder_setInheritRt(binder.get(), true); // e.g. AIBinder_setMinSchedulerPolicy(binder.get(), SCHED_NORMAL, 20); // e.g. AIBinder_setRequestingSid(binder.get(), true); return binder; } } // namespace aidl::android::hardware::tests::extension::vibrator
tests/extension/vibrator/aidl/default/CustomVibrator.h +6 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,12 @@ class CustomVibrator : public BnCustomVibrator { ndk::ScopedAStatus perform(VendorEffect effect, const std::shared_ptr<IVibratorCallback>& callback, int32_t* _aidl_return) override; private: // override for AIBinder_setInheritRt, AIBinder_setMinSchedulerPolicy, or // AIBinder_setRequestingSid calling this in the constructor or elsewhere, the binder would // immediately be destroyed. ndk::SpAIBinder createBinder() override; }; } // namespace aidl::android::hardware::tests::extension::vibrator