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

Commit c8d99bd6 authored by Chris Göllner's avatar Chris Göllner Committed by Android (Google) Code Review
Browse files

Merge "[Partial Screen Sharing] Fix default option when single app is disabled" into main

parents d9959c2d 6eb46586
Loading
Loading
Loading
Loading
+25 −17
Original line number Diff line number Diff line
@@ -80,12 +80,13 @@ class MediaProjectionPermissionDialogDelegate(
                    R.string.media_projection_entry_app_permission_dialog_warning_entire_screen
                }

            val singleAppDisabledText =
                if (
            val singleAppOptionDisabled =
                appName != null &&
                    mediaProjectionConfig?.regionToCapture ==
                        MediaProjectionConfig.CAPTURE_REGION_FIXED_DISPLAY
                ) {

            val singleAppDisabledText =
                if (singleAppOptionDisabled) {
                    context.getString(
                        R.string.media_projection_entry_app_permission_dialog_single_app_disabled,
                        appName
@@ -93,7 +94,8 @@ class MediaProjectionPermissionDialogDelegate(
                } else {
                    null
                }
            return listOf(
            val options =
                listOf(
                    ScreenShareOption(
                        mode = SINGLE_APP,
                        spinnerText = R.string.screen_share_permission_dialog_option_single_app,
@@ -106,6 +108,12 @@ class MediaProjectionPermissionDialogDelegate(
                        warningText = entireScreenWarningText
                    )
                )
            return if (singleAppOptionDisabled) {
                // Make sure "Entire screen" is the first option when "Single App" is disabled.
                options.reversed()
            } else {
                options
            }
        }
    }
}