|
86 | 86 | import android.service.dreams.IDreamManager; |
87 | 87 | import android.speech.RecognizerIntent; |
88 | 88 | import android.telecom.TelecomManager; |
89 | | -import android.service.gesture.EdgeGestureManager; |
90 | 89 | import com.android.internal.os.DeviceKeyHandler; |
91 | 90 |
|
92 | 91 | import com.android.internal.util.cm.ActionUtils; |
|
134 | 133 | import com.android.internal.policy.IKeyguardService; |
135 | 134 | import com.android.internal.statusbar.IStatusBarService; |
136 | 135 | import com.android.internal.util.ScreenShapeHelper; |
137 | | -import com.android.internal.util.gesture.EdgeGesturePosition; |
138 | | -import com.android.internal.util.gesture.EdgeServiceConstants; |
139 | 136 | import com.android.internal.view.RotationPolicy; |
140 | 137 | import com.android.internal.widget.PointerLocationView; |
141 | 138 | import com.android.server.GestureLauncherService; |
@@ -914,9 +911,6 @@ void observe() { |
914 | 911 | resolver.registerContentObserver(CMSettings.System.getUriFor( |
915 | 912 | CMSettings.System.VOLBTN_MUSIC_CONTROLS), false, this, |
916 | 913 | UserHandle.USER_ALL); |
917 | | - resolver.registerContentObserver(CMSettings.System.getUriFor( |
918 | | - CMSettings.System.USE_EDGE_SERVICE_FOR_GESTURES), false, this, |
919 | | - UserHandle.USER_ALL); |
920 | 914 | resolver.registerContentObserver(CMSettings.System.getUriFor( |
921 | 915 | CMSettings.System.BACK_WAKE_SCREEN), false, this, |
922 | 916 | UserHandle.USER_ALL); |
@@ -1039,67 +1033,6 @@ public void onProposedRotationChanged(int rotation) { |
1039 | 1033 | private SystemGesturesPointerEventListener mSystemGestures; |
1040 | 1034 | private OPGesturesListener mOPGestures; |
1041 | 1035 |
|
1042 | | - private EdgeGestureManager.EdgeGestureActivationListener mEdgeGestureActivationListener |
1043 | | - = new EdgeGestureManager.EdgeGestureActivationListener() { |
1044 | | - |
1045 | | - @Override |
1046 | | - public void onEdgeGestureActivation(int touchX, int touchY, |
1047 | | - EdgeGesturePosition position, int flags) { |
1048 | | - WindowState target = null; |
1049 | | - |
1050 | | - if (position == EdgeGesturePosition.TOP) { |
1051 | | - target = mStatusBar; |
1052 | | - } else if (position == EdgeGesturePosition.BOTTOM && mNavigationBarOnBottom) { |
1053 | | - target = mNavigationBar; |
1054 | | - } else if (position == EdgeGesturePosition.LEFT |
1055 | | - && !mNavigationBarOnBottom && mNavigationBarLeftInLandscape) { |
1056 | | - target = mNavigationBar; |
1057 | | - } else if (position == EdgeGesturePosition.RIGHT && !mNavigationBarOnBottom) { |
1058 | | - target = mNavigationBar; |
1059 | | - } |
1060 | | - |
1061 | | - if (target != null) { |
1062 | | - requestTransientBars(target); |
1063 | | - dropEventsUntilLift(); |
1064 | | - mEdgeListenerActivated = true; |
1065 | | - } else { |
1066 | | - restoreListenerState(); |
1067 | | - } |
1068 | | - } |
1069 | | - }; |
1070 | | - private EdgeGestureManager mEdgeGestureManager = null; |
1071 | | - private int mLastEdgePositions = 0; |
1072 | | - private boolean mEdgeListenerActivated = false; |
1073 | | - private boolean mUsingEdgeGestureServiceForGestures = false; |
1074 | | - |
1075 | | - private void updateEdgeGestureListenerState() { |
1076 | | - int flags = 0; |
1077 | | - if (mUsingEdgeGestureServiceForGestures) { |
1078 | | - flags = EdgeServiceConstants.LONG_LIVING | EdgeServiceConstants.UNRESTRICTED; |
1079 | | - if (mStatusBar != null && !mStatusBar.isVisibleLw()) { |
1080 | | - flags |= EdgeGesturePosition.TOP.FLAG; |
1081 | | - } |
1082 | | - if (mNavigationBar != null && !mNavigationBar.isVisibleLw() && !isStatusBarKeyguard() && !immersiveModeImplementsPie()) { |
1083 | | - if (mNavigationBarOnBottom) { |
1084 | | - flags |= EdgeGesturePosition.BOTTOM.FLAG; |
1085 | | - } else if (mNavigationBarLeftInLandscape) { |
1086 | | - flags |= EdgeGesturePosition.LEFT.FLAG; |
1087 | | - } else { |
1088 | | - flags |= EdgeGesturePosition.RIGHT.FLAG; |
1089 | | - } |
1090 | | - } |
1091 | | - } |
1092 | | - if (mEdgeListenerActivated) { |
1093 | | - mEdgeGestureActivationListener.restoreListenerState(); |
1094 | | - mEdgeListenerActivated = false; |
1095 | | - } |
1096 | | - if (flags != mLastEdgePositions) { |
1097 | | - mEdgeGestureManager.updateEdgeGestureActivationListener(mEdgeGestureActivationListener, |
1098 | | - flags); |
1099 | | - mLastEdgePositions = flags; |
1100 | | - } |
1101 | | - } |
1102 | | - |
1103 | 1036 | IStatusBarService getStatusBarService() { |
1104 | 1037 | synchronized (mServiceAquireLock) { |
1105 | 1038 | if (mStatusBarService == null) { |
@@ -2340,19 +2273,6 @@ public void updateSettings() { |
2340 | 2273 | updateWakeGestureListenerLp(); |
2341 | 2274 | } |
2342 | 2275 |
|
2343 | | - final boolean useEdgeService = CMSettings.System.getIntForUser(resolver, |
2344 | | - CMSettings.System.USE_EDGE_SERVICE_FOR_GESTURES, 0, UserHandle.USER_CURRENT) == 1; |
2345 | | - if (useEdgeService ^ mUsingEdgeGestureServiceForGestures && mSystemReady) { |
2346 | | - if (!mUsingEdgeGestureServiceForGestures && useEdgeService) { |
2347 | | - mUsingEdgeGestureServiceForGestures = true; |
2348 | | - mWindowManagerFuncs.unregisterPointerEventListener(mSystemGestures); |
2349 | | - } else if (mUsingEdgeGestureServiceForGestures && !useEdgeService) { |
2350 | | - mUsingEdgeGestureServiceForGestures = false; |
2351 | | - mWindowManagerFuncs.registerPointerEventListener(mSystemGestures); |
2352 | | - } |
2353 | | - updateEdgeGestureListenerState(); |
2354 | | - } |
2355 | | - |
2356 | 2276 | mNavigationBarLeftInLandscape = CMSettings.System.getIntForUser(resolver, |
2357 | 2277 | CMSettings.System.NAVBAR_LEFT_IN_LANDSCAPE, 0, UserHandle.USER_CURRENT) == 1; |
2358 | 2278 |
|
@@ -4294,8 +4214,6 @@ public int adjustSystemUiVisibilityLw(int visibility) { |
4294 | 4214 | mNavigationBarController.adjustSystemUiVisibilityLw(mLastSystemUiFlags, visibility); |
4295 | 4215 | mRecentsVisible = (visibility & View.RECENT_APPS_VISIBLE) > 0; |
4296 | 4216 |
|
4297 | | - updateEdgeGestureListenerState(); |
4298 | | - |
4299 | 4217 | // Reset any bits in mForceClearingStatusBarVisibility that |
4300 | 4218 | // are now clear. |
4301 | 4219 | mResettingSystemUiFlags &= visibility; |
@@ -5630,7 +5548,6 @@ public void run() { |
5630 | 5548 |
|
5631 | 5549 | // update since mAllowLockscreenWhenOn might have changed |
5632 | 5550 | updateLockScreenTimeout(); |
5633 | | - updateEdgeGestureListenerState(); |
5634 | 5551 | return changes; |
5635 | 5552 | } |
5636 | 5553 |
|
@@ -7281,9 +7198,6 @@ public void systemReady() { |
7281 | 7198 | mKeyguardDelegate = new KeyguardServiceDelegate(mContext); |
7282 | 7199 | mKeyguardDelegate.onSystemReady(); |
7283 | 7200 |
|
7284 | | - mEdgeGestureManager = EdgeGestureManager.getInstance(); |
7285 | | - mEdgeGestureManager.setEdgeGestureActivationListener(mEdgeGestureActivationListener); |
7286 | | - |
7287 | 7201 | readCameraLensCoverState(); |
7288 | 7202 | updateUiMode(); |
7289 | 7203 | boolean bindKeyguardNow; |
|
0 commit comments