power: Add supported modes
Added supported modes in impl Change-Id: I57a5df42e813f1b6af59f9edf37e47fdac400dee
This commit is contained in:
17
Power.cpp
17
Power.cpp
@@ -62,7 +62,6 @@ ndk::ScopedAStatus Power::setMode(Mode type, bool enabled) {
|
|||||||
switch(type){
|
switch(type){
|
||||||
case Mode::DOUBLE_TAP_TO_WAKE:
|
case Mode::DOUBLE_TAP_TO_WAKE:
|
||||||
case Mode::LOW_POWER:
|
case Mode::LOW_POWER:
|
||||||
case Mode::FIXED_PERFORMANCE:
|
|
||||||
case Mode::LAUNCH:
|
case Mode::LAUNCH:
|
||||||
case Mode::EXPENSIVE_RENDERING:
|
case Mode::EXPENSIVE_RENDERING:
|
||||||
case Mode::DEVICE_IDLE:
|
case Mode::DEVICE_IDLE:
|
||||||
@@ -80,15 +79,29 @@ ndk::ScopedAStatus Power::setMode(Mode type, bool enabled) {
|
|||||||
power_hint(POWER_HINT_INTERACTION, NULL);
|
power_hint(POWER_HINT_INTERACTION, NULL);
|
||||||
break;
|
break;
|
||||||
case Mode::SUSTAINED_PERFORMANCE:
|
case Mode::SUSTAINED_PERFORMANCE:
|
||||||
|
case Mode::FIXED_PERFORMANCE:
|
||||||
power_hint(POWER_HINT_SUSTAINED_PERFORMANCE, NULL);
|
power_hint(POWER_HINT_SUSTAINED_PERFORMANCE, NULL);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
LOG(INFO) << "Mode " << static_cast<int32_t>(type) << "Not Supported";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return ndk::ScopedAStatus::ok();
|
return ndk::ScopedAStatus::ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
ndk::ScopedAStatus Power::isModeSupported(Mode type, bool* _aidl_return) {
|
ndk::ScopedAStatus Power::isModeSupported(Mode type, bool* _aidl_return) {
|
||||||
LOG(INFO) << "Power isModeSupported: " << static_cast<int32_t>(type);
|
LOG(INFO) << "Power isModeSupported: " << static_cast<int32_t>(type);
|
||||||
*_aidl_return = false;
|
|
||||||
|
switch(type){
|
||||||
|
case Mode::INTERACTIVE:
|
||||||
|
case Mode::SUSTAINED_PERFORMANCE:
|
||||||
|
case Mode::FIXED_PERFORMANCE:
|
||||||
|
*_aidl_return = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
*_aidl_return = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
return ndk::ScopedAStatus::ok();
|
return ndk::ScopedAStatus::ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user