From 3fa2b6951e9f03e84230f9ae3b4e1bc5139a746f Mon Sep 17 00:00:00 2001 From: "Christopher N. Hesse" Date: Wed, 5 Apr 2017 18:52:48 +0200 Subject: [PATCH] power: Align to AOSP API AOSP power hints can have a NULL data parameter, only our custom hints are guaranteed to provide data. Change-Id: Ibea874e75a7092b3f9c1c56dc5182cdf73f35532 --- power/power.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/power/power.c b/power/power.c index 5489400a..e46a53eb 100644 --- a/power/power.c +++ b/power/power.c @@ -439,11 +439,14 @@ static void samsung_power_hint(struct power_module *module, break; case POWER_HINT_LOW_POWER: ALOGV("%s: POWER_HINT_LOW_POWER", __func__); - set_power_profile(samsung_pwr, PROFILE_POWER_SAVE); + set_power_profile(samsung_pwr, data ? PROFILE_POWER_SAVE : PROFILE_BALANCED); break; case POWER_HINT_LAUNCH: + ALOGV("%s: POWER_HINT_LAUNCH", __func__); + send_boostpulse(samsung_pwr->boostpulse_fd); + break; case POWER_HINT_CPU_BOOST: - ALOGV("%s: POWER_HINT_LAUNCH | POWER_HINT_CPU_BOOST", __func__); + ALOGV("%s: POWER_HINT_CPU_BOOST", __func__); boost((*(int32_t *)data)); break; case POWER_HINT_SET_PROFILE: @@ -453,11 +456,7 @@ static void samsung_power_hint(struct power_module *module, break; case POWER_HINT_DISABLE_TOUCH: ALOGV("%s: POWER_HINT_DISABLE_TOUCH", __func__); - if (data) { - sysfs_write(samsung_pwr->touchscreen_power_path, "0"); - } else { - sysfs_write(samsung_pwr->touchscreen_power_path, "1"); - } + sysfs_write(samsung_pwr->touchscreen_power_path, data ? "0" : "1"); break; default: ALOGW("%s: Unknown power hint: %d", __func__, hint);