summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/java/android/service/gesture/EdgeGestureManager.java205
-rw-r--r--core/java/android/service/gesture/IEdgeGestureActivationListener.aidl14
-rw-r--r--core/java/android/service/gesture/IEdgeGestureHostCallback.aidl20
-rw-r--r--core/java/android/service/gesture/IEdgeGestureService.aidl20
-rw-r--r--core/java/android/service/gesture/package.html5
-rw-r--r--core/java/com/android/internal/util/gesture/EdgeGesturePosition.java42
-rw-r--r--core/java/com/android/internal/util/gesture/EdgeServiceConstants.java82
-rw-r--r--core/res/res/values/dimens.xml10
-rw-r--r--core/res/res/values/symbols.xml5
9 files changed, 0 insertions, 403 deletions
diff --git a/core/java/android/service/gesture/EdgeGestureManager.java b/core/java/android/service/gesture/EdgeGestureManager.java
deleted file mode 100644
index 7c0ab2e..0000000
--- a/core/java/android/service/gesture/EdgeGestureManager.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Copyright (C) 2013 The CyanogenMod Project (Jens Doll)
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package android.service.gesture;
-
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.Looper;
-import android.os.RemoteException;
-import android.os.ServiceManager;
-import android.service.gesture.IEdgeGestureActivationListener;
-import android.service.gesture.IEdgeGestureHostCallback;
-import android.service.gesture.IEdgeGestureService;
-import android.util.Slog;
-
-import com.android.internal.util.gesture.EdgeGesturePosition;
-
-/**
- * This is a simple Manager class for edge gesture service on the application side. The application need
- * {@code INJECT_EVENTS} permission to register {@code EdgeGestureActivationListener}s.<br>
- * See {@link android.service.gesture.IEdgeGestureService} for more information.
- *
- * @see android.service.gesture.IEdgeGestureService
- * @hide
- */
-public class EdgeGestureManager {
- public static final String TAG = "EdgeGestureManager";
- public static final boolean DEBUG = false;
-
- private static EdgeGestureManager sInstance;
-
- private final IEdgeGestureService mPs;
-
- public static abstract class EdgeGestureActivationListener {
- private Handler mHandler;
- private IEdgeGestureHostCallback mCallback;
-
- private class Delegator extends IEdgeGestureActivationListener.Stub {
- public void onEdgeGestureActivation(final int touchX, final int touchY, final int positionIndex, final int flags)
- throws RemoteException {
- mHandler.post(new Runnable() {
- public void run() {
- EdgeGestureActivationListener.this.onEdgeGestureActivation(touchX, touchY, EdgeGesturePosition.values()[positionIndex], flags);
- }
- });
- }
- }
- private Delegator mDelegator;
-
- public EdgeGestureActivationListener() {
- this(Looper.getMainLooper());
- }
-
- public EdgeGestureActivationListener(Looper looper) {
- mHandler = new Handler(looper);
- mDelegator = new Delegator();
- }
-
- /* package */ void setHostCallback(IEdgeGestureHostCallback hostCallback) {
- mCallback = hostCallback;
- }
-
- /**
- * Override this to receive activations from the edge gesture service.
- *
- * @param touchX the last X position a touch event was registered.
- * @param touchY the last Y position a touch event was registered.
- * @param position the position of the activation.
- * @param flags currently 0.
- * @see IEdgeGestureActivationListener#onEdgeGestureActivation(int, int, int, int)
- */
- public abstract void onEdgeGestureActivation(int touchX, int touchY, EdgeGesturePosition position, int flags);
-
- /**
- * After being activated, this allows the edge gesture control to steal focus from the current
- * window.
- *
- * @see IEdgeGestureHostCallback#gainTouchFocus(IBinder)
- */
- public boolean gainTouchFocus(IBinder applicationWindowToken) {
- try {
- return mCallback.gainTouchFocus(applicationWindowToken);
- } catch (RemoteException e) {
- Slog.w(TAG, "gainTouchFocus failed: " + e.getMessage());
- /* fall through */
- }
- return false;
- }
-
- public boolean dropEventsUntilLift() {
- try {
- return mCallback.dropEventsUntilLift();
- } catch (RemoteException e) {
- Slog.w(TAG, "dropNextEvents failed: " + e.getMessage());
- /* fall through */
- }
- return false;
- }
-
- /**
- * Turns listening for edge gesture activation gestures on again, after it was disabled during
- * the call to the listener.
- *
- * @see IEdgeGestureHostCallback#restoreListenerState()
- */
- public void restoreListenerState() {
- if (DEBUG) {
- Slog.d(TAG, "restore listener state: " + Thread.currentThread().getName());
- }
- try {
- mCallback.restoreListenerState();
- } catch (RemoteException e) {
- Slog.w(TAG, "restoreListenerState failed: " + e.getMessage());
- /* fall through */
- }
- }
- }
-
- private EdgeGestureManager(IEdgeGestureService ps) {
- mPs = ps;
- }
-
- /**
- * Gets an instance of the edge gesture manager.
- *
- * @return The edge gesture manager instance.
- * @hide
- */
- public static EdgeGestureManager getInstance() {
- synchronized (EdgeGestureManager.class) {
- if (sInstance == null) {
- IBinder b = ServiceManager.getService("edgegestureservice");
- sInstance = new EdgeGestureManager(IEdgeGestureService.Stub.asInterface(b));
- }
- return sInstance;
- }
- }
-
- /**
- * Checks if the edge gesture service is present.
- * <p>
- * Since the service is only started at boot time and is bound to the system server, this
- * is constant for the devices up time.
- *
- * @return {@code true} when the edge gesture service is running on this device.
- * @hide
- */
- public boolean isPresent() {
- return mPs != null;
- }
-
- /**
- * Register a listener for edge gesture activation gestures. Initially the listener
- * is set to listen for no position. Use updateedge gestureActivationListener() to
- * bind the listener to positions.
- *
- * @param listener is the activation listener.
- * @return {@code true} if the registration was successful.
- * @hide
- */
- public boolean setEdgeGestureActivationListener(EdgeGestureActivationListener listener) {
- if (DEBUG) {
- Slog.d(TAG, "Set edge gesture activation listener");
- }
- try {
- IEdgeGestureHostCallback callback = mPs.registerEdgeGestureActivationListener(listener.mDelegator);
- listener.setHostCallback(callback);
- return true;
- } catch (RemoteException e) {
- Slog.e(TAG, "Failed to set edge gesture activation listener: " + e.getMessage());
- return false;
- }
- }
-
- /**
- * Update the listener to react on gestures in the given positions.
- *
- * @param listener is a already registered listener.
- * @param positions is a bit mask describing the positions to listen to.
- * @hide
- */
- public void updateEdgeGestureActivationListener(EdgeGestureActivationListener listener, int positions) {
- if (DEBUG) {
- Slog.d(TAG, "Update edge gesture activation listener: 0x" + Integer.toHexString(positions));
- }
- try {
- mPs.updateEdgeGestureActivationListener(listener.mDelegator.asBinder(), positions);
- } catch (RemoteException e) {
- Slog.e(TAG, "Failed to update edge gesture activation listener: " + e.getMessage());
- }
- }
-
-}
diff --git a/core/java/android/service/gesture/IEdgeGestureActivationListener.aidl b/core/java/android/service/gesture/IEdgeGestureActivationListener.aidl
deleted file mode 100644
index 0c9b24a..0000000
--- a/core/java/android/service/gesture/IEdgeGestureActivationListener.aidl
+++ /dev/null
@@ -1,14 +0,0 @@
-
-package android.service.gesture;
-
-import android.view.InputEvent;
-
-/** @hide */
-interface IEdgeGestureActivationListener {
-
- /** Called when a gesture is detected that fits to the activation gesture. At this point in
- * time gesture detection is disabled. Call IEdgeGestureHostCallback.restoreState() to
- * recover from this.
- */
- oneway void onEdgeGestureActivation(int touchX, int touchY, int positionIndex, int flags);
-} \ No newline at end of file
diff --git a/core/java/android/service/gesture/IEdgeGestureHostCallback.aidl b/core/java/android/service/gesture/IEdgeGestureHostCallback.aidl
deleted file mode 100644
index c261550..0000000
--- a/core/java/android/service/gesture/IEdgeGestureHostCallback.aidl
+++ /dev/null
@@ -1,20 +0,0 @@
-package android.service.gesture;
-
-/** @hide */
-interface IEdgeGestureHostCallback {
-
- /** After being activated, this allows to steal focus from the current
- * window
- */
- boolean gainTouchFocus(IBinder windowToken);
-
- /** Turns listening for activation gestures on again, after it was disabled during
- * the call to the listener.
- */
- oneway void restoreListenerState();
-
- /*
- * Tells filter to drop all events till touch up
- */
- boolean dropEventsUntilLift();
-} \ No newline at end of file
diff --git a/core/java/android/service/gesture/IEdgeGestureService.aidl b/core/java/android/service/gesture/IEdgeGestureService.aidl
deleted file mode 100644
index 342cf71..0000000
--- a/core/java/android/service/gesture/IEdgeGestureService.aidl
+++ /dev/null
@@ -1,20 +0,0 @@
-package android.service.gesture;
-
-import android.service.gesture.IEdgeGestureActivationListener;
-import android.service.gesture.IEdgeGestureHostCallback;
-
-/** @hide */
-interface IEdgeGestureService {
-
- /** Register a listener for activation gestures. Initially the listener
- * is set to listen for no position. Use updateEdgeGestureActivationListener() to
- * bind the listener to positions.
- * Use the returned IEdgeGestureHostCallback to manipulate the state after activation.
- */
- IEdgeGestureHostCallback registerEdgeGestureActivationListener(in IEdgeGestureActivationListener listener);
-
- /** Update the listener to react on gestures in the given positions.
- */
- void updateEdgeGestureActivationListener(in IBinder listener, int positionFlags);
-
-} \ No newline at end of file
diff --git a/core/java/android/service/gesture/package.html b/core/java/android/service/gesture/package.html
deleted file mode 100644
index c9f96a6..0000000
--- a/core/java/android/service/gesture/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<body>
-
-{@hide}
-
-</body>
diff --git a/core/java/com/android/internal/util/gesture/EdgeGesturePosition.java b/core/java/com/android/internal/util/gesture/EdgeGesturePosition.java
deleted file mode 100644
index 01cfdea..0000000
--- a/core/java/com/android/internal/util/gesture/EdgeGesturePosition.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2013 The CyanogenMod Project (Jens Doll)
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.android.internal.util.gesture;
-
-/**
- * Defines the positions in which gestures may be recognized by the
- * edge gesture service.
- * This defines an index and an flag for each position.
- */
-public enum EdgeGesturePosition {
- LEFT(0, 0),
- BOTTOM(1, 1),
- RIGHT(2, 1),
- TOP(3, 0);
-
- EdgeGesturePosition(int index, int factor) {
- INDEX = index;
- FLAG = (0x01<<index);
- FACTOR = factor;
- }
-
- public final int INDEX;
- public final int FLAG;
- /**
- * This is 1 when the position is not at the axis (like {@link EdgeGesturePosition.RIGHT} is
- * at {@code Layout.getWidth()} not at {@code 0}).
- */
- public final int FACTOR;
-}
diff --git a/core/java/com/android/internal/util/gesture/EdgeServiceConstants.java b/core/java/com/android/internal/util/gesture/EdgeServiceConstants.java
deleted file mode 100644
index 4360086..0000000
--- a/core/java/com/android/internal/util/gesture/EdgeServiceConstants.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2013 The CyanogenMod Project (Jens Doll)
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.android.internal.util.gesture;
-
-/**
- * Constants needed for the edge gesture service.
- *
- * @see com.android.internal.util.gesture.EdgeGesturePosition
- */
-public final class EdgeServiceConstants {
-
- private EdgeServiceConstants() {
- // no object allowed
- }
-
- /**
- * Mask for coding positions within the flags of
- * {@code updateEdgeGestureActivationListener()}.
- * <p>
- * Positions are specified by {@code EdgeGesturePosition.FLAG}.
- */
- public static final int POSITION_MASK = 0x0000001f;
-
- /**
- * Mask for coding sensitivity within the flags of
- * {@code updateEdgeGestureActivationListener()}.
- * <p>
- * Sensitivity influences the speed of the swipe, the trigger area, and trigger distance that
- * is needed to activate the edge gesture.
- */
- public static final int SENSITIVITY_MASK = 0x70000000;
-
- /**
- * Number of bits to shift left, to get a integer within the {@link #SENSITIVITY_MASK}.
- */
- public static final int SENSITIVITY_SHIFT = 28;
-
- /**
- * No sensitivity specified at all, the service may choose a sensitivity level on its own.
- */
- public static final int SENSITIVITY_NONE = 0;
-
- /**
- * Default sensitivity, picked by the edge gesture service automatically.
- */
- public static final int SENSITIVITY_DEFAULT = 2;
-
- /**
- * Lowest valid sensitivity value.
- */
- public static final int SENSITIVITY_LOWEST = 1;
-
- /**
- * Highest sensitivity value.
- */
- public static final int SENSITIVITY_HIGHEST = 4;
-
- /**
- * Do not cut 10% area on th edges
- */
- public static final int UNRESTRICTED = 0x10;
-
- /**
- * This listener does not likes enabling/disabling filter
- * because it interrupt in motion events.
- */
- public static final int LONG_LIVING = 0x20;
-
-}
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index 59a73c6..7b828a2 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -406,16 +406,6 @@
<item type="dimen" format="integer" name="time_picker_column_start_material">0</item>
<item type="dimen" format="integer" name="time_picker_column_end_material">1</item>
- <!-- EdgeGesture service: Distance a swipe must travel to be recognized as swipe. -->
- <dimen name="edge_gesture_trigger_distance">12dp</dimen>
-
- <!-- EdgeGesture service: This is the distance a swipe can travel orthogonally to its actual swipe
- direction to be still recognized as swipe. -->
- <dimen name="edge_gesture_perpendicular_distance">15dp</dimen>
-
- <!-- EdgeGesture service: Thickness of the active trigger fields around the screen border -->
- <dimen name="edge_gesture_trigger_thickness">12dp</dimen>
-
<!-- Largest size an avatar might need to be drawn in the power menu user picker -->
<dimen name="global_actions_avatar_size">40dp</dimen>
</resources>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index f651182..b21d4c1 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2385,11 +2385,6 @@
<java-symbol type="drawable" name="ic_lock_settings" />
<java-symbol type="drawable" name="ic_lock_user" />
- <!-- EdgeGesture service -->
- <java-symbol type="dimen" name="edge_gesture_trigger_distance" />
- <java-symbol type="dimen" name="edge_gesture_perpendicular_distance" />
- <java-symbol type="dimen" name="edge_gesture_trigger_thickness" />
-
<!-- Developer settings - Kill app back press -->
<java-symbol type="string" name="app_killed_message" />