summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server/input/InputManagerService.java
diff options
context:
space:
mode:
authorSvetoslav Ganov <svetoslavganov@google.com>2012-07-16 08:46:07 -0700
committerSvetoslav Ganov <svetoslavganov@google.com>2012-07-16 08:46:11 -0700
commitc9c9a48e7bafae63cb35a9aa69255e80aba83988 (patch)
tree80295bae9e6546d9d7fb604af0fa772ebd18a4fc /services/java/com/android/server/input/InputManagerService.java
parentdd0d0ba654cea3051e44ba9ae20ac4b269e123c0 (diff)
downloadframeworks_base-c9c9a48e7bafae63cb35a9aa69255e80aba83988.zip
frameworks_base-c9c9a48e7bafae63cb35a9aa69255e80aba83988.tar.gz
frameworks_base-c9c9a48e7bafae63cb35a9aa69255e80aba83988.tar.bz2
Removing a workaround for incorrect window position on window move.
1. The window manager was not notifying a window when the latter has been moved. This was causing incorrect coordinates of the nodes reported to accessibility services. To workaround that we have carried the correct window location when making a call from the accessibility layer into a window. Now the window manager notifies the window when it is moved and the workaround is no longer needed. This change takes it out. 2. The left and right in the attach info were not updated properly after a report that the window has moved. 3. The accessibility manager service was calling directly methods on the window manager service without going through the interface of the latter. This leads to unnecessary coupling and in the long rung increases system complexity and reduces maintability. bug:6623031 Change-Id: Iacb734b1bf337a47fad02c827ece45bb2f53a79d
Diffstat (limited to 'services/java/com/android/server/input/InputManagerService.java')
-rw-r--r--services/java/com/android/server/input/InputManagerService.java30
1 files changed, 22 insertions, 8 deletions
diff --git a/services/java/com/android/server/input/InputManagerService.java b/services/java/com/android/server/input/InputManagerService.java
index bdd0aa4..e7afb1a 100644
--- a/services/java/com/android/server/input/InputManagerService.java
+++ b/services/java/com/android/server/input/InputManagerService.java
@@ -42,8 +42,8 @@ import android.content.res.Resources.NotFoundException;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.database.ContentObserver;
-import android.hardware.input.IInputManager;
import android.hardware.input.IInputDevicesChangedListener;
+import android.hardware.input.IInputManager;
import android.hardware.input.InputManager;
import android.hardware.input.KeyboardLayout;
import android.os.Binder;
@@ -62,6 +62,8 @@ import android.util.Log;
import android.util.Slog;
import android.util.SparseArray;
import android.util.Xml;
+import android.view.IInputFilter;
+import android.view.IInputFilterHost;
import android.view.InputChannel;
import android.view.InputDevice;
import android.view.InputEvent;
@@ -137,7 +139,7 @@ public class InputManagerService extends IInputManager.Stub implements Watchdog.
// State for the currently installed input filter.
final Object mInputFilterLock = new Object();
- InputFilter mInputFilter; // guarded by mInputFilterLock
+ IInputFilter mInputFilter; // guarded by mInputFilterLock
InputFilterHost mInputFilterHost; // guarded by mInputFilterLock
private static native int nativeInit(InputManagerService service,
@@ -425,9 +427,9 @@ public class InputManagerService extends IInputManager.Stub implements Watchdog.
*
* @param filter The input filter, or null to remove the current filter.
*/
- public void setInputFilter(InputFilter filter) {
+ public void setInputFilter(IInputFilter filter) {
synchronized (mInputFilterLock) {
- final InputFilter oldFilter = mInputFilter;
+ final IInputFilter oldFilter = mInputFilter;
if (oldFilter == filter) {
return; // nothing to do
}
@@ -436,13 +438,21 @@ public class InputManagerService extends IInputManager.Stub implements Watchdog.
mInputFilter = null;
mInputFilterHost.disconnectLocked();
mInputFilterHost = null;
- oldFilter.uninstall();
+ try {
+ oldFilter.uninstall();
+ } catch (RemoteException re) {
+ /* ignore */
+ }
}
if (filter != null) {
mInputFilter = filter;
mInputFilterHost = new InputFilterHost();
- filter.install(mInputFilterHost);
+ try {
+ filter.install(mInputFilterHost);
+ } catch (RemoteException re) {
+ /* ignore */
+ }
}
nativeSetInputFilterEnabled(mPtr, filter != null);
@@ -1229,7 +1239,11 @@ public class InputManagerService extends IInputManager.Stub implements Watchdog.
final boolean filterInputEvent(InputEvent event, int policyFlags) {
synchronized (mInputFilterLock) {
if (mInputFilter != null) {
- mInputFilter.filterInputEvent(event, policyFlags);
+ try {
+ mInputFilter.filterInputEvent(event, policyFlags);
+ } catch (RemoteException e) {
+ /* ignore */
+ }
return false;
}
}
@@ -1447,7 +1461,7 @@ public class InputManagerService extends IInputManager.Stub implements Watchdog.
/**
* Hosting interface for input filters to call back into the input manager.
*/
- private final class InputFilterHost implements InputFilter.Host {
+ private final class InputFilterHost extends IInputFilterHost.Stub {
private boolean mDisconnected;
public void disconnectLocked() {