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

Commit c67d0196 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove Flag to clear allowlist duration" into main

parents 320410f4 47d6c81e
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ import static android.os.Process.SYSTEM_UID;

import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM;
import static com.android.server.am.ActivityManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.window.flags.Flags.balClearAllowlistDuration;

import android.annotation.IntDef;
import android.annotation.Nullable;
@@ -330,7 +329,7 @@ public final class PendingIntentRecord extends IIntentSender.Stub {
        mAllowBgActivityStartsForActivitySender.remove(token);
        mAllowBgActivityStartsForBroadcastSender.remove(token);
        mAllowBgActivityStartsForServiceSender.remove(token);
        if (mAllowlistDuration != null && balClearAllowlistDuration()) {
        if (mAllowlistDuration != null) {
            TempAllowListDuration duration = mAllowlistDuration.get(token);
            if (duration != null
                    && duration.type == TEMPORARY_ALLOWLIST_TYPE_FOREGROUND_SERVICE_ALLOWED) {
+1 −4
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ import static com.android.server.am.PendingIntentRecord.CANCEL_REASON_SUPERSEDED
import static com.android.server.am.PendingIntentRecord.CANCEL_REASON_USER_STOPPED;
import static com.android.server.am.PendingIntentRecord.FLAG_ACTIVITY_SENDER;
import static com.android.server.am.PendingIntentRecord.cancelReasonToString;
import static com.android.window.flags.Flags.balClearAllowlistDuration;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -216,9 +215,7 @@ public class PendingIntentControllerTest {
                pir.getAllowlistDurationLocked(token);
        assertNotNull(allowlistDurationLockedAfterClear);
        assertEquals(1000, allowlistDurationLockedAfterClear.duration);
        assertEquals(balClearAllowlistDuration()
                        ? TEMPORARY_ALLOWLIST_TYPE_FOREGROUND_SERVICE_NOT_ALLOWED
                        : TEMPORARY_ALLOWLIST_TYPE_FOREGROUND_SERVICE_ALLOWED,
        assertEquals(TEMPORARY_ALLOWLIST_TYPE_FOREGROUND_SERVICE_NOT_ALLOWED,
                allowlistDurationLocked.type);
    }