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

Commit b97b7f01 authored by Tony Mak's avatar Tony Mak Committed by Android (Google) Code Review
Browse files

Merge "Fix "ActivityTaskManager.requestAssistDataForTask crash on secondary user"" into main

parents 60a6ed0e fafd1f33
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -3522,10 +3522,15 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
            if (displayContent == null) {
                return false;
            }
            final long callingIdentity = Binder.clearCallingIdentity();
            try {
                hasRestrictedWindow = displayContent.forAllWindows(windowState -> {
                    return windowState.isOnScreen() && UserManager.isUserTypePrivateProfile(
                            getUserManager().getProfileType(windowState.mShowUserId));
                }, true /* traverseTopToBottom */);
            } finally {
                Binder.restoreCallingIdentity(callingIdentity);
            }
        }
        return DevicePolicyCache.getInstance().isScreenCaptureAllowed(userId)
                && !hasRestrictedWindow;