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

Commit 49a15802 authored by Matt Casey's avatar Matt Casey
Browse files

Log ScreenshotEvent.SCREENSHOT_SAVED_TO_WORK_PROFILE

Log after it's saved to a managed user.

Bug: 258490918
Test: Build, validate log
Change-Id: Ia1370c7a01153af6b99759ed95ddab7d2042b142
parent 9bb27a05
Loading
Loading
Loading
Loading
+7 −7
Original line number Original line Diff line number Diff line
@@ -968,13 +968,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()) {
@@ -1055,6 +1050,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);
            }
        }
        }
    }
    }