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

Commit 2da52a10 authored by Jeff DeCew's avatar Jeff DeCew
Browse files

[Minimal HUN] Add a developer setting to always show minimal HUN

Change-Id: I1e42639928f506b7bf87a56db7c6e9f526499bfd
Flag: android.app.compact_heads_up_notification
Test: manual
Bug: 339613087
parent 6f67bf71
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.statusbar.notification.row

import android.app.Flags
import android.os.SystemProperties
import com.android.systemui.statusbar.data.repository.StatusBarModeRepositoryStore
import javax.inject.Inject

@@ -34,8 +35,13 @@ constructor(private val statusBarModeRepositoryStore: StatusBarModeRepositorySto
    HeadsUpStyleProvider {

    override fun shouldApplyCompactStyle(): Boolean {
        // Use compact HUN for immersive mode.
        return Flags.compactHeadsUpNotification() &&
            statusBarModeRepositoryStore.defaultDisplay.isInFullscreenMode.value
        return Flags.compactHeadsUpNotification() && (isInImmersiveMode() || alwaysShow())
    }

    private fun isInImmersiveMode() =
        statusBarModeRepositoryStore.defaultDisplay.isInFullscreenMode.value

    /** developer setting to always show Minimal HUN, even if the device is not in full screen */
    private fun alwaysShow() =
        SystemProperties.getBoolean("persist.compact_heads_up_notification.always_show", false)
}