Fix wrong use of power mode over power boost

The removal of PowerHint from the PowerManagerService api in ag/10891954
replaced the PowerHint.INTERACTION with the wrong Mode.INTERACTIVE
instead of Boost.INTERACTION here:

Before the cl:
6d69209022/services/core/java/com/android/server/power/PowerManagerService.java (1614)

After the cl:
https://source.corp.google.com/android/frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java;l=1592;bpv=1;bpt=0;rcl=71d90a685690cc15a16c58e2b21a79935fb15db1

Fix: 157013347
Test: atest FrameworksServicesTests:PowerManagerServiceTest
Change-Id: I25535df17c5fc5717a5918d7c32fe6503d24551c
This commit is contained in:
Lais Andrade
2020-05-20 12:44:16 +01:00
parent d9d2d7c3f9
commit d5881d71fd

View File

@@ -44,6 +44,7 @@ import android.hardware.SystemSensorManager;
import android.hardware.display.AmbientDisplayConfiguration;
import android.hardware.display.DisplayManagerInternal;
import android.hardware.display.DisplayManagerInternal.DisplayPowerRequest;
import android.hardware.power.Boost;
import android.hardware.power.Mode;
import android.net.Uri;
import android.os.BatteryManager;
@@ -321,7 +322,7 @@ public final class PowerManagerService extends SystemService
private long mLastUserActivityTime;
private long mLastUserActivityTimeNoChangeLights;
// Timestamp of last time power mode was set to interactive.
// Timestamp of last time power boost interaction was sent.
private long mLastInteractivePowerHintTime;
// Timestamp of the last screen brightness boost.
@@ -1589,7 +1590,7 @@ public final class PowerManagerService extends SystemService
Trace.traceBegin(Trace.TRACE_TAG_POWER, "userActivity");
try {
if (eventTime > mLastInteractivePowerHintTime) {
setPowerModeInternal(Mode.INTERACTIVE, false);
setPowerBoostInternal(Boost.INTERACTION, 0);
mLastInteractivePowerHintTime = eventTime;
}