Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99882bc4 authored by Kweku Adams's avatar Kweku Adams
Browse files

Cancel previous cutoffs.

Make sure to cancel previously scheduled cutoffs to make sure we don't
have duplicate and stale cutoffs in the queue.

Bug: 218216817
Test: atest FrameworksMockingServicesTests:QuotaControllerTest
Change-Id: I579d915adb0f00f8f6de73c39e65ac28b4246d76
parent 485c12cd
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -2169,7 +2169,7 @@ public final class QuotaController extends StateController {
                    }
                    scheduleCutoff();
                } else if (mRegularJobTimer && priorityLowered) {
                    scheduleCutoff();
                    rescheduleCutoff();
                }
            }
        }
@@ -2205,7 +2205,7 @@ public final class QuotaController extends StateController {
                                mRunningBgJobs.valueAt(i).getEffectivePriority());
                    }
                    if (mLowestPriority != oldPriority) {
                        scheduleCutoff();
                        rescheduleCutoff();
                    }
                }
            }
@@ -2705,7 +2705,7 @@ public final class QuotaController extends StateController {
                            if (DEBUG) {
                                Slog.d(TAG, pkg + " had early REACHED_QUOTA message");
                            }
                            mPkgTimers.get(pkg.userId, pkg.packageName).scheduleCutoff();
                            mPkgTimers.get(pkg.userId, pkg.packageName).rescheduleCutoff();
                        }
                        break;
                    }
@@ -2727,7 +2727,7 @@ public final class QuotaController extends StateController {
                            if (DEBUG) {
                                Slog.d(TAG, pkg + " had early REACHED_EJ_QUOTA message");
                            }
                            mEJPkgTimers.get(pkg.userId, pkg.packageName).scheduleCutoff();
                            mEJPkgTimers.get(pkg.userId, pkg.packageName).rescheduleCutoff();
                        }
                        break;
                    }