summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-05-19 16:15:46 -0700
committerRomain Guy <romainguy@google.com>2011-05-19 16:15:46 -0700
commit88b4f153e2be863d79f4d7f68af95e0f9375e4ec (patch)
tree217f76231d83005cdb38908888b76ebc50d18564 /services
parent51c07e717b4416dd338b0add3a3c94d1137366af (diff)
downloadframeworks_base-88b4f153e2be863d79f4d7f68af95e0f9375e4ec.zip
frameworks_base-88b4f153e2be863d79f4d7f68af95e0f9375e4ec.tar.gz
frameworks_base-88b4f153e2be863d79f4d7f68af95e0f9375e4ec.tar.bz2
Code cleanup.
Change-Id: Ia6ea04b83832db2f39e3168ef2596c24273a7ef3
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/wm/ViewServer.java25
1 files changed, 7 insertions, 18 deletions
diff --git a/services/java/com/android/server/wm/ViewServer.java b/services/java/com/android/server/wm/ViewServer.java
index 9fb35b9..70cb26a 100644
--- a/services/java/com/android/server/wm/ViewServer.java
+++ b/services/java/com/android/server/wm/ViewServer.java
@@ -73,19 +73,6 @@ class ViewServer implements Runnable {
private ExecutorService mThreadPool;
/**
- * Creates a new ViewServer associated with the specified window manager.
- * The server uses the default port {@link #VIEW_SERVER_DEFAULT_PORT}. The server
- * is not started by default.
- *
- * @param windowManager The window manager used to communicate with the views.
- *
- * @see #start()
- */
- ViewServer(WindowManagerService windowManager) {
- this(windowManager, VIEW_SERVER_DEFAULT_PORT);
- }
-
- /**
* Creates a new ViewServer associated with the specified window manager on the
* specified local port. The server is not started by default.
*
@@ -177,7 +164,7 @@ class ViewServer implements Runnable {
// Any uncaught exception will crash the system process
try {
Socket client = mServer.accept();
- if(mThreadPool != null) {
+ if (mThreadPool != null) {
mThreadPool.submit(new ViewServerWorker(client));
} else {
try {
@@ -220,6 +207,7 @@ class ViewServer implements Runnable {
private Socket mClient;
private boolean mNeedWindowListUpdate;
private boolean mNeedFocusedWindowUpdate;
+
public ViewServerWorker(Socket client) {
mClient = client;
mNeedWindowListUpdate = false;
@@ -255,7 +243,7 @@ class ViewServer implements Runnable {
result = mWindowManager.viewServerListWindows(mClient);
} else if (COMMAND_WINDOW_MANAGER_GET_FOCUS.equalsIgnoreCase(command)) {
result = mWindowManager.viewServerGetFocusedWindow(mClient);
- } else if(COMMAND_WINDOW_MANAGER_AUTOLIST.equalsIgnoreCase(command)) {
+ } else if (COMMAND_WINDOW_MANAGER_AUTOLIST.equalsIgnoreCase(command)) {
result = windowManagerAutolistLoop();
} else {
result = mWindowManager.viewServerWindowCommand(mClient,
@@ -263,7 +251,7 @@ class ViewServer implements Runnable {
}
if (!result) {
- Slog.w(LOG_TAG, "An error occured with the command: " + command);
+ Slog.w(LOG_TAG, "An error occurred with the command: " + command);
}
} catch(IOException e) {
Slog.w(LOG_TAG, "Connection error: ", e);
@@ -321,11 +309,11 @@ class ViewServer implements Runnable {
needFocusedWindowUpdate = true;
}
}
- if(needWindowListUpdate) {
+ if (needWindowListUpdate) {
out.write("LIST UPDATE\n");
out.flush();
}
- if(needFocusedWindowUpdate) {
+ if (needFocusedWindowUpdate) {
out.write("FOCUS UPDATE\n");
out.flush();
}
@@ -337,6 +325,7 @@ class ViewServer implements Runnable {
try {
out.close();
} catch (IOException e) {
+ // Ignore
}
}
mWindowManager.removeWindowChangeListener(this);