diff options
author | Jeff Brown <jeffbrown@google.com> | 2012-09-10 17:36:31 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2012-09-10 17:50:18 -0700 |
commit | 43aa15912891930833edfc101615a9c881de54a1 (patch) | |
tree | efc406d48cce0d3ae7e1b299ffba0c65646cb089 /cmds | |
parent | df46c637550b4c6f0543574cfbd544329f48f5c7 (diff) | |
download | frameworks_base-43aa15912891930833edfc101615a9c881de54a1.zip frameworks_base-43aa15912891930833edfc101615a9c881de54a1.tar.gz frameworks_base-43aa15912891930833edfc101615a9c881de54a1.tar.bz2 |
Allow adb shell am display-size to use bigger sizes.
We now support scaling the logical display to fit the
physical display, whatever size it is. So we can allow
adb shell am display-size to use more or less arbitrary sizes
although we do enforce an upper and lower bound to
protect the user.
Change-Id: I5fe6ba32ad1f9e4fbcd6915f7d36850b987bbcc0
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/am/src/com/android/commands/am/Am.java | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java index 89287ad..bc9e74e 100644 --- a/cmds/am/src/com/android/commands/am/Am.java +++ b/cmds/am/src/com/android/commands/am/Am.java @@ -1187,32 +1187,26 @@ public class Am { private void runDisplaySize() throws Exception { String size = nextArgRequired(); - int m, n; + int w, h; if ("reset".equals(size)) { - m = n = -1; + w = h = -1; } else { int div = size.indexOf('x'); if (div <= 0 || div >= (size.length()-1)) { System.err.println("Error: bad size " + size); return; } - String mstr = size.substring(0, div); - String nstr = size.substring(div+1); + String wstr = size.substring(0, div); + String hstr = size.substring(div+1); try { - m = Integer.parseInt(mstr); - n = Integer.parseInt(nstr); + w = Integer.parseInt(wstr); + h = Integer.parseInt(hstr); } catch (NumberFormatException e) { System.err.println("Error: bad number " + e); return; } } - if (m < n) { - int tmp = m; - m = n; - n = tmp; - } - IWindowManager wm = IWindowManager.Stub.asInterface(ServiceManager.checkService( Context.WINDOW_SERVICE)); if (wm == null) { @@ -1221,9 +1215,9 @@ public class Am { } try { - if (m >= 0 && n >= 0) { + if (w >= 0 && h >= 0) { // TODO(multidisplay): For now Configuration only applies to main screen. - wm.setForcedDisplaySize(Display.DEFAULT_DISPLAY, m, n); + wm.setForcedDisplaySize(Display.DEFAULT_DISPLAY, w, h); } else { wm.clearForcedDisplaySize(Display.DEFAULT_DISPLAY); } @@ -1444,7 +1438,7 @@ public class Am { " am clear-debug-app\n" + " am monitor [--gdb <port>]\n" + " am screen-compat [on|off] <PACKAGE>\n" + - " am display-size [reset|MxN]\n" + + " am display-size [reset|WxH]\n" + " am display-density [reset|DENSITY]\n" + " am to-uri [INTENT]\n" + " am to-intent-uri [INTENT]\n" + |