Merge "Revert "[Screen share] Update strings for screen record dialog."" into main
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index 483b53a..4bc4692 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -280,17 +280,13 @@
<!-- 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">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>
+ <string name="screenrecord_permission_dialog_title">Start Recording?</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>
+ <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>
<!-- 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">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>
+ <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>
<!-- Label for a switch to enable recording audio [CHAR LIMIT=NONE]-->
<string name="screenrecord_audio_label">Record audio</string>
@@ -1362,6 +1358,10 @@
<!-- 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>
diff --git a/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialogDelegate.kt b/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialogDelegate.kt
index 46ac54f..b54bf6c 100644
--- a/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialogDelegate.kt
+++ b/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialogDelegate.kt
@@ -270,18 +270,15 @@
return listOf(
ScreenShareOption(
SINGLE_APP,
- R.string.screenrecord_permission_dialog_option_text_single_app,
+ R.string.screen_share_permission_dialog_option_single_app,
R.string.screenrecord_permission_dialog_warning_single_app,
- startButtonText =
- R.string
- .media_projection_entry_generic_permission_dialog_continue_single_app,
+ startButtonText = R.string.screenrecord_permission_dialog_continue,
),
ScreenShareOption(
ENTIRE_SCREEN,
- R.string.screenrecord_permission_dialog_option_text_entire_screen,
+ R.string.screen_share_permission_dialog_option_entire_screen,
R.string.screenrecord_permission_dialog_warning_entire_screen,
- startButtonText =
- R.string.screenrecord_permission_dialog_continue_entire_screen,
+ startButtonText = R.string.screenrecord_permission_dialog_continue,
)
)
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialogDelegateTest.kt b/packages/SystemUI/tests/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialogDelegateTest.kt
index 7dae5cc..11b0bdf 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialogDelegateTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialogDelegateTest.kt
@@ -21,13 +21,13 @@
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,6 +60,7 @@
@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,32 +128,6 @@
}
@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()
onSpinnerItemSelected(SINGLE_APP)
@@ -177,8 +152,7 @@
showDialog()
val spinner = dialog.requireViewById<Spinner>(R.id.screen_share_mode_options)
- val singleApp =
- context.getString(R.string.screenrecord_permission_dialog_option_text_single_app)
+ val singleApp = context.getString(R.string.screen_share_permission_dialog_option_single_app)
assertEquals(spinner.adapter.getItem(0), singleApp)
}
@@ -234,10 +208,8 @@
dialog.requireViewById<View>(android.R.id.button2).performClick()
}
- private fun getStartButton() = dialog.requireViewById<TextView>(android.R.id.button1)
-
private fun clickOnStart() {
- getStartButton().performClick()
+ dialog.requireViewById<View>(android.R.id.button1).performClick()
}
private fun onSpinnerItemSelected(position: Int) {