summaryrefslogtreecommitdiffstats
path: root/cmds/wm
diff options
context:
space:
mode:
authorWale Ogunwale <ogunwale@google.com>2015-06-12 13:59:03 -0700
committerWale Ogunwale <ogunwale@google.com>2015-06-23 09:08:29 -0700
commitf5ad42f4324bfb7aa28f0967e2fcc89f55d6e91f (patch)
treea58068f3c2d1b97ae143c930c12a002beea076ab /cmds/wm
parentde1e281bbc062410a9079d2640b760271bde1043 (diff)
downloadframeworks_base-f5ad42f4324bfb7aa28f0967e2fcc89f55d6e91f.zip
frameworks_base-f5ad42f4324bfb7aa28f0967e2fcc89f55d6e91f.tar.gz
frameworks_base-f5ad42f4324bfb7aa28f0967e2fcc89f55d6e91f.tar.bz2
Update surfaces secure flag on screen capture setting change
Also, added 'wm screen-capture [userId] [true|false]' command. Bug: 20934462 Change-Id: I14711003d7691fc4495428c12c9ff3457cd3773c
Diffstat (limited to 'cmds/wm')
-rw-r--r--cmds/wm/src/com/android/commands/wm/Wm.java31
1 files changed, 28 insertions, 3 deletions
diff --git a/cmds/wm/src/com/android/commands/wm/Wm.java b/cmds/wm/src/com/android/commands/wm/Wm.java
index 64f023f..fb050e5 100644
--- a/cmds/wm/src/com/android/commands/wm/Wm.java
+++ b/cmds/wm/src/com/android/commands/wm/Wm.java
@@ -54,6 +54,7 @@ public class Wm extends BaseCommand {
" wm density [reset|DENSITY]\n" +
" wm overscan [reset|LEFT,TOP,RIGHT,BOTTOM]\n" +
" wm scaling [off|auto]\n" +
+ " wm screen-capture [userId] [true|false]\n" +
"\n" +
"wm size: return or override display size.\n" +
" width and height in pixels unless suffixed with 'dp'.\n" +
@@ -62,7 +63,9 @@ public class Wm extends BaseCommand {
"\n" +
"wm overscan: set overscan area for display.\n" +
"\n" +
- "wm scaling: set display scaling mode.\n"
+ "wm scaling: set display scaling mode.\n" +
+ "\n" +
+ "wm screen-capture: enable/disable screen capture.\n"
);
}
@@ -85,16 +88,39 @@ public class Wm extends BaseCommand {
runDisplayOverscan();
} else if (op.equals("scaling")) {
runDisplayScaling();
+ } else if (op.equals("screen-capture")) {
+ runSetScreenCapture();
} else {
showError("Error: unknown command '" + op + "'");
return;
}
}
+ private void runSetScreenCapture() throws Exception {
+ String userIdStr = nextArg();
+ String enableStr = nextArg();
+ int userId;
+ boolean disable;
+
+ try {
+ userId = Integer.parseInt(userIdStr);
+ } catch (NumberFormatException e) {
+ System.err.println("Error: bad number " + e);
+ return;
+ }
+
+ disable = !Boolean.parseBoolean(enableStr);
+
+ try {
+ mWm.setScreenCaptureDisabled(userId, disable);
+ } catch (RemoteException e) {
+ System.err.println("Error: Can't set screen capture " + e);
+ }
+ }
+
private void runDisplaySize() throws Exception {
String size = nextArg();
int w, h;
- boolean scale = true;
if (size == null) {
Point initialSize = new Point();
Point baseSize = new Point();
@@ -181,7 +207,6 @@ public class Wm extends BaseCommand {
private void runDisplayOverscan() throws Exception {
String overscanStr = nextArgRequired();
Rect rect = new Rect();
- int density;
if ("reset".equals(overscanStr)) {
rect.set(0, 0, 0, 0);
} else {