Home
last modified time | relevance | path

Searched refs:HalResult (Results 1 – 23 of 23) sorted by relevance

/frameworks/native/include/powermanager/
DHalResult.h40 class HalResult {
42 static HalResult<T> ok(T&& value) { return HalResult(std::forward<T>(value)); } in ok()
43 static HalResult<T> ok(T& value) { return HalResult<T>::ok(T{value}); } in ok()
44 static HalResult<T> failed(std::string msg) { return HalResult(msg, /* unsupported= */ false); } in failed()
45 static HalResult<T> unsupported() { return HalResult("", /* unsupported= */ true); } in unsupported()
47 static HalResult<T> fromStatus(const binder::Status& status, T&& data) { in fromStatus()
49 return HalResult<T>::unsupported(); in fromStatus()
52 return HalResult<T>::ok(std::forward<T>(data)); in fromStatus()
54 return HalResult<T>::failed(std::string(status.toString8().c_str())); in fromStatus()
57 static HalResult<T> fromStatus(const binder::Status& status, T& data) { in fromStatus()
[all …]
DPowerHalWrapper.h52 virtual HalResult<void> setBoost(aidl::android::hardware::power::Boost boost,
54 virtual HalResult<void> setMode(aidl::android::hardware::power::Mode mode, bool enabled) = 0;
55 virtual HalResult<std::shared_ptr<PowerHintSessionWrapper>> createHintSession(
58 virtual HalResult<std::shared_ptr<PowerHintSessionWrapper>> createHintSessionWithConfig(
62 virtual HalResult<int64_t> getHintSessionPreferredRate() = 0;
63 virtual HalResult<aidl::android::hardware::power::ChannelConfig> getSessionChannel(int tgid,
65 virtual HalResult<void> closeSessionChannel(int tgid, int uid) = 0;
74 HalResult<void> setBoost(aidl::android::hardware::power::Boost boost,
76 HalResult<void> setMode(aidl::android::hardware::power::Mode mode, bool enabled) override;
77 HalResult<std::shared_ptr<PowerHintSessionWrapper>> createHintSession(
[all …]
DPowerHintSessionWrapper.h37 virtual HalResult<void> updateTargetWorkDuration(int64_t in_targetDurationNanos);
38 virtual HalResult<void> reportActualWorkDuration(
40 virtual HalResult<void> pause();
41 virtual HalResult<void> resume();
42 virtual HalResult<void> close();
43 virtual HalResult<void> sendHint(::aidl::android::hardware::power::SessionHint in_hint);
44 virtual HalResult<void> setThreads(const std::vector<int32_t>& in_threadIds);
45 virtual HalResult<void> setMode(::aidl::android::hardware::power::SessionMode in_type,
47 virtual HalResult<aidl::android::hardware::power::SessionConfig> getSessionConfig();
DPowerHalController.h60 virtual HalResult<void> setBoost(aidl::android::hardware::power::Boost boost,
62 virtual HalResult<void> setMode(aidl::android::hardware::power::Mode mode,
64 virtual HalResult<std::shared_ptr<PowerHintSessionWrapper>> createHintSession(
67 virtual HalResult<std::shared_ptr<PowerHintSessionWrapper>> createHintSessionWithConfig(
71 virtual HalResult<int64_t> getHintSessionPreferredRate() override;
72 virtual HalResult<aidl::android::hardware::power::ChannelConfig> getSessionChannel(
74 virtual HalResult<void> closeSessionChannel(int tgid, int uid) override;
87 HalResult<T> processHalResult(HalResult<T>&& result, const char* functionName);
/frameworks/native/services/vibratorservice/include/vibratorservice/
DVibratorHalWrapper.h56 class HalResult : public BaseHalResult {
58 static HalResult<T> ok(T value) { return HalResult(value); } in ok()
59 static HalResult<T> unsupported() { return HalResult(Status::UNSUPPORTED); } in unsupported()
60 static HalResult<T> failed(const char* msg) { return HalResult(Status::FAILED, msg); } in failed()
61 static HalResult<T> transactionFailed(const char* msg) { in transactionFailed()
62 return HalResult(Status::FAILED, msg, /* deadObject= */ true); in transactionFailed()
72 explicit HalResult(T value) in HalResult() function
74 explicit HalResult(Status status, const char* errorMessage = "", bool deadObject = false)
80 class HalResult<void> : public BaseHalResult {
82 static HalResult<void> ok() { return HalResult(Status::SUCCESS); } in ok()
[all …]
DVibratorManagerHalWrapper.h67 virtual HalResult<void> ping() = 0;
74 virtual HalResult<ManagerCapabilities> getCapabilities() = 0;
75 virtual HalResult<std::vector<int32_t>> getVibratorIds() = 0;
76 virtual HalResult<std::shared_ptr<HalController>> getVibrator(int32_t id) = 0;
78 virtual HalResult<void> prepareSynced(const std::vector<int32_t>& ids) = 0;
79 virtual HalResult<void> triggerSynced(const std::function<void()>& completionCallback) = 0;
80 virtual HalResult<void> cancelSynced() = 0;
91 HalResult<void> ping() override final;
94 HalResult<ManagerCapabilities> getCapabilities() override final;
95 HalResult<std::vector<int32_t>> getVibratorIds() override final;
[all …]
DVibratorManagerHalController.h56 HalResult<void> ping() override final;
58 HalResult<ManagerCapabilities> getCapabilities() override final;
59 HalResult<std::vector<int32_t>> getVibratorIds() override final;
60 HalResult<std::shared_ptr<HalController>> getVibrator(int32_t id) override final;
62 HalResult<void> prepareSynced(const std::vector<int32_t>& ids) override final;
63 HalResult<void> triggerSynced(const std::function<void()>& completionCallback) override final;
64 HalResult<void> cancelSynced() override final;
74 HalResult<T> processHalResult(HalResult<T> result, const char* functionName);
77 using hal_fn = std::function<HalResult<T>(std::shared_ptr<ManagerHalWrapper>)>;
80 HalResult<T> apply(hal_fn<T>& halFn, const char* functionName);
DVibratorHalController.h96 HalResult<T> doWithRetry(const HalFunction<HalResult<T>>& halFn, const char* functionName) { in doWithRetry()
97 return doWithRetry<T>(halFn, HalResult<T>::unsupported(), functionName); in doWithRetry()
115 HalResult<T> doWithRetry(const HalFunction<HalResult<T>>& halFn, HalResult<T> defaultValue, in doWithRetry()
127 HalResult<T> result = doOnce(hal.get(), halFn, functionName); in doWithRetry()
136 HalResult<T> doOnce(HalWrapper* hal, const HalFunction<HalResult<T>>& halFn, in doOnce()
138 HalResult<T> result = halFn(hal); in doOnce()
/frameworks/native/services/powermanager/
DPowerHalWrapper.cpp34 HalResult<void> EmptyHalWrapper::setBoost(Aidl::Boost boost, int32_t durationMs) { in setBoost()
37 return HalResult<void>::unsupported(); in setBoost()
40 HalResult<void> EmptyHalWrapper::setMode(Aidl::Mode mode, bool enabled) { in setMode()
43 return HalResult<void>::unsupported(); in setMode()
46 HalResult<std::shared_ptr<PowerHintSessionWrapper>> EmptyHalWrapper::createHintSession( in createHintSession()
50 return HalResult<std::shared_ptr<PowerHintSessionWrapper>>::unsupported(); in createHintSession()
53 HalResult<std::shared_ptr<PowerHintSessionWrapper>> EmptyHalWrapper::createHintSessionWithConfig( in createHintSessionWithConfig()
58 return HalResult<std::shared_ptr<PowerHintSessionWrapper>>::unsupported(); in createHintSessionWithConfig()
61 HalResult<int64_t> EmptyHalWrapper::getHintSessionPreferredRate() { in getHintSessionPreferredRate()
63 return HalResult<int64_t>::unsupported(); in getHintSessionPreferredRate()
[all …]
DPowerHalController.cpp103 HalResult<T> PowerHalController::processHalResult(HalResult<T>&& result, const char* fnName) { in processHalResult()
114 HalResult<void> PowerHalController::setBoost(aidl::android::hardware::power::Boost boost, in setBoost()
120 HalResult<void> PowerHalController::setMode(aidl::android::hardware::power::Mode mode, in setMode()
128 HalResult<std::shared_ptr<PowerHintSessionWrapper>> PowerHalController::createHintSession( in createHintSession()
137 HalResult<std::shared_ptr<PowerHintSessionWrapper>> PowerHalController::createHintSessionWithConfig( in createHintSessionWithConfig()
149 HalResult<int64_t> PowerHalController::getHintSessionPreferredRate() { in getHintSessionPreferredRate()
156 HalResult<aidl::android::hardware::power::ChannelConfig> PowerHalController::getSessionChannel( in getSessionChannel()
164 HalResult<void> PowerHalController::closeSessionChannel(int tgid, int uid) { in closeSessionChannel()
DPowerHintSessionWrapper.cpp39 return HalResult<resultType>::failed("Session not running"); \
46 HalResult<void> PowerHintSessionWrapper::name args { \
48 return CACHE_SUPPORT(version, HalResult<void>::fromStatus(mSession->name untypedArgs)); \
72 HalResult<SessionConfig> PowerHintSessionWrapper::getSessionConfig() { in getSessionConfig()
76 HalResult<SessionConfig>::fromStatus(mSession->getSessionConfig(&config), in getSessionConfig()
/frameworks/native/services/vibratorservice/
DVibratorHalWrapper.cpp99 HalResult<milliseconds> HalWrapper::performComposedEffect(const std::vector<CompositeEffect>&, in performComposedEffect()
102 return HalResult<milliseconds>::unsupported(); in performComposedEffect()
105 HalResult<void> HalWrapper::performPwleEffect(const std::vector<PrimitivePwle>&, in performPwleEffect()
108 return HalResult<void>::unsupported(); in performPwleEffect()
111 HalResult<Capabilities> HalWrapper::getCapabilities() { in getCapabilities()
119 HalResult<std::vector<milliseconds>> HalWrapper::getPrimitiveDurations() { in getPrimitiveDurations()
124 mInfoCache.mPrimitiveDurations = HalResult<std::vector<milliseconds>>::unsupported(); in getPrimitiveDurations()
134 HalResult<std::vector<Effect>> HalWrapper::getSupportedEffectsInternal() { in getSupportedEffectsInternal()
136 return HalResult<std::vector<Effect>>::unsupported(); in getSupportedEffectsInternal()
139 HalResult<std::vector<Braking>> HalWrapper::getSupportedBrakingInternal() { in getSupportedBrakingInternal()
[all …]
DVibratorManagerHalWrapper.cpp32 HalResult<void> LegacyManagerHalWrapper::ping() { in ping()
41 HalResult<ManagerCapabilities> LegacyManagerHalWrapper::getCapabilities() { in getCapabilities()
42 return HalResult<ManagerCapabilities>::ok(ManagerCapabilities::NONE); in getCapabilities()
45 HalResult<std::vector<int32_t>> LegacyManagerHalWrapper::getVibratorIds() { in getVibratorIds()
47 return HalResult<std::vector<int32_t>>::ok(std::vector<int32_t>(1, SINGLE_VIBRATOR_ID)); in getVibratorIds()
50 return HalResult<std::vector<int32_t>>::ok(std::vector<int32_t>()); in getVibratorIds()
53 HalResult<std::shared_ptr<HalController>> LegacyManagerHalWrapper::getVibrator(int32_t id) { in getVibrator()
55 return HalResult<std::shared_ptr<HalController>>::ok(mController); in getVibrator()
58 return HalResult<std::shared_ptr<HalController>>::failed( in getVibrator()
62 HalResult<void> LegacyManagerHalWrapper::prepareSynced(const std::vector<int32_t>&) { in prepareSynced()
[all …]
DVibratorManagerHalController.cpp46 HalResult<T> ManagerHalController::processHalResult(HalResult<T> result, const char* functionName) { in processHalResult()
54 HalResult<T> ManagerHalController::apply(ManagerHalController::hal_fn<T>& halFn, in apply()
65 return HalResult<T>::unsupported(); in apply()
71 HalResult<T> result = processHalResult(halFn(hal), functionName); in apply()
92 HalResult<void> ManagerHalController::ping() { in ping()
106 HalResult<ManagerCapabilities> ManagerHalController::getCapabilities() { in getCapabilities()
113 HalResult<std::vector<int32_t>> ManagerHalController::getVibratorIds() { in getVibratorIds()
120 HalResult<std::shared_ptr<HalController>> ManagerHalController::getVibrator(int32_t id) { in getVibrator()
126 HalResult<void> ManagerHalController::prepareSynced(const std::vector<int32_t>& ids) { in prepareSynced()
133 HalResult<void> ManagerHalController::triggerSynced( in triggerSynced()
[all …]
/frameworks/native/services/vibratorservice/test/
DVibratorManagerHalControllerTest.cpp41 MOCK_METHOD(vibrator::HalResult<void>, ping, (), (override));
42 MOCK_METHOD(vibrator::HalResult<vibrator::ManagerCapabilities>, getCapabilities, (),
44 MOCK_METHOD(vibrator::HalResult<std::vector<int32_t>>, getVibratorIds, (), (override));
45 MOCK_METHOD(vibrator::HalResult<std::shared_ptr<HalController>>, getVibrator, (int32_t id),
47 MOCK_METHOD(vibrator::HalResult<void>, prepareSynced, (const std::vector<int32_t>& ids),
49 MOCK_METHOD(vibrator::HalResult<void>, triggerSynced,
51 MOCK_METHOD(vibrator::HalResult<void>, cancelSynced, (), (override));
74 void setHalExpectations(int32_t cardinality, vibrator::HalResult<void> voidResult, in setHalExpectations()
75 vibrator::HalResult<vibrator::ManagerCapabilities> capabilitiesResult, in setHalExpectations()
76 vibrator::HalResult<std::vector<int32_t>> idsResult, in setHalExpectations()
[all …]
DVibratorHalControllerTest.cpp55 MOCK_METHOD(vibrator::HalResult<void>, ping, (), (override));
57 MOCK_METHOD(vibrator::HalResult<void>, on,
60 MOCK_METHOD(vibrator::HalResult<void>, off, (), (override));
61 MOCK_METHOD(vibrator::HalResult<void>, setAmplitude, (float amplitude), (override));
62 MOCK_METHOD(vibrator::HalResult<void>, setExternalControl, (bool enabled), (override));
63 MOCK_METHOD(vibrator::HalResult<void>, alwaysOnEnable,
65 MOCK_METHOD(vibrator::HalResult<void>, alwaysOnDisable, (int32_t id), (override));
66 MOCK_METHOD(vibrator::HalResult<milliseconds>, performEffect,
70 MOCK_METHOD(vibrator::HalResult<vibrator::Capabilities>, getCapabilitiesInternal, (),
114 .WillOnce(Return(vibrator::HalResult<vibrator::Capabilities>::transactionFailed("msg"))) in TEST_F()
[all …]
/frameworks/native/services/surfaceflinger/tests/unittests/mock/DisplayHardware/
DMockPowerHintSessionWrapper.h43 MOCK_METHOD(power::HalResult<void>, updateTargetWorkDuration, (int64_t), (override));
44 MOCK_METHOD(power::HalResult<void>, reportActualWorkDuration,
46 MOCK_METHOD(power::HalResult<void>, pause, (), (override));
47 MOCK_METHOD(power::HalResult<void>, resume, (), (override));
48 MOCK_METHOD(power::HalResult<void>, close, (), (override));
49 MOCK_METHOD(power::HalResult<void>, sendHint, (SessionHint), (override));
50 MOCK_METHOD(power::HalResult<void>, setThreads, (const ::std::vector<int32_t>&), (override));
51 MOCK_METHOD(power::HalResult<void>, setMode, (SessionMode, bool), (override));
52 MOCK_METHOD(power::HalResult<SessionConfig>, getSessionConfig, (), (override));
DMockPowerHalController.h37 using android::power::HalResult;
44 MOCK_METHOD(HalResult<void>, setBoost, (aidl::android::hardware::power::Boost, int32_t),
46 MOCK_METHOD(HalResult<void>, setMode, (aidl::android::hardware::power::Mode, bool), (override));
47 MOCK_METHOD(HalResult<std::shared_ptr<android::power::PowerHintSessionWrapper>>,
50 MOCK_METHOD(HalResult<std::shared_ptr<android::power::PowerHintSessionWrapper>>,
56 MOCK_METHOD(HalResult<int64_t>, getHintSessionPreferredRate, (), (override));
57 MOCK_METHOD(HalResult<aidl::android::hardware::power::ChannelConfig>, getSessionChannel,
59 MOCK_METHOD(HalResult<void>, closeSessionChannel, (int tgid, int uid), (override));
/frameworks/av/media/libaudiohal/impl/
DConversionHelperHidl.h27 template<typename HalResult>
30 using HalResultConverter = std::function<status_t(const HalResult&)>;
56 const ::android::hardware::Return<HalResult>& ret) { in processReturn()
65 const char* funcName, const ::android::hardware::Return<T>& ret, HalResult retval) { in processReturn()
/frameworks/native/services/powermanager/benchmarks/
DPowerHalControllerBenchmarks.cpp28 using android::power::HalResult;
44 static void runBenchmark(benchmark::State& state, HalResult<T> (PowerHalController::*fn)(Args0...), in runBenchmark()
48 HalResult<T> ret = (controller.*fn)(std::forward<Args1>(args1)...); in runBenchmark()
57 HalResult<T> (PowerHalController::*fn)(Args0...), Args1&&... args1) { in runCachedBenchmark()
63 HalResult<T> ret = (controller.*fn)(std::forward<Args1>(args1)...); in runCachedBenchmark()
/frameworks/native/services/surfaceflinger/tests/unittests/
DPowerAdvisorTest.cpp106 ByMove(HalResult<int64_t>::fromStatus(ndk::ScopedAStatus::ok(), 16000)))); in SetUp()
131 ByMove(HalResult<ChannelConfig>::fromStatus(Status::ok(), std::move(config))))); in SetUpFmq()
147 Return(HalResult<std::shared_ptr<PowerHintSessionWrapper>>:: in startPowerHintSession()
152 return HalResult< in startPowerHintSession()
160 .WillByDefault(Return(testing::ByMove(HalResult<void>::ok()))); in startPowerHintSession()
208 testing::Return(testing::ByMove(HalResult<void>::ok())))); in testGpuScenario()
212 testing::Return(testing::ByMove(HalResult<void>::ok())))); in testGpuScenario()
301 testing::Return(testing::ByMove(HalResult<void>::ok())))); in testGpuScenario()
347 .WillOnce(Return(testing::ByMove(HalResult<void>::ok()))); in TEST_F()
387 .WillOnce(Return(testing::ByMove(HalResult<void>::ok()))); in TEST_F()
[all …]
/frameworks/native/services/vibratorservice/benchmarks/
DVibratorHalControllerBenchmarks.cpp143 vibrator::HalResult<void> turnVibratorOff() { in turnVibratorOff()
147 vibrator::HalResult<void> disableExternalControl() { in disableExternalControl()
170 bool shouldSkipWithError(const vibrator::HalFunction<vibrator::HalResult<R>>& halFn, in shouldSkipWithError()
176 bool shouldSkipWithError(const vibrator::HalResult<R>& result, State& state) { in shouldSkipWithError()
/frameworks/base/services/core/jni/
Dcom_android_server_vibrator_VibratorController.cpp128 vibrator::HalResult<T> halCall(const vibrator::HalFunction<vibrator::HalResult<T>>& fn, in halCall()