Merge "Log ScreenshotEvent.SCREENSHOT_SAVED_TO_WORK_PROFILE" into tm-qpr-dev

This commit is contained in:
Matt Casey
2022-11-29 03:07:30 +00:00
committed by Android (Google) Code Review

View File

@@ -972,13 +972,8 @@ public class ScreenshotController {
if (imageData.uri != null) { if (imageData.uri != null) {
if (!imageData.owner.equals(Process.myUserHandle())) { if (!imageData.owner.equals(Process.myUserHandle())) {
// TODO: Handle non-primary user ownership (e.g. Work Profile) Log.d(TAG, "Screenshot saved to user " + imageData.owner + " as "
// This image is owned by another user. Special treatment will be + imageData.uri);
// required in the UI (badging) as well as sending intents which can
// correctly forward those URIs on to be read (actions).
Log.d(TAG, "*** Screenshot saved to a non-primary user ("
+ imageData.owner + ") as " + imageData.uri);
} }
mScreenshotHandler.post(() -> { mScreenshotHandler.post(() -> {
if (mScreenshotAnimation != null && mScreenshotAnimation.isRunning()) { if (mScreenshotAnimation != null && mScreenshotAnimation.isRunning()) {
@@ -1059,6 +1054,11 @@ public class ScreenshotController {
R.string.screenshot_failed_to_save_text); R.string.screenshot_failed_to_save_text);
} else { } else {
mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_SAVED, 0, mPackageName); mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_SAVED, 0, mPackageName);
if (mFlags.isEnabled(SCREENSHOT_WORK_PROFILE_POLICY)
&& mUserManager.isManagedProfile(imageData.owner.getIdentifier())) {
mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_SAVED_TO_WORK_PROFILE, 0,
mPackageName);
}
} }
} }