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

Commit 124f35bf authored by Wes Okuhara's avatar Wes Okuhara
Browse files

Screen capture: Guard settings button in toolbar behind feature flag

The settings button in the pre-capture UI toolbar controls screen
recording settings. Guard the visibility of the button behind a new
feature flag for screen recording on large screen devices.

Bug: 430991124
Test: Manually verify UI
Flag: com.android.systemui.large_screen_recording
Change-Id: Ie4cea4b12d9398d88e055e322dd31a9716dfe35c
parent 80b5b068
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1961,6 +1961,13 @@ flag {
    bug: "422833825"
}

flag {
    name: "large_screen_recording"
    namespace: "systemui"
    description: "Enables screen recording UI for large screen devices."
    bug: "423707369"
}

flag {
    name: "new_screen_record_toolbar"
    namespace: "systemui"
+2 −0
Original line number Diff line number Diff line
@@ -23,4 +23,6 @@ import javax.inject.Inject
@SysUISingleton
class ScreenCaptureRecordLargeScreenFeaturesInteractor @Inject constructor() {
    val appWindowRegionSupported = Flags.desktopScreenCaptureAppWindow()

    val screenRecordingSupported = Flags.largeScreenRecording()
}
+8 −6
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ fun PreCaptureToolbar(

    Toolbar(expanded = expanded, onCloseClick = onCloseClick, modifier = modifier) {
        Row {
            if (viewModel.screenRecordingSupported) {
                IconToggleButton(
                    checked = false,
                    onCheckedChange = {},
@@ -63,6 +64,7 @@ fun PreCaptureToolbar(
                ) {
                    viewModel.icons?.let { Icon(icon = it.moreOptions) }
                }
            }

            Spacer(Modifier.size(8.dp))

+2 −0
Original line number Diff line number Diff line
@@ -63,6 +63,8 @@ constructor(
    // TODO(b/423697394) Init default value to be user's previously selected option
    val captureRegion: ScreenCaptureRegion by captureRegionSource.hydratedStateOf()

    val screenRecordingSupported = featuresInteractor.screenRecordingSupported

    val captureTypeButtonViewModels: List<RadioButtonGroupItemViewModel> by
        combine(captureTypeSource, iconProvider.icons) { selectedType, icons ->
                generateCaptureTypeButtonViewModels(selectedType, icons)