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

Commit 676adec2 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Factor out broadcast "skip" policy.

Upcoming work will look at making significant changes to the
BroadcastQueue internals, so this change factors out the current
implementation to aid A/B testing.

This change migrates the existing "skip" logic into a dedicated
location where it can be shared.  This change is designed to be a
no-op refactoring with no actual behavior changes.

Bug: 243656033
Test: atest CtsContentTestCases:BroadcastReceiverTest
Change-Id: I8bc3e81286ba0b548533e60d4a47ceb43714f5b1
parent 95f8a8a1
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
/*
 * Copyright (C) 2012 The Android Open Source Project
 * Copyright (C) 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -33,9 +33,12 @@ import java.util.Set;
 * Queue of broadcast intents and associated bookkeeping.
 */
public abstract class BroadcastQueue {
    public static final String TAG = "BroadcastQueue";

    final ActivityManagerService mService;
    final Handler mHandler;
    final BroadcastConstants mConstants;
    final BroadcastSkipPolicy mSkipPolicy;
    final String mQueueName;

    BroadcastQueue(ActivityManagerService service, Handler handler,
@@ -44,6 +47,7 @@ public abstract class BroadcastQueue {
        mHandler = handler;
        mQueueName = name;
        mConstants = constants;
        mSkipPolicy = new BroadcastSkipPolicy(service);
    }

    void start(ContentResolver resolver) {
+7 −664

File changed.

Preview size limit exceeded, changes collapsed.

+715 −0

File added.

Preview size limit exceeded, changes collapsed.