summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorMichael Wright <michaelwr@google.com>2016-05-26 14:38:56 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-05-26 14:38:56 +0000
commit28984d4d80affa52324f4c17caae30c6bc3bc3ab (patch)
tree8404d0a535db8a037966e8a7b4dfda7e1a901c5f /core/java
parent9b22e5b4e80e9daadf2af6430607016839e1909c (diff)
parentc396f0f70ef40ea0fb42a0872a13f4c4e9a6a5f0 (diff)
Merge "DO NOT MERGE Remove Pointer Capture API" into nyc-dev
am: c396f0f70e * commit 'c396f0f70ef40ea0fb42a0872a13f4c4e9a6a5f0': DO NOT MERGE Remove Pointer Capture API Change-Id: I77cb742feacdd3b8af0cf33d4e7ab246f776417f
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/hardware/input/IInputManager.aidl2
-rw-r--r--core/java/android/hardware/input/InputManager.java18
-rw-r--r--core/java/android/view/View.java52
-rw-r--r--core/java/android/view/ViewRootImpl.java32
4 files changed, 0 insertions, 104 deletions
diff --git a/core/java/android/hardware/input/IInputManager.aidl b/core/java/android/hardware/input/IInputManager.aidl
index 49c106e69d9f..a9c09c4bb58a 100644
--- a/core/java/android/hardware/input/IInputManager.aidl
+++ b/core/java/android/hardware/input/IInputManager.aidl
@@ -81,6 +81,4 @@ interface IInputManager {
void setPointerIconType(int typeId);
void setCustomPointerIcon(in PointerIcon icon);
-
- void setPointerIconDetached(boolean detached);
}
diff --git a/core/java/android/hardware/input/InputManager.java b/core/java/android/hardware/input/InputManager.java
index a5aeae331f84..803337b016f9 100644
--- a/core/java/android/hardware/input/InputManager.java
+++ b/core/java/android/hardware/input/InputManager.java
@@ -893,24 +893,6 @@ public final class InputManager {
}
}
- /**
- * Update the pointer icon status. When detached, the pointer icon disappears, and further
- * mouse location will be stuck at the current point. Mouse movement events will still arrive,
- * and movement should be handled through {@link MotionEvent.AXIS_RELATIVE_X} and
- * {@link MotionEvent.AXIS_RELATIVE_Y}.
- *
- * @param detached true if the icon will be detached from the actual mouse movement.
- *
- * @hide
- */
- public void setPointerIconDetached(boolean detached) {
- try {
- mIm.setPointerIconDetached(detached);
- } catch (RemoteException ex) {
- throw ex.rethrowFromSystemServer();
- }
- }
-
private void populateInputDevicesLocked() {
if (mInputDevicesChangedListener == null) {
final InputDevicesChangedListener listener = new InputDevicesChangedListener();
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index f1f4964b7b60..414882a3ed96 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -15262,7 +15262,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
destroyDrawingCache();
cleanupDraw();
- releasePointerCapture();
mCurrentAnimation = null;
}
@@ -21836,57 +21835,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
return mPointerIcon;
}
-
- /**
- * Request capturing further mouse events.
- *
- * When the view captures, the pointer icon will disappear and will not change its
- * position. Further pointer events will come to the capturing view, and the pointer movements
- * will can be detected through {@link MotionEvent#AXIS_RELATIVE_X} and
- * {@link MotionEvent#AXIS_RELATIVE_Y}. Non-mouse events (touchscreens, or stylus) will not
- * be affected.
- *
- * The capture will be released through {@link #releasePointerCapture()}, or will be lost
- * automatically when the view or containing window disappear.
- *
- * @return true when succeeds.
- * @see #releasePointerCapture()
- * @see #hasPointerCapture()
- */
- public void requestPointerCapture() {
- final ViewRootImpl viewRootImpl = getViewRootImpl();
- if (viewRootImpl != null) {
- viewRootImpl.requestPointerCapture(this);
- }
- }
-
-
- /**
- * Release the current capture of mouse events.
- *
- * If the view does not have the capture, it will do nothing.
- * @see #requestPointerCapture()
- * @see #hasPointerCapture()
- */
- public void releasePointerCapture() {
- final ViewRootImpl viewRootImpl = getViewRootImpl();
- if (viewRootImpl != null) {
- viewRootImpl.releasePointerCapture(this);
- }
- }
-
- /**
- * Checks the capture status of mouse events.
- *
- * @return true if the view has the capture.
- * @see #requestPointerCapture()
- * @see #hasPointerCapture()
- */
- public boolean hasPointerCapture() {
- final ViewRootImpl viewRootImpl = getViewRootImpl();
- return (viewRootImpl != null) && viewRootImpl.hasPointerCapture(this);
- }
-
//
// Properties
//
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 1c6600d0b3ac..d812cb42c671 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -3168,32 +3168,6 @@ public final class ViewRootImpl implements ViewParent,
}
}
- void requestPointerCapture(View view) {
- if (!mAttachInfo.mHasWindowFocus) {
- Log.w(mTag, "Can't set capture if it's not focused.");
- return;
- }
- if (mCapturingView == view) {
- return;
- }
- mCapturingView = view;
- InputManager.getInstance().setPointerIconDetached(true);
- return;
- }
-
- void releasePointerCapture(View view) {
- if (mCapturingView != view || mCapturingView == null) {
- return;
- }
-
- mCapturingView = null;
- InputManager.getInstance().setPointerIconDetached(false);
- }
-
- boolean hasPointerCapture(View view) {
- return view != null && mCapturingView == view;
- }
-
@Override
public void requestChildFocus(View child, View focused) {
if (DEBUG_INPUT_RESIZE) {
@@ -3271,10 +3245,6 @@ public final class ViewRootImpl implements ViewParent,
mView = null;
mAttachInfo.mRootView = null;
- if (mCapturingView != null) {
- releasePointerCapture(mCapturingView);
- }
-
mSurface.release();
if (mInputQueueCallback != null && mInputQueue != null) {
@@ -3615,8 +3585,6 @@ public final class ViewRootImpl implements ViewParent,
.softInputMode &=
~WindowManager.LayoutParams.SOFT_INPUT_IS_FORWARD_NAVIGATION;
mHasHadWindowFocus = true;
- } else if (mCapturingView != null) {
- releasePointerCapture(mCapturingView);
}
}
} break;