summaryrefslogtreecommitdiffstats
path: root/cmds/am
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2013-02-15 16:32:56 -0800
committerDianne Hackborn <hackbod@google.com>2013-02-19 12:08:58 -0800
commitc652de8141f5b8e3c6bcf8916842b6e106413b1a (patch)
treed3be73e9b665365bdacd01cfc66faa24054f5a9c /cmds/am
parent736ef1e9dedbdd0c24e27f170034f2f869fd083f (diff)
downloadframeworks_base-c652de8141f5b8e3c6bcf8916842b6e106413b1a.zip
frameworks_base-c652de8141f5b8e3c6bcf8916842b6e106413b1a.tar.gz
frameworks_base-c652de8141f5b8e3c6bcf8916842b6e106413b1a.tar.bz2
Implement display overscan support.
The window manager now keeps track of the overscan of each display, with an API to set it. The overscan impacts how it positions windows in the display. There is a new set of APIs for windows to say they would like to go into the overscan region. There is a call into the window manager to set the overscan region for a display, and it now has a concept of display settings that it stores presistently. Also added a new "wm" command, moving the window manager specific commands from the "am" command to there and adding a new now to set the overscan region. Change-Id: Id2c8092db64fd0a982274fedac7658d82f30f9ff
Diffstat (limited to 'cmds/am')
-rw-r--r--cmds/am/src/com/android/commands/am/Am.java90
1 files changed, 1 insertions, 89 deletions
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java
index 3c1fbfe..9fa7dbb 100644
--- a/cmds/am/src/com/android/commands/am/Am.java
+++ b/cmds/am/src/com/android/commands/am/Am.java
@@ -26,7 +26,6 @@ import android.app.IInstrumentationWatcher;
import android.app.Instrumentation;
import android.app.UiAutomationConnection;
import android.content.ComponentName;
-import android.content.Context;
import android.content.IIntentReceiver;
import android.content.Intent;
import android.content.pm.IPackageManager;
@@ -39,7 +38,6 @@ import android.os.ServiceManager;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.util.AndroidException;
-import android.view.Display;
import android.view.IWindowManager;
import java.io.BufferedReader;
@@ -134,10 +132,6 @@ public class Am {
runMonitor();
} else if (op.equals("screen-compat")) {
runScreenCompat();
- } else if (op.equals("display-size")) {
- runDisplaySize();
- } else if (op.equals("display-density")) {
- runDisplayDensity();
} else if (op.equals("to-uri")) {
runToUri(false);
} else if (op.equals("to-intent-uri")) {
@@ -1201,82 +1195,6 @@ public class Am {
} while (packageName != null);
}
- private void runDisplaySize() throws Exception {
- String size = nextArgRequired();
- int w, h;
- if ("reset".equals(size)) {
- 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 wstr = size.substring(0, div);
- String hstr = size.substring(div+1);
- try {
- w = Integer.parseInt(wstr);
- h = Integer.parseInt(hstr);
- } catch (NumberFormatException e) {
- System.err.println("Error: bad number " + e);
- return;
- }
- }
-
- IWindowManager wm = IWindowManager.Stub.asInterface(ServiceManager.checkService(
- Context.WINDOW_SERVICE));
- if (wm == null) {
- System.err.println(NO_SYSTEM_ERROR_CODE);
- throw new AndroidException("Can't connect to window manager; is the system running?");
- }
-
- try {
- if (w >= 0 && h >= 0) {
- // TODO(multidisplay): For now Configuration only applies to main screen.
- wm.setForcedDisplaySize(Display.DEFAULT_DISPLAY, w, h);
- } else {
- wm.clearForcedDisplaySize(Display.DEFAULT_DISPLAY);
- }
- } catch (RemoteException e) {
- }
- }
-
- private void runDisplayDensity() throws Exception {
- String densityStr = nextArgRequired();
- int density;
- if ("reset".equals(densityStr)) {
- density = -1;
- } else {
- try {
- density = Integer.parseInt(densityStr);
- } catch (NumberFormatException e) {
- System.err.println("Error: bad number " + e);
- return;
- }
- if (density < 72) {
- System.err.println("Error: density must be >= 72");
- return;
- }
- }
-
- IWindowManager wm = IWindowManager.Stub.asInterface(ServiceManager.checkService(
- Context.WINDOW_SERVICE));
- if (wm == null) {
- System.err.println(NO_SYSTEM_ERROR_CODE);
- throw new AndroidException("Can't connect to window manager; is the system running?");
- }
-
- try {
- if (density > 0) {
- // TODO(multidisplay): For now Configuration only applies to main screen.
- wm.setForcedDisplayDensity(Display.DEFAULT_DISPLAY, density);
- } else {
- wm.clearForcedDisplayDensity(Display.DEFAULT_DISPLAY);
- }
- } catch (RemoteException e) {
- }
- }
-
private void runToUri(boolean intentScheme) throws Exception {
Intent intent = makeIntent(UserHandle.USER_CURRENT);
System.out.println(intent.toUri(intentScheme ? Intent.URI_INTENT_SCHEME : 0));
@@ -1454,8 +1372,6 @@ public class Am {
" am clear-debug-app\n" +
" am monitor [--gdb <port>]\n" +
" am screen-compat [on|off] <PACKAGE>\n" +
- " am display-size [reset|WxH]\n" +
- " am display-density [reset|DENSITY]\n" +
" am to-uri [INTENT]\n" +
" am to-intent-uri [INTENT]\n" +
" am switch-user <USER_ID>\n" +
@@ -1524,17 +1440,13 @@ public class Am {
"am clear-debug-app: clear the previously set-debug-app.\n" +
"\n" +
"am bug-report: request bug report generation; will launch UI\n" +
- " when done to select where it should be delivered." +
+ " when done to select where it should be delivered.\n" +
"\n" +
"am monitor: start monitoring for crashes or ANRs.\n" +
" --gdb: start gdbserv on the given port at crash/ANR\n" +
"\n" +
"am screen-compat: control screen compatibility mode of <PACKAGE>.\n" +
"\n" +
- "am display-size: override display size.\n" +
- "\n" +
- "am display-density: override display density.\n" +
- "\n" +
"am to-uri: print the given Intent specification as a URI.\n" +
"\n" +
"am to-intent-uri: print the given Intent specification as an intent: URI.\n" +