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

Commit 11db5f46 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "String update for screen recording" into main

parents c3ffeda4 b1dccbdd
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -289,8 +289,9 @@
    <!-- Screen recording permission option for recording just a single app [CHAR LIMIT=50] -->
    <string name="screenrecord_permission_dialog_option_text_single_app">Record one app</string>
    <!-- Screen recording permission option for recording the whole screen [CHAR LIMIT=50] -->
    <string name="screenrecord_permission_dialog_option_text_entire_screen" >Record entire screen</string>
    <string name="screenrecord_permission_dialog_option_text_entire_screen_for_display">Record entire screen: %s</string>
    <string name="screenrecord_permission_dialog_option_text_entire_screen" >Record this screen</string>
    <!-- Screen recording permission option for recording a connected external display. %s will be replaced by the display name [CHAR LIMIT=50] -->
    <string name="screenrecord_permission_dialog_option_text_entire_screen_for_display">Record %s</string>
    <!-- Message reminding the user that sensitive information may be captured during a full screen recording for the updated dialog that includes partial screen sharing option [CHAR_LIMIT=350]-->
    <string name="screenrecord_permission_dialog_warning_entire_screen">When you’re recording your entire screen, anything shown on your screen is recorded. So be careful with things like passwords, payment details, messages, photos, and audio and video.</string>
    <!-- Message reminding the user that sensitive information may be captured during a single app screen recording for the updated dialog that includes partial screen sharing option [CHAR_LIMIT=350]-->
+20 −28
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@ class ScreenRecordPermissionViewBinder(
    }

    companion object {

        private val RECORDABLE_DISPLAY_TYPES =
            intArrayOf(
                Display.TYPE_OVERLAY,
@@ -83,8 +84,10 @@ class ScreenRecordPermissionViewBinder(
                .mediaProjectionConnectedDisplayNoVirtualDevice()

        fun createOptionList(displayManager: DisplayManager): List<ScreenShareOption> {
            if (!com.android.media.projection.flags.Flags.mediaProjectionConnectedDisplay()) {
                return listOf(
            val connectedDisplays = getConnectedDisplays(displayManager)

            val options =
                mutableListOf(
                    ScreenShareOption(
                        SINGLE_APP,
                        R.string.screenrecord_permission_dialog_option_text_single_app,
@@ -103,33 +106,10 @@ class ScreenRecordPermissionViewBinder(
                        displayName = Build.MODEL,
                    ),
                )
            }

            return listOf(
                ScreenShareOption(
                    SINGLE_APP,
                    R.string.screenrecord_permission_dialog_option_text_single_app,
                    R.string.screenrecord_permission_dialog_warning_single_app,
                    startButtonText =
                        R.string
                            .media_projection_entry_generic_permission_dialog_continue_single_app,
                ),
                ScreenShareOption(
                    ENTIRE_SCREEN,
                    R.string.screenrecord_permission_dialog_option_text_entire_screen_for_display,
                    R.string.screenrecord_permission_dialog_warning_entire_screen,
                    startButtonText =
                        R.string.screenrecord_permission_dialog_continue_entire_screen,
                    displayId = Display.DEFAULT_DISPLAY,
                    displayName = Build.MODEL,
                ),
            ) +
                displayManager.displays
                    .filter {
                        it.displayId != Display.DEFAULT_DISPLAY &&
                            (!filterDeviceTypeFlag || it.type in RECORDABLE_DISPLAY_TYPES)
                    }
                    .map {
            if (connectedDisplays.isNotEmpty()) {
                options +=
                    connectedDisplays.map {
                        ScreenShareOption(
                            ENTIRE_SCREEN,
                            R.string
@@ -145,5 +125,17 @@ class ScreenRecordPermissionViewBinder(
                        )
                    }
            }
            return options.toList()
        }

        private fun getConnectedDisplays(displayManager: DisplayManager): List<Display> {
            if (!com.android.media.projection.flags.Flags.mediaProjectionConnectedDisplay()) {
                return emptyList()
            }
            return displayManager.displays.filter {
                it.displayId != Display.DEFAULT_DISPLAY &&
                    (!filterDeviceTypeFlag || it.type in RECORDABLE_DISPLAY_TYPES)
            }
        }
    }
}