Adding permission check for dumping visible windows
Bug: 157010495 Test: Verfied that 3P apps cant call this API Change-Id: I0dee93c82d33152fc54b6784970103c82a8ba6ef
This commit is contained in:
@@ -351,6 +351,11 @@ public class WindowManagerShellCommand extends ShellCommand {
|
||||
}
|
||||
|
||||
private int runDumpVisibleWindowViews(PrintWriter pw) {
|
||||
if (!mInternal.checkCallingPermission(android.Manifest.permission.DUMP,
|
||||
"runDumpVisibleWindowViews()")) {
|
||||
throw new SecurityException("Requires DUMP permission");
|
||||
}
|
||||
|
||||
try (ZipOutputStream out = new ZipOutputStream(getRawOutputStream())) {
|
||||
ArrayList<Pair<String, ByteTransferPipe>> requestList = new ArrayList<>();
|
||||
synchronized (mInternal.mGlobalLock) {
|
||||
|
||||
Reference in New Issue
Block a user