Loading api/test-current.txt +4 −0 Original line number Diff line number Diff line Loading @@ -1281,6 +1281,10 @@ package android.net.util { package android.os { public class BatteryManager { method @RequiresPermission("android.permission.POWER_SAVER") public boolean setChargingStateUpdateDelayMillis(int); } public class Build { method public static boolean is64BitAbi(String); } Loading core/java/android/os/BatteryManager.java +2 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.Manifest.permission; import android.annotation.RequiresPermission; import android.annotation.SystemApi; import android.annotation.SystemService; import android.annotation.TestApi; import android.content.Context; import android.content.Intent; import android.hardware.health.V1_0.Constants; Loading Loading @@ -386,6 +387,7 @@ public class BatteryManager { */ @RequiresPermission(permission.POWER_SAVER) @SystemApi @TestApi public boolean setChargingStateUpdateDelayMillis(int delayMillis) { try { return mBatteryStats.setChargingStateUpdateDelayMillis(delayMillis); Loading core/java/com/android/internal/os/BatteryStatsImpl.java +2 −4 Original line number Diff line number Diff line Loading @@ -12775,13 +12775,11 @@ public class BatteryStatsImpl extends BatteryStats { // charging even if it happens to go down a level. changed |= setChargingLocked(true); mLastChargeStepLevel = level; } if (!mCharging) { } else if (!mCharging) { if (mLastChargeStepLevel < level) { // We have not reported that we are charging, but the level has gone up, // but we would like to not have tons of activity from charging-constraint // jobs, so instead of reporting ACTION_CHARGING immediately, we defer it. mLastChargeStepLevel = level; if (!mHandler.hasCallbacks(mDeferSetCharging)) { mHandler.postDelayed( mDeferSetCharging, Loading @@ -12800,9 +12798,9 @@ public class BatteryStatsImpl extends BatteryStats { // power supplied isn't enough, so consider the device to now be // discharging. changed |= setChargingLocked(false); mLastChargeStepLevel = level; } } mLastChargeStepLevel = level; if (mLastChargeStepLevel != level && mMaxChargeStepLevel < level) { mChargeStepTracker.addLevelSteps(level - mLastChargeStepLevel, modeBits, elapsedRealtime); Loading
api/test-current.txt +4 −0 Original line number Diff line number Diff line Loading @@ -1281,6 +1281,10 @@ package android.net.util { package android.os { public class BatteryManager { method @RequiresPermission("android.permission.POWER_SAVER") public boolean setChargingStateUpdateDelayMillis(int); } public class Build { method public static boolean is64BitAbi(String); } Loading
core/java/android/os/BatteryManager.java +2 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.Manifest.permission; import android.annotation.RequiresPermission; import android.annotation.SystemApi; import android.annotation.SystemService; import android.annotation.TestApi; import android.content.Context; import android.content.Intent; import android.hardware.health.V1_0.Constants; Loading Loading @@ -386,6 +387,7 @@ public class BatteryManager { */ @RequiresPermission(permission.POWER_SAVER) @SystemApi @TestApi public boolean setChargingStateUpdateDelayMillis(int delayMillis) { try { return mBatteryStats.setChargingStateUpdateDelayMillis(delayMillis); Loading
core/java/com/android/internal/os/BatteryStatsImpl.java +2 −4 Original line number Diff line number Diff line Loading @@ -12775,13 +12775,11 @@ public class BatteryStatsImpl extends BatteryStats { // charging even if it happens to go down a level. changed |= setChargingLocked(true); mLastChargeStepLevel = level; } if (!mCharging) { } else if (!mCharging) { if (mLastChargeStepLevel < level) { // We have not reported that we are charging, but the level has gone up, // but we would like to not have tons of activity from charging-constraint // jobs, so instead of reporting ACTION_CHARGING immediately, we defer it. mLastChargeStepLevel = level; if (!mHandler.hasCallbacks(mDeferSetCharging)) { mHandler.postDelayed( mDeferSetCharging, Loading @@ -12800,9 +12798,9 @@ public class BatteryStatsImpl extends BatteryStats { // power supplied isn't enough, so consider the device to now be // discharging. changed |= setChargingLocked(false); mLastChargeStepLevel = level; } } mLastChargeStepLevel = level; if (mLastChargeStepLevel != level && mMaxChargeStepLevel < level) { mChargeStepTracker.addLevelSteps(level - mLastChargeStepLevel, modeBits, elapsedRealtime);