BroadcastQueue: temporarily unfreeze for parallel broadcasts am: 59b852c407
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12980152 Change-Id: I419cd16a919ea6e44c2b67f1e97e447b2399674d
This commit is contained in:
@@ -791,7 +791,10 @@ public final class BroadcastQueue {
|
|||||||
mService.updateOomAdjLocked(r.curApp, true,
|
mService.updateOomAdjLocked(r.curApp, true,
|
||||||
OomAdjuster.OOM_ADJ_REASON_START_RECEIVER);
|
OomAdjuster.OOM_ADJ_REASON_START_RECEIVER);
|
||||||
}
|
}
|
||||||
|
} else if (filter.receiverList.app != null) {
|
||||||
|
mService.mOomAdjuster.mCachedAppOptimizer.unfreezeTemporarily(filter.receiverList.app);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (DEBUG_BROADCAST_LIGHT) Slog.i(TAG_BROADCAST,
|
if (DEBUG_BROADCAST_LIGHT) Slog.i(TAG_BROADCAST,
|
||||||
"Delivering to " + filter + " : " + r);
|
"Delivering to " + filter + " : " + r);
|
||||||
@@ -1121,6 +1124,10 @@ public final class BroadcastQueue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sendResult) {
|
if (sendResult) {
|
||||||
|
if (r.callerApp != null) {
|
||||||
|
mService.mOomAdjuster.mCachedAppOptimizer.unfreezeTemporarily(
|
||||||
|
r.callerApp);
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
if (DEBUG_BROADCAST) {
|
if (DEBUG_BROADCAST) {
|
||||||
Slog.i(TAG_BROADCAST, "Finishing broadcast [" + mQueueName + "] "
|
Slog.i(TAG_BROADCAST, "Finishing broadcast [" + mQueueName + "] "
|
||||||
|
|||||||
@@ -720,6 +720,16 @@ public final class CachedAppOptimizer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This will ensure app will be out of the freezer for at least FREEZE_TIMEOUT_MS
|
||||||
|
void unfreezeTemporarily(ProcessRecord app) {
|
||||||
|
synchronized (mAm) {
|
||||||
|
if (app.frozen) {
|
||||||
|
unfreezeAppLocked(app);
|
||||||
|
freezeAppAsync(app);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@GuardedBy("mAm")
|
@GuardedBy("mAm")
|
||||||
void freezeAppAsync(ProcessRecord app) {
|
void freezeAppAsync(ProcessRecord app) {
|
||||||
mFreezeHandler.removeMessages(SET_FROZEN_PROCESS_MSG, app);
|
mFreezeHandler.removeMessages(SET_FROZEN_PROCESS_MSG, app);
|
||||||
|
|||||||
Reference in New Issue
Block a user