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

Commit 33394eda authored by Achim Thesmann's avatar Achim Thesmann
Browse files

Replace get/setPendingIntentBackgroundActivityLaunchAllowedByPermission

Replace usages of the old get/setPendingIntentBackgroundActivityLaunchAllowedByPermission
API with the new replacement (passing in mode = ALWAYS).

Test: atest DragAndDropPolicyTest StageCoordinatorTests AlarmManagerServiceTest BackgroundActivityStartControllerExemptionTests BackgroundActivityStartControllerTests ActivityOptionsTest ActivityStarterTests BackgroundActivityLaunchTest
Flag: EXEMPT refactor
Bug: 352182359
Change-Id: I5e841bae14290219853d925adeb070de6508892b
parent 12b7d297
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -231,7 +231,6 @@ class LegacyActivityStarterInternalImplTest : SysuiTestCase() {
        // extra activity options to set on pending intent
        val activityOptions = mock(ActivityOptions::class.java)
        activityOptions.splashScreenStyle = SPLASH_SCREEN_STYLE_SOLID_COLOR
        activityOptions.isPendingIntentBackgroundActivityLaunchAllowedByPermission = false
        val bundleCaptor = argumentCaptor<Bundle>()

        startPendingIntentMaybeDismissingKeyguard(
@@ -255,7 +254,8 @@ class LegacyActivityStarterInternalImplTest : SysuiTestCase() {
                bundleCaptor.capture()
            )
        val options = ActivityOptions.fromBundle(bundleCaptor.firstValue)
        assertThat(options.isPendingIntentBackgroundActivityLaunchAllowedByPermission).isFalse()
        assertThat(options.getPendingIntentBackgroundActivityStartMode())
            .isEqualTo(ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS)
        assertThat(options.splashScreenStyle).isEqualTo(SPLASH_SCREEN_STYLE_SOLID_COLOR)
    }

+3 −3
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ package com.android.systemui.controls.ui

import android.app.Activity
import android.app.ActivityOptions
import android.app.ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED
import android.app.ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS
import android.app.Dialog
import android.app.PendingIntent
import android.content.ComponentName
@@ -93,8 +93,8 @@ class DetailDialog(
                0 /* enterResId */,
                0 /* exitResId */
            ).apply {
                pendingIntentBackgroundActivityStartMode = MODE_BACKGROUND_ACTIVITY_START_ALLOWED
                isPendingIntentBackgroundActivityLaunchAllowedByPermission = true
                pendingIntentBackgroundActivityStartMode =
                    MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS
                taskAlwaysOnTop = true
            }