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

Commit e0cb1adc authored by Sudheer Shanka's avatar Sudheer Shanka Committed by Android (Google) Code Review
Browse files

Merge "Remove references to "modern" in broadcast queue impl." into main

parents 5a754450 e8e22774
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -757,9 +757,6 @@ public final class ActiveServices {
                Message msg = obtainMessage(MSG_BG_START_TIMEOUT);
                sendMessageAtTime(msg, when);
            }
            if (mStartingBackground.size() < mMaxStartingBackground) {
                mAm.backgroundServicesFinishedLocked(mUserId);
            }
        }
    }

+1 −5
Original line number Diff line number Diff line
@@ -14374,10 +14374,6 @@ public class ActivityManagerService extends IActivityManager.Stub
        mBroadcastController.unbroadcastIntent(caller, intent, userId);
    }
    void backgroundServicesFinishedLocked(int userId) {
        mBroadcastQueue.backgroundServicesFinishedLocked(userId);
    }
    public void finishReceiver(IBinder caller, int resultCode, String resultData,
            Bundle resultExtras, boolean resultAbort, int flags) {
        mBroadcastController.finishReceiver(caller, resultCode, resultData, resultExtras,
@@ -18936,7 +18932,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                    Settings.Global.BROADCAST_BG_CONSTANTS);
            backConstants.TIMEOUT = BROADCAST_BG_TIMEOUT;
            return new BroadcastQueueModernImpl(service, service.mHandler,
            return new BroadcastQueueImpl(service, service.mHandler,
                        foreConstants, backConstants);
        }
+17 −17
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ public class BroadcastConstants {
    public long ALLOW_BG_ACTIVITY_START_TIMEOUT = DEFAULT_ALLOW_BG_ACTIVITY_START_TIMEOUT;

    /**
     * For {@link BroadcastQueueModernImpl}: Maximum dispatch parallelism
     * For {@link BroadcastQueueImpl}: Maximum dispatch parallelism
     * that we'll tolerate for ordinary broadcast dispatch.
     */
    public int MAX_RUNNING_PROCESS_QUEUES = DEFAULT_MAX_RUNNING_PROCESS_QUEUES;
@@ -120,7 +120,7 @@ public class BroadcastConstants {
            ActivityManager.isLowRamDeviceStatic() ? 2 : 4;

    /**
     * For {@link BroadcastQueueModernImpl}: Additional running process queue parallelism beyond
     * For {@link BroadcastQueueImpl}: Additional running process queue parallelism beyond
     * {@link #MAX_RUNNING_PROCESS_QUEUES} for dispatch of "urgent" broadcasts.
     */
    public int EXTRA_RUNNING_URGENT_PROCESS_QUEUES = DEFAULT_EXTRA_RUNNING_URGENT_PROCESS_QUEUES;
@@ -129,7 +129,7 @@ public class BroadcastConstants {
    private static final int DEFAULT_EXTRA_RUNNING_URGENT_PROCESS_QUEUES = 1;

    /**
     * For {@link BroadcastQueueModernImpl}: Maximum number of consecutive urgent
     * For {@link BroadcastQueueImpl}: Maximum number of consecutive urgent
     * broadcast dispatches allowed before letting broadcasts in lower priority queue
     * to be scheduled in order to avoid starvation.
     */
@@ -139,7 +139,7 @@ public class BroadcastConstants {
    private static final int DEFAULT_MAX_CONSECUTIVE_URGENT_DISPATCHES = 3;

    /**
     * For {@link BroadcastQueueModernImpl}: Maximum number of consecutive normal
     * For {@link BroadcastQueueImpl}: Maximum number of consecutive normal
     * broadcast dispatches allowed before letting broadcasts in lower priority queue
     * to be scheduled in order to avoid starvation.
     */
@@ -149,7 +149,7 @@ public class BroadcastConstants {
    private static final int DEFAULT_MAX_CONSECUTIVE_NORMAL_DISPATCHES = 10;

    /**
     * For {@link BroadcastQueueModernImpl}: Maximum number of active broadcasts
     * For {@link BroadcastQueueImpl}: Maximum number of active broadcasts
     * to dispatch to a "running" process queue before we retire them back to
     * being "runnable" to give other processes a chance to run.
     */
@@ -160,7 +160,7 @@ public class BroadcastConstants {
            ActivityManager.isLowRamDeviceStatic() ? 8 : 16;

    /**
     * For {@link BroadcastQueueModernImpl}: Maximum number of active "blocking" broadcasts
     * For {@link BroadcastQueueImpl}: Maximum number of active "blocking" broadcasts
     * to dispatch to a "running" System process queue before we retire them back to
     * being "runnable" to give other processes a chance to run. Here "blocking" refers to
     * whether or not we are going to block on the finishReceiver() to be called before moving
@@ -173,7 +173,7 @@ public class BroadcastConstants {
            ActivityManager.isLowRamDeviceStatic() ? 8 : 16;

    /**
     * For {@link BroadcastQueueModernImpl}: Maximum number of active non-"blocking" broadcasts
     * For {@link BroadcastQueueImpl}: Maximum number of active non-"blocking" broadcasts
     * to dispatch to a "running" System process queue before we retire them back to
     * being "runnable" to give other processes a chance to run. Here "blocking" refers to
     * whether or not we are going to block on the finishReceiver() to be called before moving
@@ -187,7 +187,7 @@ public class BroadcastConstants {
            ActivityManager.isLowRamDeviceStatic() ? 32 : 64;

    /**
     * For {@link BroadcastQueueModernImpl}: Maximum number of pending
     * For {@link BroadcastQueueImpl}: Maximum number of pending
     * broadcasts to hold for a process before we ignore any delays that policy
     * might have applied to that process.
     */
@@ -197,7 +197,7 @@ public class BroadcastConstants {
            ActivityManager.isLowRamDeviceStatic() ? 128 : 256;

    /**
     * For {@link BroadcastQueueModernImpl}: Delay to apply to normal
     * For {@link BroadcastQueueImpl}: Delay to apply to normal
     * broadcasts, giving a chance for debouncing of rapidly changing events.
     */
    public long DELAY_NORMAL_MILLIS = DEFAULT_DELAY_NORMAL_MILLIS;
@@ -205,7 +205,7 @@ public class BroadcastConstants {
    private static final long DEFAULT_DELAY_NORMAL_MILLIS = +500;

    /**
     * For {@link BroadcastQueueModernImpl}: Delay to apply to broadcasts
     * For {@link BroadcastQueueImpl}: Delay to apply to broadcasts
     * targeting cached applications.
     */
    public long DELAY_CACHED_MILLIS = DEFAULT_DELAY_CACHED_MILLIS;
@@ -213,7 +213,7 @@ public class BroadcastConstants {
    private static final long DEFAULT_DELAY_CACHED_MILLIS = +120_000;

    /**
     * For {@link BroadcastQueueModernImpl}: Delay to apply to urgent
     * For {@link BroadcastQueueImpl}: Delay to apply to urgent
     * broadcasts, typically a negative value to indicate they should be
     * executed before most other pending broadcasts.
     */
@@ -222,7 +222,7 @@ public class BroadcastConstants {
    private static final long DEFAULT_DELAY_URGENT_MILLIS = -120_000;

    /**
     * For {@link BroadcastQueueModernImpl}: Delay to apply to broadcasts to
     * For {@link BroadcastQueueImpl}: Delay to apply to broadcasts to
     * foreground processes, typically a negative value to indicate they should be
     * executed before most other pending broadcasts.
     */
@@ -232,7 +232,7 @@ public class BroadcastConstants {
    private static final long DEFAULT_DELAY_FOREGROUND_PROC_MILLIS = -120_000;

    /**
     * For {@link BroadcastQueueModernImpl}: Delay to apply to broadcasts to
     * For {@link BroadcastQueueImpl}: Delay to apply to broadcasts to
     * persistent processes, typically a negative value to indicate they should be
     * executed before most other pending broadcasts.
     */
@@ -242,7 +242,7 @@ public class BroadcastConstants {
    private static final long DEFAULT_DELAY_PERSISTENT_PROC_MILLIS = -120_000;

    /**
     * For {@link BroadcastQueueModernImpl}: Maximum number of complete
     * For {@link BroadcastQueueImpl}: Maximum number of complete
     * historical broadcasts to retain for debugging purposes.
     */
    public int MAX_HISTORY_COMPLETE_SIZE = DEFAULT_MAX_HISTORY_COMPLETE_SIZE;
@@ -251,7 +251,7 @@ public class BroadcastConstants {
            ActivityManager.isLowRamDeviceStatic() ? 64 : 256;

    /**
     * For {@link BroadcastQueueModernImpl}: Maximum number of summarized
     * For {@link BroadcastQueueImpl}: Maximum number of summarized
     * historical broadcasts to retain for debugging purposes.
     */
    public int MAX_HISTORY_SUMMARY_SIZE = DEFAULT_MAX_HISTORY_SUMMARY_SIZE;
@@ -268,7 +268,7 @@ public class BroadcastConstants {
    private static final boolean DEFAULT_CORE_DEFER_UNTIL_ACTIVE = true;

    /**
     * For {@link BroadcastQueueModernImpl}: How frequently we should check for the pending
     * For {@link BroadcastQueueImpl}: How frequently we should check for the pending
     * cold start validity.
     */
    public long PENDING_COLD_START_CHECK_INTERVAL_MILLIS =
@@ -278,7 +278,7 @@ public class BroadcastConstants {
    private static final long DEFAULT_PENDING_COLD_START_CHECK_INTERVAL_MILLIS = 30_000;

    /**
     * For {@link BroadcastQueueModernImpl}: Maximum number of outgoing broadcasts from a
     * For {@link BroadcastQueueImpl}: Maximum number of outgoing broadcasts from a
     * freezable process that will be allowed before killing the process.
     */
    public int MAX_FROZEN_OUTGOING_BROADCASTS = DEFAULT_MAX_FROZEN_OUTGOING_BROADCASTS;
+5 −5
Original line number Diff line number Diff line
@@ -164,7 +164,7 @@ public class BroadcastHistory {

    @NeverCompile
    public boolean dumpLocked(@NonNull PrintWriter pw, @Nullable String dumpPackage,
            @Nullable String dumpIntentAction, @NonNull String queueName,
            @Nullable String dumpIntentAction,
            @NonNull SimpleDateFormat sdf, boolean dumpAll) {
        boolean needSep = true;
        dumpBroadcastList(pw, sdf, mFrozenBroadcasts, dumpIntentAction, dumpAll, "Frozen");
@@ -198,18 +198,18 @@ public class BroadcastHistory {
                    pw.println();
                }
                needSep = true;
                pw.println("  Historical broadcasts [" + queueName + "]:");
                pw.println("  Historical broadcasts:");
                printed = true;
            }
            if (dumpIntentAction != null) {
                pw.print("  Historical Broadcast " + queueName + " #");
                pw.print("  Historical Broadcast #");
                pw.print(i); pw.println(":");
                r.dump(pw, "    ", sdf);
                if (!dumpAll) {
                    break;
                }
            } else if (dumpAll) {
                pw.print("  Historical Broadcast " + queueName + " #");
                pw.print("  Historical Broadcast #");
                pw.print(i); pw.println(":");
                r.dump(pw, "    ", sdf);
            } else {
@@ -256,7 +256,7 @@ public class BroadcastHistory {
                        pw.println();
                    }
                    needSep = true;
                    pw.println("  Historical broadcasts summary [" + queueName + "]:");
                    pw.println("  Historical broadcasts summary:");
                    printed = true;
                }
                if (!dumpAll && i >= 50) {
+5 −5
Original line number Diff line number Diff line
@@ -453,7 +453,7 @@ class BroadcastProcessQueue {
     *
     * @return if this operation may have changed internal state, indicating
     *         that the caller is responsible for invoking
     *         {@link BroadcastQueueModernImpl#updateRunnableList}
     *         {@link BroadcastQueueImpl#updateRunnableList}
     */
    @CheckResult
    public boolean forEachMatchingBroadcast(@NonNull BroadcastPredicate predicate,
@@ -502,7 +502,7 @@ class BroadcastProcessQueue {
     *
     * @return if this operation may have changed internal state, indicating
     *         that the caller is responsible for invoking
     *         {@link BroadcastQueueModernImpl#updateRunnableList}
     *         {@link BroadcastQueueImpl#updateRunnableList}
     */
    @CheckResult
    public boolean setProcessAndUidState(@Nullable ProcessRecord app, boolean uidForeground,
@@ -837,7 +837,7 @@ class BroadcastProcessQueue {
    /**
     * @return if this operation may have changed internal state, indicating
     *         that the caller is responsible for invoking
     *         {@link BroadcastQueueModernImpl#updateRunnableList}
     *         {@link BroadcastQueueImpl#updateRunnableList}
     */
    @CheckResult
    boolean forceDelayBroadcastDelivery(long delayedDurationMs) {
@@ -921,7 +921,7 @@ class BroadcastProcessQueue {
     *
     * @return if this operation may have changed internal state, indicating
     *         that the caller is responsible for invoking
     *         {@link BroadcastQueueModernImpl#updateRunnableList}
     *         {@link BroadcastQueueImpl#updateRunnableList}
     */
    @CheckResult
    @VisibleForTesting
@@ -945,7 +945,7 @@ class BroadcastProcessQueue {
     *
     * @return if this operation may have changed internal state, indicating
     *         that the caller is responsible for invoking
     *         {@link BroadcastQueueModernImpl#updateRunnableList}
     *         {@link BroadcastQueueImpl#updateRunnableList}
     */
    @CheckResult
    boolean removePrioritizeEarliestRequest() {
Loading