Skip to content
This repository was archived by the owner on Feb 13, 2024. It is now read-only.

disable FLAG_SECURE #7

Open
wants to merge 1 commit into
base: anbox/master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions services/core/java/com/android/server/wm/WindowManagerService.java
Original file line number Diff line number Diff line change
Expand Up @@ -2332,20 +2332,21 @@ private void prepareNoneTransitionForRelaunching(AppWindowToken atoken) {
* Returns whether screen capture is disabled for all windows of a specific user.
*/
boolean isScreenCaptureDisabledLocked(int userId) {
Boolean disabled = mScreenCaptureDisabled.get(userId);
if (disabled == null) {
return false;
}
return disabled;
// Boolean disabled = mScreenCaptureDisabled.get(userId);
// if (disabled == null) {
// return false;
// }
// return disabled;
return false;
}

boolean isSecureLocked(WindowState w) {
if ((w.mAttrs.flags&WindowManager.LayoutParams.FLAG_SECURE) != 0) {
return true;
}
if (isScreenCaptureDisabledLocked(UserHandle.getUserId(w.mOwnerUid))) {
return true;
}
// if ((w.mAttrs.flags&WindowManager.LayoutParams.FLAG_SECURE) != 0) {
// return true;
// }
// if (isScreenCaptureDisabledLocked(UserHandle.getUserId(w.mOwnerUid))) {
// return true;
// }
return false;
}

Expand All @@ -2354,7 +2355,7 @@ boolean isSecureLocked(WindowState w) {
*/
@Override
public void setScreenCaptureDisabled(int userId, boolean disabled) {
int callingUid = Binder.getCallingUid();
/* int callingUid = Binder.getCallingUid();
if (callingUid != Process.SYSTEM_UID) {
throw new SecurityException("Only system can call setScreenCaptureDisabled.");
}
Expand All @@ -2371,7 +2372,7 @@ public void setScreenCaptureDisabled(int userId, boolean disabled) {
}
}
}
}
} */
}

private void setupWindowForRemoveOnExit(WindowState win) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1711,10 +1711,10 @@ void setOpaqueLocked(boolean isOpaque) {
}

void setSecureLocked(boolean isSecure) {
if (mSurfaceController == null) {
return;
}
mSurfaceController.setSecure(isSecure);
// if (mSurfaceController == null) {
// return;
// }
// mSurfaceController.setSecure(isSecure);
}

// This must be called while inside a transaction.
Expand Down