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

Commit 65a4d059 authored by jian.tu's avatar jian.tu Committed by Mattias Nilsson
Browse files

Hide camera affordance when secure Camera is disabled

Camera is still visible on Lockscreen after device policy manager
has disabled it. We should only show the camera affordance when
secure camera is enabled.

Test: run android-testdpc apk
Bug: 298924179
Change-Id: I4eb6bf6a45b98c26c6832b0ffd0b9bf2f83f2444
parent 2cdda47d
Loading
Loading
Loading
Loading
+15 −10
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ import dagger.Lazy
import javax.inject.Inject
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.withContext

@SysUISingleton
@@ -59,8 +59,9 @@ constructor(
        get() = R.drawable.ic_camera

    override val lockScreenState: Flow<KeyguardQuickAffordanceConfig.LockScreenState>
        get() =
            flowOf(
        get() = flow {
            emit(
                if (isLaunchable()) {
                    KeyguardQuickAffordanceConfig.LockScreenState.Visible(
                        icon =
                            Icon.Resource(
@@ -68,7 +69,11 @@ constructor(
                                ContentDescription.Resource(R.string.accessibility_camera_button)
                            )
                    )
                } else {
                    KeyguardQuickAffordanceConfig.LockScreenState.Hidden
                }
            )
        }

    override suspend fun getPickerScreenState(): KeyguardQuickAffordanceConfig.PickerScreenState {
        return if (isLaunchable()) {