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

Commit 7a059c29 authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[Screen share] Update strings for screen record dialog.

Bug: 352327853
Flag: NONE string changes
Test: Click screen record QS tile -> verify dialog has new strings for
both single app case and entire screen case
Test: atest ScreenRecordPermissionDialogDelegateTest

Change-Id: I0df0bd5f1561cd4b2b421e2452b47281d941df23
parent 201e52f0
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -280,13 +280,17 @@

    <!-- For updated Screen Recording permission dialog (i.e. with PSS)-->
    <!-- Title for the screen prompting the user to begin recording their screen [CHAR LIMIT=NONE]-->
    <string name="screenrecord_permission_dialog_title">Start Recording?</string>
    <string name="screenrecord_permission_dialog_title">Record your screen?</string>
    <!-- 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>
    <!-- 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">While you’re recording, Android has access to anything visible on your screen or played on your device. So be careful with things like passwords, payment details, messages, photos, and audio and video.</string>
    <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]-->
    <string name="screenrecord_permission_dialog_warning_single_app">While you’re recording an app, Android has access to anything shown or played on that app. So be careful with things like passwords, payment details, messages, photos, and audio and video.</string>
    <!-- Button to start a screen recording in the updated screen record dialog that allows to select an app to record [CHAR LIMIT=50]-->
    <string name="screenrecord_permission_dialog_continue">Start recording</string>
    <string name="screenrecord_permission_dialog_warning_single_app">When you’re recording an app, anything shown or played in that app is recorded. So be careful with things like passwords, payment details, messages, photos, and audio and video.</string>
    <!-- Button to start a screen recording of the entire screen in the updated screen record dialog that allows to select an app to record [CHAR LIMIT=50]-->
    <string name="screenrecord_permission_dialog_continue_entire_screen">Record screen</string>

    <!-- Label for a switch to enable recording audio [CHAR LIMIT=NONE]-->
    <string name="screenrecord_audio_label">Record audio</string>
@@ -1358,10 +1362,6 @@
    <!-- Media projection permission dialog warning text for system services. [CHAR LIMIT=NONE] -->
    <string name="media_projection_sys_service_dialog_warning">The service providing this function will have access to all of the information that is visible on your screen or played from your device while recording or casting. This includes information such as passwords, payment details, photos, messages, and audio that you play.</string>

    <!-- Permission dropdown option for sharing or recording the whole screen. [CHAR LIMIT=30] -->
    <string name="screen_share_permission_dialog_option_entire_screen">Entire screen</string>
    <!-- Permission dropdown option for sharing or recording single app. [CHAR LIMIT=30] -->
    <string name="screen_share_permission_dialog_option_single_app">A single app</string>
    <!-- Title of the dialog that allows to select an app to share or record [CHAR LIMIT=NONE] -->
    <string name="screen_share_permission_app_selector_title">Share or record an app</string>

+7 −4
Original line number Diff line number Diff line
@@ -270,15 +270,18 @@ class ScreenRecordPermissionDialogDelegate(
            return listOf(
                ScreenShareOption(
                    SINGLE_APP,
                    R.string.screen_share_permission_dialog_option_single_app,
                    R.string.screenrecord_permission_dialog_option_text_single_app,
                    R.string.screenrecord_permission_dialog_warning_single_app,
                    startButtonText = R.string.screenrecord_permission_dialog_continue,
                    startButtonText =
                        R.string
                            .media_projection_entry_generic_permission_dialog_continue_single_app,
                ),
                ScreenShareOption(
                    ENTIRE_SCREEN,
                    R.string.screen_share_permission_dialog_option_entire_screen,
                    R.string.screenrecord_permission_dialog_option_text_entire_screen,
                    R.string.screenrecord_permission_dialog_warning_entire_screen,
                    startButtonText = R.string.screenrecord_permission_dialog_continue,
                    startButtonText =
                        R.string.screenrecord_permission_dialog_continue_entire_screen,
                )
            )
        }
+32 −4
Original line number Diff line number Diff line
@@ -21,13 +21,13 @@ import android.os.UserHandle
import android.testing.TestableLooper
import android.view.View
import android.widget.Spinner
import android.widget.TextView
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.Dependency
import com.android.systemui.SysuiTestCase
import com.android.systemui.animation.DialogTransitionAnimator
import com.android.systemui.broadcast.BroadcastDispatcher
import com.android.systemui.flags.FeatureFlags
import com.android.systemui.mediaprojection.MediaProjectionMetricsLogger
import com.android.systemui.mediaprojection.appselector.MediaProjectionAppSelectorActivity
import com.android.systemui.mediaprojection.permission.ENTIRE_SCREEN
@@ -60,7 +60,6 @@ class ScreenRecordPermissionDialogDelegateTest : SysuiTestCase() {
    @Mock private lateinit var starter: ActivityStarter
    @Mock private lateinit var controller: RecordingController
    @Mock private lateinit var userContextProvider: UserContextProvider
    @Mock private lateinit var flags: FeatureFlags
    @Mock private lateinit var onStartRecordingClicked: Runnable
    @Mock private lateinit var mediaProjectionMetricsLogger: MediaProjectionMetricsLogger

@@ -127,6 +126,32 @@ class ScreenRecordPermissionDialogDelegateTest : SysuiTestCase() {
        assertThat(visibility).isEqualTo(View.VISIBLE)
    }

    @Test
    fun startButtonText_entireScreenSelected() {
        showDialog()

        onSpinnerItemSelected(ENTIRE_SCREEN)

        assertThat(getStartButton().text)
            .isEqualTo(
                context.getString(R.string.screenrecord_permission_dialog_continue_entire_screen)
            )
    }

    @Test
    fun startButtonText_singleAppSelected() {
        showDialog()

        onSpinnerItemSelected(SINGLE_APP)

        assertThat(getStartButton().text)
            .isEqualTo(
                context.getString(
                    R.string.media_projection_entry_generic_permission_dialog_continue_single_app
                )
            )
    }

    @Test
    fun startClicked_singleAppSelected_passesHostUidToAppSelector() {
        showDialog()
@@ -152,7 +177,8 @@ class ScreenRecordPermissionDialogDelegateTest : SysuiTestCase() {
        showDialog()

        val spinner = dialog.requireViewById<Spinner>(R.id.screen_share_mode_options)
        val singleApp = context.getString(R.string.screen_share_permission_dialog_option_single_app)
        val singleApp =
            context.getString(R.string.screenrecord_permission_dialog_option_text_single_app)
        assertEquals(spinner.adapter.getItem(0), singleApp)
    }

@@ -208,8 +234,10 @@ class ScreenRecordPermissionDialogDelegateTest : SysuiTestCase() {
        dialog.requireViewById<View>(android.R.id.button2).performClick()
    }

    private fun getStartButton() = dialog.requireViewById<TextView>(android.R.id.button1)

    private fun clickOnStart() {
        dialog.requireViewById<View>(android.R.id.button1).performClick()
        getStartButton().performClick()
    }

    private fun onSpinnerItemSelected(position: Int) {