Merge "Block recent work profile apps content capture" into sc-dev

This commit is contained in:
Alex Johnston 2021-03-25 09:14:05 +00:00 committed by Android (Google) Code Review
commit ad4c83ad36
3 changed files with 5 additions and 4 deletions

View File

@ -96,7 +96,7 @@ public final class TaskOverlayFactoryGo extends TaskOverlayFactory {
}
getActionsView().updateDisabledFlags(DISABLED_ROTATED, rotated);
boolean isAllowedByPolicy = thumbnail.isRealSnapshot;
boolean isAllowedByPolicy = mThumbnailView.isRealSnapshot();
getActionsView().setCallbacks(new OverlayUICallbacksGoImpl(isAllowedByPolicy, task));
mTaskId = task.key.id;

View File

@ -176,7 +176,7 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
if (thumbnail != null) {
getActionsView().updateDisabledFlags(DISABLED_ROTATED, rotated);
boolean isAllowedByPolicy = thumbnail.isRealSnapshot;
boolean isAllowedByPolicy = mThumbnailView.isRealSnapshot();
getActionsView().setCallbacks(new OverlayUICallbacksImpl(isAllowedByPolicy, task));
}
}

View File

@ -440,13 +440,14 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc
}
/**
* Returns whether the snapshot is real.
* Returns whether the snapshot is real. If the device is locked for the user of the task,
* the snapshot used will be an app-theme generated snapshot instead of a real snapshot.
*/
public boolean isRealSnapshot() {
if (mThumbnailData == null) {
return false;
}
return mThumbnailData.isRealSnapshot;
return mThumbnailData.isRealSnapshot && !mTask.isLocked;
}
/**