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

Commit 68f93a1f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Enable offload queue based on flag value"

parents c9a6395b 0193e955
Loading
Loading
Loading
Loading
+9 −1
Original line number Original line Diff line number Diff line
@@ -549,6 +549,11 @@ public class ActivityManagerService extends IActivityManager.Stub
    // Whether we should use SCHED_FIFO for UI and RenderThreads.
    // Whether we should use SCHED_FIFO for UI and RenderThreads.
    boolean mUseFifoUiScheduling = false;
    boolean mUseFifoUiScheduling = false;
    // Use an offload queue for long broadcasts, e.g. BOOT_COMPLETED.
    // For simplicity, since we statically declare the size of the array of BroadcastQueues,
    // we still create this new offload queue, but never ever put anything on it.
    boolean mEnableOffloadQueue;
    BroadcastQueue mFgBroadcastQueue;
    BroadcastQueue mFgBroadcastQueue;
    BroadcastQueue mBgBroadcastQueue;
    BroadcastQueue mBgBroadcastQueue;
    BroadcastQueue mOffloadBroadcastQueue;
    BroadcastQueue mOffloadBroadcastQueue;
@@ -2283,6 +2288,9 @@ public class ActivityManagerService extends IActivityManager.Stub
        // by default, no "slow" policy in this queue
        // by default, no "slow" policy in this queue
        offloadConstants.SLOW_TIME = Integer.MAX_VALUE;
        offloadConstants.SLOW_TIME = Integer.MAX_VALUE;
        mEnableOffloadQueue = SystemProperties.getBoolean(
                "persist.device_config.activity_manager_native_boot.offload_queue_enabled", false);
        mFgBroadcastQueue = new BroadcastQueue(this, mHandler,
        mFgBroadcastQueue = new BroadcastQueue(this, mHandler,
                "foreground", foreConstants, false);
                "foreground", foreConstants, false);
        mBgBroadcastQueue = new BroadcastQueue(this, mHandler,
        mBgBroadcastQueue = new BroadcastQueue(this, mHandler,
@@ -18389,6 +18397,6 @@ public class ActivityManagerService extends IActivityManager.Stub
    }
    }
    private boolean isOnOffloadQueue(int flags) {
    private boolean isOnOffloadQueue(int flags) {
        return ((flags & Intent.FLAG_RECEIVER_OFFLOAD) != 0);
        return (mEnableOffloadQueue && ((flags & Intent.FLAG_RECEIVER_OFFLOAD) != 0));
    }
    }
}
}