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

Commit ed4a70ad authored by Eghosa Ewansiha-Vlachavas's avatar Eghosa Ewansiha-Vlachavas Committed by Android (Google) Code Review
Browse files

Merge "Move ENABLE_MODALS_FULLSCREEN_WITH_PLATFORM_SIGNATURE to DesktopExperienceFlags" into main

parents c5e8aa35 182459bd
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -111,8 +111,6 @@ public enum DesktopModeFlags {
    ENABLE_INPUT_LAYER_TRANSITION_FIX(Flags::enableInputLayerTransitionFix, true),
    ENABLE_MINIMIZE_BUTTON(Flags::enableMinimizeButton, true),
    ENABLE_MODALS_FULLSCREEN_WITH_PERMISSIONS(Flags::enableModalsFullscreenWithPermission, true),
    ENABLE_MODALS_FULLSCREEN_WITH_PLATFORM_SIGNATURE(
            Flags::enableModalsFullscreenWithPlatformSignature, false),
    ENABLE_OPAQUE_BACKGROUND_FOR_TRANSPARENT_WINDOWS(
            Flags::enableOpaqueBackgroundForTransparentWindows, true),
    ENABLE_QUICKSWITCH_DESKTOP_SPLIT_BUGFIX(Flags::enableQuickswitchDesktopSplitBugfix, true),
+3 −2
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.Manifest.permission.SYSTEM_ALERT_WINDOW
import android.app.TaskInfo
import android.content.Context
import android.content.pm.PackageManager
import android.window.DesktopExperienceFlags
import android.window.DesktopModeFlags
import com.android.internal.R
import com.android.internal.policy.DesktopModeCompatUtils
@@ -131,12 +132,12 @@ class DesktopModeCompatPolicy(private val context: Context) {
        }
        // If the ENABLE_MODALS_FULLSCREEN_WITH_PERMISSIONS flag is disabled, make neutral condition
        // dependant on the ENABLE_MODALS_FULLSCREEN_WITH_PLATFORM_SIGNATURE flag.
        return !DesktopModeFlags.ENABLE_MODALS_FULLSCREEN_WITH_PLATFORM_SIGNATURE.isTrue
        return !DesktopExperienceFlags.ENABLE_MODALS_FULLSCREEN_WITH_PLATFORM_SIGNATURE.isTrue
    }

    // Checks if the app is signed with the platform signature.
    private fun hasPlatformSignature(task: TaskInfo): Boolean {
        if (DesktopModeFlags.ENABLE_MODALS_FULLSCREEN_WITH_PLATFORM_SIGNATURE.isTrue) {
        if (DesktopExperienceFlags.ENABLE_MODALS_FULLSCREEN_WITH_PLATFORM_SIGNATURE.isTrue) {
            return task.topActivityInfo?.applicationInfo?.isSignedWithPlatformKey ?: false
        }
        // If the ENABLE_MODALS_FULLSCREEN_WITH_PLATFORM_SIGNATURE flag is disabled, make neutral