diff options
| author | 2018-03-21 16:26:12 +0000 | |
|---|---|---|
| committer | 2018-03-21 16:26:12 +0000 | |
| commit | 34730143deadbccd8a81263eaaee2d0790b7bfe2 (patch) | |
| tree | 25db9a882072d32f43be08d3a3b8c5902a37a39d | |
| parent | d5eab8b66855b9eacf57bb22b64a7c553beb5d2e (diff) | |
| parent | fcaab29a663cc2b18c626464e1ceae6b44e51be6 (diff) | |
Merge "Get rid of upperbound on wireless charging anim" into pi-dev
| -rw-r--r-- | services/core/java/com/android/server/power/PowerManagerService.java | 2 | ||||
| -rw-r--r-- | services/core/java/com/android/server/power/WirelessChargerDetector.java | 15 |
2 files changed, 4 insertions, 13 deletions
diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java index 40a94a71792a..adbf7ed866ee 100644 --- a/services/core/java/com/android/server/power/PowerManagerService.java +++ b/services/core/java/com/android/server/power/PowerManagerService.java @@ -1723,7 +1723,7 @@ public final class PowerManagerService extends SystemService // Update wireless dock detection state. final boolean dockedOnWirelessCharger = mWirelessChargerDetector.update( - mIsPowered, mPlugType, mBatteryLevel); + mIsPowered, mPlugType); // Treat plugging and unplugging the devices as a user activity. // Users find it disconcerting when they plug or unplug the device diff --git a/services/core/java/com/android/server/power/WirelessChargerDetector.java b/services/core/java/com/android/server/power/WirelessChargerDetector.java index 54487e39d82f..18e5ce465df6 100644 --- a/services/core/java/com/android/server/power/WirelessChargerDetector.java +++ b/services/core/java/com/android/server/power/WirelessChargerDetector.java @@ -84,10 +84,6 @@ final class WirelessChargerDetector { // The minimum number of samples that must be collected. private static final int MIN_SAMPLES = 3; - // Upper bound on the battery charge percentage in order to consider turning - // the screen on when the device starts charging wirelessly. - private static final int WIRELESS_CHARGER_TURN_ON_BATTERY_LEVEL_LIMIT = 95; - // To detect movement, we compute the angle between the gravity vector // at rest and the current gravity vector. This field specifies the // cosine of the maximum angle variance that we tolerate while at rest. @@ -214,11 +210,10 @@ final class WirelessChargerDetector { * * @param isPowered True if the device is powered. * @param plugType The current plug type. - * @param batteryLevel The current battery level. * @return True if the device is determined to have just been docked on a wireless * charger, after suppressing spurious docking or undocking signals. */ - public boolean update(boolean isPowered, int plugType, int batteryLevel) { + public boolean update(boolean isPowered, int plugType) { synchronized (mLock) { final boolean wasPoweredWirelessly = mPoweredWirelessly; @@ -249,13 +244,9 @@ final class WirelessChargerDetector { } // Report that the device has been docked only if the device just started - // receiving power wirelessly, has a high enough battery level that we - // can be assured that charging was not delayed due to the battery previously - // having been full, and the device is not known to already be at rest + // receiving power wirelessly and the device is not known to already be at rest // on the wireless charger from earlier. - return mPoweredWirelessly && !wasPoweredWirelessly - && batteryLevel < WIRELESS_CHARGER_TURN_ON_BATTERY_LEVEL_LIMIT - && !mAtRest; + return mPoweredWirelessly && !wasPoweredWirelessly && !mAtRest; } } |