Skip to content

Commit

Permalink
power: Handle Boost:INTERACTION.
Browse files Browse the repository at this point in the history
The interactive mode means the device state, e.g. display on or off.
The Boost:INTERACTION is used to react on user input e.g. via touch screen.

This was formerly handled on the interaction power hint, which isn't
applicable here. So move this to the boost section and declare it as
supported.

Change-Id: I723618ed9be653d0add8549f810705ee4915c999
  • Loading branch information
Quallenauge authored and jhenrique09 committed Mar 8, 2021
1 parent 87f39a3 commit 0cf191e
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions Power.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ ndk::ScopedAStatus Power::setMode(Mode type, bool enabled) {
break;
case Mode::INTERACTIVE:
setInteractive(enabled);
power_hint(POWER_HINT_INTERACTION, NULL);
break;
case Mode::SUSTAINED_PERFORMANCE:
case Mode::FIXED_PERFORMANCE:
Expand Down Expand Up @@ -136,12 +135,27 @@ ndk::ScopedAStatus Power::isModeSupported(Mode type, bool* _aidl_return) {

ndk::ScopedAStatus Power::setBoost(Boost type, int32_t durationMs) {
LOG(INFO) << "Power setBoost: " << static_cast<int32_t>(type) << ", duration: " << durationMs;
switch (type) {
case Boost::INTERACTION:
power_hint(POWER_HINT_INTERACTION, &durationMs);
break;
default:
LOG(INFO) << "Boost " << static_cast<int32_t>(type) << "Not Supported";
break;
}
return ndk::ScopedAStatus::ok();
}

ndk::ScopedAStatus Power::isBoostSupported(Boost type, bool* _aidl_return) {
LOG(INFO) << "Power isBoostSupported: " << static_cast<int32_t>(type);
*_aidl_return = false;
switch (type) {
case Boost::INTERACTION:
*_aidl_return = true;
break;
default:
*_aidl_return = false;
break;
}
return ndk::ScopedAStatus::ok();
}

Expand Down

0 comments on commit 0cf191e

Please sign in to comment.