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

Commit 383b26b7 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "QuickBoot: Support poweroff alarm under QuickBoot mode"

parents a839dd16 b726c37a
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1267,11 +1267,14 @@ class AlarmManagerService extends IAlarmManager.Stub {

    private void filtQuickBootAlarms(ArrayList<Alarm> triggerList) {

        ArrayList<String> whiteList = new ArrayList();
        whiteList.add("android");
        whiteList.add("com.android.deskclock");

        for (int i = triggerList.size() - 1; i >= 0; i--) {
            Alarm alarm = triggerList.get(i);

            // bypass system alarms
            if (!"android".equals(alarm.operation.getTargetPackage())) {
            if (!whiteList.contains(alarm.operation.getTargetPackage())) {
                triggerList.remove(i);
                Slog.v(TAG, "ignore -> " + alarm.operation.getTargetPackage());
            }
+13 −1
Original line number Diff line number Diff line
@@ -130,6 +130,7 @@ public final class BroadcastQueue {
     */
    int mPendingBroadcastRecvIndex;

    static ArrayList<String> quickbootWhiteList = null;
    static final int BROADCAST_INTENT_MSG = ActivityManagerService.FIRST_BROADCAST_QUEUE_MSG;
    static final int BROADCAST_TIMEOUT_MSG = ActivityManagerService.FIRST_BROADCAST_QUEUE_MSG + 1;

@@ -908,7 +909,8 @@ public final class BroadcastQueue {
                    "Need to start app ["
                    + mQueueName + "] " + targetProcess + " for broadcast " + r);
            if ((SystemProperties.getInt("sys.quickboot.enable", 0) == 1 &&
                        SystemProperties.getInt("sys.quickboot.poweron", 0) == 0)
                        SystemProperties.getInt("sys.quickboot.poweron", 0) == 0 &&
                       !getWhiteList().contains(info.activityInfo.applicationInfo.packageName))
                || (r.curApp=mService.startProcessLocked(targetProcess,
                    info.activityInfo.applicationInfo, true,
                    r.intent.getFlags() | Intent.FLAG_FROM_BACKGROUND,
@@ -934,6 +936,16 @@ public final class BroadcastQueue {
        }
    }

    private ArrayList<String> getWhiteList() {
        if (quickbootWhiteList == null) {
            quickbootWhiteList = new ArrayList();
            // allow legacy alarm app to be launched
            quickbootWhiteList.add("com.android.deskclock");
            quickbootWhiteList.add("com.qapp.quickboot");
        }
        return quickbootWhiteList;
    }

    final void setBroadcastTimeoutLocked(long timeoutTime) {
        if (! mPendingBroadcastTimeoutMessage) {
            Message msg = mHandler.obtainMessage(BROADCAST_TIMEOUT_MSG, this);