summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yu Shan <shanyu@google.com> 2024-03-13 22:38:18 +0000
committer Yu Shan <shanyu@google.com> 2024-03-13 22:50:24 +0000
commitcc00ed9ca3952f6af97052011642a155d4edb150 (patch)
tree180b87d3df6056d0c27a11fe04e9cde6d7378beb
parent29b699869c8237d08b0ddcdc58bcac3baa451c33 (diff)
Revert "Attach defer_outgoing_bcasts flag."
This reverts commit 29b699869c8237d08b0ddcdc58bcac3baa451c33. Reason for revert: the cause for b/329506600 Test: Apply the revert locally, observe gcar_emu booting up normally. Change-Id: Ifc525bf34cae178b70416c1255224596921852b4
-rw-r--r--services/core/java/com/android/server/am/BroadcastQueueModernImpl.java5
-rw-r--r--services/tests/mockingservicestests/src/com/android/server/am/BaseBroadcastQueueTest.java2
-rw-r--r--services/tests/mockingservicestests/src/com/android/server/am/BroadcastQueueTest.java5
3 files changed, 6 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/am/BroadcastQueueModernImpl.java b/services/core/java/com/android/server/am/BroadcastQueueModernImpl.java
index 0a6e9d3198cb..5521381e8908 100644
--- a/services/core/java/com/android/server/am/BroadcastQueueModernImpl.java
+++ b/services/core/java/com/android/server/am/BroadcastQueueModernImpl.java
@@ -286,6 +286,9 @@ class BroadcastQueueModernImpl extends BroadcastQueue {
// when the flag is fused on.
private static final int MSG_DELIVERY_TIMEOUT_SOFT = 8;
+ // TODO: Use the trunk stable flag.
+ private static final boolean DEFER_FROZEN_OUTGOING_BCASTS = false;
+
private void enqueueUpdateRunningList() {
mLocalHandler.removeMessages(MSG_UPDATE_RUNNING_LIST);
mLocalHandler.sendEmptyMessage(MSG_UPDATE_RUNNING_LIST);
@@ -763,7 +766,7 @@ class BroadcastQueueModernImpl extends BroadcastQueue {
// TODO: Apply delivery group policies and FLAG_REPLACE_PENDING to collapse the
// outgoing broadcasts.
// TODO: Add traces/logs for the enqueueing outgoing broadcasts logic.
- if (Flags.deferOutgoingBcasts() && isProcessFreezable(r.callerApp)) {
+ if (DEFER_FROZEN_OUTGOING_BCASTS && isProcessFreezable(r.callerApp)) {
final BroadcastProcessQueue queue = getOrCreateProcessQueue(
r.callerApp.processName, r.callerApp.uid);
if (queue.getOutgoingBroadcastCount() >= mConstants.MAX_FROZEN_OUTGOING_BROADCASTS) {
diff --git a/services/tests/mockingservicestests/src/com/android/server/am/BaseBroadcastQueueTest.java b/services/tests/mockingservicestests/src/com/android/server/am/BaseBroadcastQueueTest.java
index ce281daf41c4..bd20ae26821e 100644
--- a/services/tests/mockingservicestests/src/com/android/server/am/BaseBroadcastQueueTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/am/BaseBroadcastQueueTest.java
@@ -56,7 +56,6 @@ import com.android.server.wm.ActivityTaskManagerService;
import org.junit.Rule;
import org.mockito.Mock;
-import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import java.io.File;
@@ -161,7 +160,6 @@ public abstract class BaseBroadcastQueueTest {
realAms.mActivityTaskManager = new ActivityTaskManagerService(mContext);
realAms.mActivityTaskManager.initialize(null, null, mContext.getMainLooper());
realAms.mAtmInternal = spy(realAms.mActivityTaskManager.getAtmInternal());
- realAms.mOomAdjuster.mCachedAppOptimizer = Mockito.mock(CachedAppOptimizer.class);
realAms.mOomAdjuster = spy(realAms.mOomAdjuster);
ExtendedMockito.doNothing().when(() -> ProcessList.setOomAdj(anyInt(), anyInt(), anyInt()));
realAms.mPackageManagerInt = mPackageManagerInt;
diff --git a/services/tests/mockingservicestests/src/com/android/server/am/BroadcastQueueTest.java b/services/tests/mockingservicestests/src/com/android/server/am/BroadcastQueueTest.java
index 1172685c4466..66ab8076a217 100644
--- a/services/tests/mockingservicestests/src/com/android/server/am/BroadcastQueueTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/am/BroadcastQueueTest.java
@@ -86,6 +86,7 @@ import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.After;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.mockito.ArgumentMatcher;
import org.mockito.InOrder;
@@ -2334,8 +2335,8 @@ public class BroadcastQueueTest extends BaseBroadcastQueueTest {
.isGreaterThan(getReceiverScheduledTime(prioritizedRecord, receiverBlue));
}
+ @Ignore
@Test
- @RequiresFlagsEnabled(Flags.FLAG_DEFER_OUTGOING_BCASTS)
public void testDeferOutgoingBroadcasts() throws Exception {
final ProcessRecord callerApp = makeActiveProcessRecord(PACKAGE_RED);
setProcessFreezable(callerApp, true /* pendingFreeze */, false /* frozen */);
@@ -2349,8 +2350,6 @@ public class BroadcastQueueTest extends BaseBroadcastQueueTest {
makeRegisteredReceiver(receiverGreenApp),
makeManifestReceiver(PACKAGE_BLUE, CLASS_BLUE),
makeManifestReceiver(PACKAGE_YELLOW, CLASS_YELLOW))));
- // Verify that we invoke the call to freeze the caller app.
- verify(mAms.mOomAdjuster.mCachedAppOptimizer).freezeAppAsyncImmediateLSP(callerApp);
waitForIdle();
verifyScheduleRegisteredReceiver(never(), receiverGreenApp, timeTick);