* commit '9f1ae4dc260d099834d386cf1d0074ff54b3f50f': Fix parole scheduling bugs.
This commit is contained in:
@@ -314,6 +314,8 @@ public class UsageStatsService extends SystemService implements
|
|||||||
mAppIdleParoled = paroled;
|
mAppIdleParoled = paroled;
|
||||||
if (DEBUG) Slog.d(TAG, "Changing paroled to " + mAppIdleParoled);
|
if (DEBUG) Slog.d(TAG, "Changing paroled to " + mAppIdleParoled);
|
||||||
if (paroled) {
|
if (paroled) {
|
||||||
|
postParoleEndTimeout();
|
||||||
|
} else {
|
||||||
mLastAppIdleParoledTime = checkAndGetTimeLocked();
|
mLastAppIdleParoledTime = checkAndGetTimeLocked();
|
||||||
postNextParoleTimeout();
|
postNextParoleTimeout();
|
||||||
}
|
}
|
||||||
@@ -404,8 +406,6 @@ public class UsageStatsService extends SystemService implements
|
|||||||
if (timeSinceLastParole > mAppIdleParoleIntervalMillis) {
|
if (timeSinceLastParole > mAppIdleParoleIntervalMillis) {
|
||||||
if (DEBUG) Slog.d(TAG, "Crossed default parole interval");
|
if (DEBUG) Slog.d(TAG, "Crossed default parole interval");
|
||||||
setAppIdleParoled(true);
|
setAppIdleParoled(true);
|
||||||
// Make sure it ends at some point
|
|
||||||
postParoleEndTimeout();
|
|
||||||
} else {
|
} else {
|
||||||
if (DEBUG) Slog.d(TAG, "Not long enough to go to parole");
|
if (DEBUG) Slog.d(TAG, "Not long enough to go to parole");
|
||||||
postNextParoleTimeout();
|
postNextParoleTimeout();
|
||||||
@@ -492,7 +492,6 @@ public class UsageStatsService extends SystemService implements
|
|||||||
if (!deviceIdle
|
if (!deviceIdle
|
||||||
&& timeSinceLastParole >= mAppIdleParoleIntervalMillis) {
|
&& timeSinceLastParole >= mAppIdleParoleIntervalMillis) {
|
||||||
if (DEBUG) Slog.i(TAG, "Bringing idle apps out of inactive state due to deviceIdleMode=false");
|
if (DEBUG) Slog.i(TAG, "Bringing idle apps out of inactive state due to deviceIdleMode=false");
|
||||||
postNextParoleTimeout();
|
|
||||||
setAppIdleParoled(true);
|
setAppIdleParoled(true);
|
||||||
} else if (deviceIdle) {
|
} else if (deviceIdle) {
|
||||||
if (DEBUG) Slog.i(TAG, "Device idle, back to prison");
|
if (DEBUG) Slog.i(TAG, "Device idle, back to prison");
|
||||||
|
|||||||
Reference in New Issue
Block a user