summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Miranda Kephart <mkephart@google.com> 2022-11-18 11:26:07 -0500
committer Miranda Kephart <mkephart@google.com> 2022-11-18 11:26:07 -0500
commitce07e8705f01cf2afc6bc89cb8bd85e308183f90 (patch)
tree588af83553013c118557cb24b01f57133e17e939
parent712b0bcd0a0b179b99d3de68001a1e42d2529fc1 (diff)
Announce saving screenshot to work profile
Guarded by the SCREENSHOT_WORK_PROFILE_POLICY flag. Bug: 258706100 Fix: 258706100 Test: manual (using talkback) Change-Id: I70af7253d8bb951cf64da3d024dd2a038db4ce99
-rw-r--r--packages/SystemUI/res/values/strings.xml2
-rw-r--r--packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java11
2 files changed, 11 insertions, 2 deletions
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index 400235ae4c0f..c5121b1f9f29 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -200,6 +200,8 @@
<!-- Informs the user that a screenshot is being saved. [CHAR LIMIT=50] -->
<string name="screenshot_saving_title">Saving screenshot\u2026</string>
+ <!-- Informs the user that a screenshot is being saved. [CHAR LIMIT=50] -->
+ <string name="screenshot_saving_work_profile_title">Saving screenshot to work profile\u2026</string>
<!-- Notification title displayed when a screenshot is saved to the Gallery. [CHAR LIMIT=50] -->
<string name="screenshot_saved_title">Screenshot saved</string>
<!-- Notification title displayed when we fail to take a screenshot. [CHAR LIMIT=50] -->
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java
index d94c8277b82c..3be2973f492a 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java
@@ -546,9 +546,16 @@ public class ScreenshotController {
private void saveScreenshot(Bitmap screenshot, Consumer<Uri> finisher, Rect screenRect,
Insets screenInsets, ComponentName topComponent, boolean showFlash, UserHandle owner) {
- withWindowAttached(() ->
+ withWindowAttached(() -> {
+ if (mFlags.isEnabled(SCREENSHOT_WORK_PROFILE_POLICY)
+ && mUserManager.isManagedProfile(owner.getIdentifier())) {
+ mScreenshotView.announceForAccessibility(mContext.getResources().getString(
+ R.string.screenshot_saving_work_profile_title));
+ } else {
mScreenshotView.announceForAccessibility(
- mContext.getResources().getString(R.string.screenshot_saving_title)));
+ mContext.getResources().getString(R.string.screenshot_saving_title));
+ }
+ });
mScreenshotView.reset();