Loading apex/jobscheduler/service/java/com/android/server/tare/InternalResourceService.java +3 −0 Original line number Diff line number Diff line Loading @@ -783,6 +783,9 @@ public class InternalResourceService extends SystemService { // Reset the consumption limit since several factors may have changed. mScribe.setConsumptionLimitLocked( mCompleteEconomicPolicy.getInitialSatiatedConsumptionLimit()); } else { // Adjust the supply in case battery level changed while the device was off. adjustCreditSupplyLocked(true); } } scheduleUnusedWealthReclamationLocked(); Loading apex/jobscheduler/service/java/com/android/server/tare/Scribe.java +10 −3 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.server.tare; import static android.text.format.DateUtils.HOUR_IN_MILLIS; import static com.android.server.tare.TareUtils.appToString; import static com.android.server.tare.TareUtils.cakeToString; import android.annotation.NonNull; import android.annotation.Nullable; Loading Loading @@ -136,9 +137,15 @@ public class Scribe { @GuardedBy("mIrs.getLock()") void adjustRemainingConsumableCakesLocked(long delta) { if (delta != 0) { // No point doing any work if the change is 0. final long staleCakes = mRemainingConsumableCakes; mRemainingConsumableCakes += delta; if (mRemainingConsumableCakes < 0) { Slog.w(TAG, "Overdrew consumable cakes by " + cakeToString(-mRemainingConsumableCakes)); // A negative value would interfere with allowing free actions, so set the minimum as 0. mRemainingConsumableCakes = 0; } if (mRemainingConsumableCakes != staleCakes) { // No point doing any work if there was no functional change. postWrite(); } } Loading Loading
apex/jobscheduler/service/java/com/android/server/tare/InternalResourceService.java +3 −0 Original line number Diff line number Diff line Loading @@ -783,6 +783,9 @@ public class InternalResourceService extends SystemService { // Reset the consumption limit since several factors may have changed. mScribe.setConsumptionLimitLocked( mCompleteEconomicPolicy.getInitialSatiatedConsumptionLimit()); } else { // Adjust the supply in case battery level changed while the device was off. adjustCreditSupplyLocked(true); } } scheduleUnusedWealthReclamationLocked(); Loading
apex/jobscheduler/service/java/com/android/server/tare/Scribe.java +10 −3 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.server.tare; import static android.text.format.DateUtils.HOUR_IN_MILLIS; import static com.android.server.tare.TareUtils.appToString; import static com.android.server.tare.TareUtils.cakeToString; import android.annotation.NonNull; import android.annotation.Nullable; Loading Loading @@ -136,9 +137,15 @@ public class Scribe { @GuardedBy("mIrs.getLock()") void adjustRemainingConsumableCakesLocked(long delta) { if (delta != 0) { // No point doing any work if the change is 0. final long staleCakes = mRemainingConsumableCakes; mRemainingConsumableCakes += delta; if (mRemainingConsumableCakes < 0) { Slog.w(TAG, "Overdrew consumable cakes by " + cakeToString(-mRemainingConsumableCakes)); // A negative value would interfere with allowing free actions, so set the minimum as 0. mRemainingConsumableCakes = 0; } if (mRemainingConsumableCakes != staleCakes) { // No point doing any work if there was no functional change. postWrite(); } } Loading