Dianne Hackborn | f56e102 | 2011-02-22 10:47:13 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 15 | */ |
Dianne Hackborn | f56e102 | 2011-02-22 10:47:13 -0800 | [diff] [blame] | 16 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 17 | package com.android.server.wm; |
| 18 | |
Winson | 4127548 | 2016-10-10 15:17:45 -0700 | [diff] [blame] | 19 | import static android.view.WindowManager.INPUT_CONSUMER_PIP; |
| 20 | import static android.view.WindowManager.INPUT_CONSUMER_WALLPAPER; |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 21 | import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_DRAG; |
| 22 | import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_FOCUS_LIGHT; |
| 23 | import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_INPUT; |
| 24 | import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_TASK_POSITIONING; |
| 25 | import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; |
Filip Gruszczynski | 9cac3b4 | 2015-10-30 14:20:37 -0700 | [diff] [blame] | 26 | |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 27 | import android.app.ActivityManagerNative; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 28 | import android.graphics.Rect; |
Wale Ogunwale | e89eeac | 2016-03-12 11:07:58 -0800 | [diff] [blame] | 29 | import android.os.Debug; |
Winson | 4127548 | 2016-10-10 15:17:45 -0700 | [diff] [blame] | 30 | import android.os.Looper; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 31 | import android.os.RemoteException; |
Winson | 4127548 | 2016-10-10 15:17:45 -0700 | [diff] [blame] | 32 | import android.util.ArrayMap; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 33 | import android.util.Log; |
| 34 | import android.util.Slog; |
Jeff Brown | cc4f7db | 2011-08-30 20:34:48 -0700 | [diff] [blame] | 35 | import android.view.InputChannel; |
Winson | 4127548 | 2016-10-10 15:17:45 -0700 | [diff] [blame] | 36 | import android.view.InputEventReceiver; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 37 | import android.view.KeyEvent; |
| 38 | import android.view.WindowManager; |
| 39 | |
Winson | 4127548 | 2016-10-10 15:17:45 -0700 | [diff] [blame] | 40 | import android.view.WindowManagerPolicy; |
Selim Cinek | f83e824 | 2015-05-19 18:08:14 -0700 | [diff] [blame] | 41 | import com.android.server.input.InputApplicationHandle; |
| 42 | import com.android.server.input.InputManagerService; |
| 43 | import com.android.server.input.InputWindowHandle; |
| 44 | |
Wale Ogunwale | e89eeac | 2016-03-12 11:07:58 -0800 | [diff] [blame] | 45 | import java.io.PrintWriter; |
Jeff Brown | 9302c87 | 2011-07-13 22:51:29 -0700 | [diff] [blame] | 46 | import java.util.Arrays; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 47 | |
Jeff Brown | a9d131c | 2012-09-20 16:48:17 -0700 | [diff] [blame] | 48 | final class InputMonitor implements InputManagerService.WindowManagerCallbacks { |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 49 | private final WindowManagerService mService; |
Selim Cinek | f83e824 | 2015-05-19 18:08:14 -0700 | [diff] [blame] | 50 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 51 | // Current window with input focus for keys and other non-touch events. May be null. |
| 52 | private WindowState mInputFocus; |
Selim Cinek | f83e824 | 2015-05-19 18:08:14 -0700 | [diff] [blame] | 53 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 54 | // When true, prevents input dispatch from proceeding until set to false again. |
| 55 | private boolean mInputDispatchFrozen; |
Selim Cinek | f83e824 | 2015-05-19 18:08:14 -0700 | [diff] [blame] | 56 | |
Wale Ogunwale | e89eeac | 2016-03-12 11:07:58 -0800 | [diff] [blame] | 57 | // The reason the input is currently frozen or null if the input isn't frozen. |
| 58 | private String mInputFreezeReason = null; |
| 59 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 60 | // When true, input dispatch proceeds normally. Otherwise all events are dropped. |
Jeff Brown | c042ee2 | 2012-05-08 13:03:42 -0700 | [diff] [blame] | 61 | // Initially false, so that input does not get dispatched until boot is finished at |
| 62 | // which point the ActivityManager will enable dispatching. |
| 63 | private boolean mInputDispatchEnabled; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 64 | |
| 65 | // When true, need to call updateInputWindowsLw(). |
| 66 | private boolean mUpdateInputWindowsNeeded = true; |
| 67 | |
Jeff Brown | 9302c87 | 2011-07-13 22:51:29 -0700 | [diff] [blame] | 68 | // Array of window handles to provide to the input dispatcher. |
| 69 | private InputWindowHandle[] mInputWindowHandles; |
| 70 | private int mInputWindowHandleCount; |
| 71 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 72 | // Set to true when the first input device configuration change notification |
| 73 | // is received to indicate that the input devices are ready. |
| 74 | private final Object mInputDevicesReadyMonitor = new Object(); |
| 75 | private boolean mInputDevicesReady; |
| 76 | |
Winson | 4127548 | 2016-10-10 15:17:45 -0700 | [diff] [blame] | 77 | /** |
| 78 | * The set of input consumer added to the window manager by name, which consumes input events |
| 79 | * for the windows below it. |
| 80 | */ |
| 81 | private final ArrayMap<String, InputConsumerImpl> mInputConsumers = new ArrayMap(); |
| 82 | |
| 83 | private static final class EventReceiverInputConsumer extends InputConsumerImpl |
| 84 | implements WindowManagerPolicy.InputConsumer { |
| 85 | private InputMonitor mInputMonitor; |
| 86 | private final InputEventReceiver mInputEventReceiver; |
| 87 | |
| 88 | EventReceiverInputConsumer(WindowManagerService service, InputMonitor monitor, |
| 89 | Looper looper, String name, |
| 90 | InputEventReceiver.Factory inputEventReceiverFactory) { |
| 91 | super(service, name, null); |
| 92 | mInputMonitor = monitor; |
| 93 | mInputEventReceiver = inputEventReceiverFactory.createInputEventReceiver( |
| 94 | mClientChannel, looper); |
| 95 | } |
| 96 | |
| 97 | @Override |
| 98 | public void dismiss() { |
| 99 | synchronized (mService.mWindowMap) { |
| 100 | if (mInputMonitor.destroyInputConsumer(mWindowHandle.name)) { |
| 101 | mInputEventReceiver.dispose(); |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | } |
| 106 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 107 | public InputMonitor(WindowManagerService service) { |
| 108 | mService = service; |
| 109 | } |
Chong Zhang | 8e89b31 | 2015-09-09 15:09:30 -0700 | [diff] [blame] | 110 | |
Winson | 4127548 | 2016-10-10 15:17:45 -0700 | [diff] [blame] | 111 | void addInputConsumer(String name, InputConsumerImpl consumer) { |
| 112 | mInputConsumers.put(name, consumer); |
| 113 | updateInputWindowsLw(true /* force */); |
| 114 | } |
| 115 | |
| 116 | boolean destroyInputConsumer(String name) { |
| 117 | if (disposeInputConsumer(mInputConsumers.remove(name))) { |
| 118 | updateInputWindowsLw(true /* force */); |
| 119 | return true; |
| 120 | } |
| 121 | return false; |
| 122 | } |
| 123 | |
| 124 | private boolean disposeInputConsumer(InputConsumerImpl consumer) { |
| 125 | if (consumer != null) { |
| 126 | consumer.disposeChannelsLw(); |
| 127 | return true; |
| 128 | } |
| 129 | return false; |
| 130 | } |
| 131 | |
| 132 | InputConsumerImpl getInputConsumer(String name) { |
| 133 | return mInputConsumers.get(name); |
| 134 | } |
| 135 | |
| 136 | void layoutInputConsumers(int dw, int dh) { |
| 137 | for (int i = mInputConsumers.size() - 1; i >= 0; i--) { |
| 138 | mInputConsumers.valueAt(i).layout(dw, dh); |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | WindowManagerPolicy.InputConsumer createInputConsumer(Looper looper, String name, |
| 143 | InputEventReceiver.Factory inputEventReceiverFactory) { |
| 144 | if (mInputConsumers.containsKey(name)) { |
| 145 | throw new IllegalStateException("Existing input consumer found with name: " + name); |
| 146 | } |
| 147 | |
| 148 | final EventReceiverInputConsumer consumer = new EventReceiverInputConsumer(mService, |
| 149 | this, looper, name, inputEventReceiverFactory); |
| 150 | addInputConsumer(name, consumer); |
| 151 | return consumer; |
| 152 | } |
| 153 | |
| 154 | void createInputConsumer(String name, InputChannel inputChannel) { |
| 155 | if (mInputConsumers.containsKey(name)) { |
| 156 | throw new IllegalStateException("Existing input consumer found with name: " + name); |
| 157 | } |
| 158 | |
| 159 | final InputConsumerImpl consumer = new InputConsumerImpl(mService, name, inputChannel); |
| 160 | switch (name) { |
| 161 | case INPUT_CONSUMER_WALLPAPER: |
| 162 | consumer.mWindowHandle.hasWallpaper = true; |
| 163 | break; |
| 164 | case INPUT_CONSUMER_PIP: |
| 165 | // The touchable region of the Pip input window is cropped to the bounds of the |
| 166 | // stack, and we need FLAG_NOT_TOUCH_MODAL to ensure other events fall through |
| 167 | consumer.mWindowHandle.layoutParamsFlags |= |
| 168 | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL; |
| 169 | break; |
| 170 | } |
| 171 | addInputConsumer(name, consumer); |
| 172 | } |
| 173 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 174 | /* Notifies the window manager about a broken input channel. |
Chong Zhang | 8e89b31 | 2015-09-09 15:09:30 -0700 | [diff] [blame] | 175 | * |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 176 | * Called by the InputManager. |
| 177 | */ |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 178 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 179 | public void notifyInputChannelBroken(InputWindowHandle inputWindowHandle) { |
| 180 | if (inputWindowHandle == null) { |
| 181 | return; |
| 182 | } |
| 183 | |
| 184 | synchronized (mService.mWindowMap) { |
| 185 | WindowState windowState = (WindowState) inputWindowHandle.windowState; |
Jeff Brown | 9302c87 | 2011-07-13 22:51:29 -0700 | [diff] [blame] | 186 | if (windowState != null) { |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 187 | Slog.i(TAG_WM, "WINDOW DIED " + windowState); |
Wale Ogunwale | 92fc372 | 2016-08-05 12:19:08 -0700 | [diff] [blame] | 188 | windowState.removeIfPossible(); |
Jeff Brown | 9302c87 | 2011-07-13 22:51:29 -0700 | [diff] [blame] | 189 | } |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 190 | } |
| 191 | } |
Chong Zhang | 8e89b31 | 2015-09-09 15:09:30 -0700 | [diff] [blame] | 192 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 193 | /* Notifies the window manager about an application that is not responding. |
| 194 | * Returns a new timeout to continue waiting in nanoseconds, or 0 to abort dispatch. |
Chong Zhang | 8e89b31 | 2015-09-09 15:09:30 -0700 | [diff] [blame] | 195 | * |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 196 | * Called by the InputManager. |
| 197 | */ |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 198 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 199 | public long notifyANR(InputApplicationHandle inputApplicationHandle, |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 200 | InputWindowHandle inputWindowHandle, String reason) { |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 201 | AppWindowToken appWindowToken = null; |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 202 | WindowState windowState = null; |
| 203 | boolean aboveSystem = false; |
Jeff Brown | ee17241 | 2012-06-18 12:58:03 -0700 | [diff] [blame] | 204 | synchronized (mService.mWindowMap) { |
Jeff Brown | ee17241 | 2012-06-18 12:58:03 -0700 | [diff] [blame] | 205 | if (inputWindowHandle != null) { |
| 206 | windowState = (WindowState) inputWindowHandle.windowState; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 207 | if (windowState != null) { |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 208 | appWindowToken = windowState.mAppToken; |
| 209 | } |
| 210 | } |
Jeff Brown | ee17241 | 2012-06-18 12:58:03 -0700 | [diff] [blame] | 211 | if (appWindowToken == null && inputApplicationHandle != null) { |
| 212 | appWindowToken = (AppWindowToken)inputApplicationHandle.appWindowToken; |
Jeff Brown | 9302c87 | 2011-07-13 22:51:29 -0700 | [diff] [blame] | 213 | } |
Jeff Brown | ee17241 | 2012-06-18 12:58:03 -0700 | [diff] [blame] | 214 | |
| 215 | if (windowState != null) { |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 216 | Slog.i(TAG_WM, "Input event dispatching timed out " |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 217 | + "sending to " + windowState.mAttrs.getTitle() |
| 218 | + ". Reason: " + reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 219 | // Figure out whether this window is layered above system windows. |
| 220 | // We need to do this here to help the activity manager know how to |
| 221 | // layer its ANR dialog. |
| 222 | int systemAlertLayer = mService.mPolicy.windowTypeToLayerLw( |
| 223 | WindowManager.LayoutParams.TYPE_SYSTEM_ALERT); |
| 224 | aboveSystem = windowState.mBaseLayer > systemAlertLayer; |
Jeff Brown | ee17241 | 2012-06-18 12:58:03 -0700 | [diff] [blame] | 225 | } else if (appWindowToken != null) { |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 226 | Slog.i(TAG_WM, "Input event dispatching timed out " |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 227 | + "sending to application " + appWindowToken.stringName |
| 228 | + ". Reason: " + reason); |
Jeff Brown | ee17241 | 2012-06-18 12:58:03 -0700 | [diff] [blame] | 229 | } else { |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 230 | Slog.i(TAG_WM, "Input event dispatching timed out " |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 231 | + ". Reason: " + reason); |
Jeff Brown | ee17241 | 2012-06-18 12:58:03 -0700 | [diff] [blame] | 232 | } |
| 233 | |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 234 | mService.saveANRStateLocked(appWindowToken, windowState, reason); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 235 | } |
| 236 | |
| 237 | if (appWindowToken != null && appWindowToken.appToken != null) { |
| 238 | try { |
| 239 | // Notify the activity manager about the timeout and let it decide whether |
| 240 | // to abort dispatching or keep waiting. |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 241 | boolean abort = appWindowToken.appToken.keyDispatchingTimedOut(reason); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 242 | if (! abort) { |
| 243 | // The activity manager declined to abort dispatching. |
| 244 | // Wait a bit longer and timeout again later. |
| 245 | return appWindowToken.inputDispatchingTimeoutNanos; |
| 246 | } |
| 247 | } catch (RemoteException ex) { |
| 248 | } |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 249 | } else if (windowState != null) { |
| 250 | try { |
| 251 | // Notify the activity manager about the timeout and let it decide whether |
| 252 | // to abort dispatching or keep waiting. |
| 253 | long timeout = ActivityManagerNative.getDefault().inputDispatchingTimedOut( |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 254 | windowState.mSession.mPid, aboveSystem, reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 255 | if (timeout >= 0) { |
| 256 | // The activity manager declined to abort dispatching. |
| 257 | // Wait a bit longer and timeout again later. |
baik.han | def340d | 2015-04-15 10:21:05 +0900 | [diff] [blame] | 258 | return timeout * 1000000L; // nanoseconds |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 259 | } |
| 260 | } catch (RemoteException ex) { |
| 261 | } |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 262 | } |
| 263 | return 0; // abort dispatching |
| 264 | } |
| 265 | |
Wale Ogunwale | e05f501 | 2016-09-16 16:27:29 -0700 | [diff] [blame] | 266 | void addInputWindowHandle(final InputWindowHandle windowHandle) { |
Jeff Brown | 9302c87 | 2011-07-13 22:51:29 -0700 | [diff] [blame] | 267 | if (mInputWindowHandles == null) { |
| 268 | mInputWindowHandles = new InputWindowHandle[16]; |
| 269 | } |
| 270 | if (mInputWindowHandleCount >= mInputWindowHandles.length) { |
| 271 | mInputWindowHandles = Arrays.copyOf(mInputWindowHandles, |
| 272 | mInputWindowHandleCount * 2); |
| 273 | } |
| 274 | mInputWindowHandles[mInputWindowHandleCount++] = windowHandle; |
| 275 | } |
| 276 | |
Wale Ogunwale | e05f501 | 2016-09-16 16:27:29 -0700 | [diff] [blame] | 277 | void addInputWindowHandle(final InputWindowHandle inputWindowHandle, |
Craig Mautner | c08eab8 | 2014-11-11 09:03:59 -0800 | [diff] [blame] | 278 | final WindowState child, int flags, final int type, final boolean isVisible, |
Wale Ogunwale | 053c8e4 | 2015-11-16 14:27:21 -0800 | [diff] [blame] | 279 | final boolean hasFocus, final boolean hasWallpaper) { |
Dianne Hackborn | a4b7f2f | 2012-05-21 11:28:41 -0700 | [diff] [blame] | 280 | // Add a window to our list of input windows. |
| 281 | inputWindowHandle.name = child.toString(); |
Wale Ogunwale | 053c8e4 | 2015-11-16 14:27:21 -0800 | [diff] [blame] | 282 | flags = child.getTouchableRegion(inputWindowHandle.touchableRegion, flags); |
Dianne Hackborn | a4b7f2f | 2012-05-21 11:28:41 -0700 | [diff] [blame] | 283 | inputWindowHandle.layoutParamsFlags = flags; |
| 284 | inputWindowHandle.layoutParamsType = type; |
| 285 | inputWindowHandle.dispatchingTimeoutNanos = child.getInputDispatchingTimeoutNanos(); |
| 286 | inputWindowHandle.visible = isVisible; |
| 287 | inputWindowHandle.canReceiveKeys = child.canReceiveKeys(); |
| 288 | inputWindowHandle.hasFocus = hasFocus; |
| 289 | inputWindowHandle.hasWallpaper = hasWallpaper; |
| 290 | inputWindowHandle.paused = child.mAppToken != null ? child.mAppToken.paused : false; |
| 291 | inputWindowHandle.layer = child.mLayer; |
| 292 | inputWindowHandle.ownerPid = child.mSession.mPid; |
| 293 | inputWindowHandle.ownerUid = child.mSession.mUid; |
| 294 | inputWindowHandle.inputFeatures = child.mAttrs.inputFeatures; |
| 295 | |
| 296 | final Rect frame = child.mFrame; |
| 297 | inputWindowHandle.frameLeft = frame.left; |
| 298 | inputWindowHandle.frameTop = frame.top; |
| 299 | inputWindowHandle.frameRight = frame.right; |
| 300 | inputWindowHandle.frameBottom = frame.bottom; |
| 301 | |
| 302 | if (child.mGlobalScale != 1) { |
| 303 | // If we are scaling the window, input coordinates need |
| 304 | // to be inversely scaled to map from what is on screen |
| 305 | // to what is actually being touched in the UI. |
| 306 | inputWindowHandle.scaleFactor = 1.0f/child.mGlobalScale; |
| 307 | } else { |
| 308 | inputWindowHandle.scaleFactor = 1; |
| 309 | } |
| 310 | |
Filip Gruszczynski | f8a2a63 | 2015-10-28 11:18:02 -0700 | [diff] [blame] | 311 | if (DEBUG_INPUT) { |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 312 | Slog.d(TAG_WM, "addInputWindowHandle: " |
Chong Zhang | b15758a | 2015-11-17 12:12:03 -0800 | [diff] [blame] | 313 | + child + ", " + inputWindowHandle); |
Filip Gruszczynski | f8a2a63 | 2015-10-28 11:18:02 -0700 | [diff] [blame] | 314 | } |
Wale Ogunwale | e05f501 | 2016-09-16 16:27:29 -0700 | [diff] [blame] | 315 | addInputWindowHandle(inputWindowHandle); |
Dianne Hackborn | a4b7f2f | 2012-05-21 11:28:41 -0700 | [diff] [blame] | 316 | } |
| 317 | |
Jeff Brown | 9302c87 | 2011-07-13 22:51:29 -0700 | [diff] [blame] | 318 | private void clearInputWindowHandlesLw() { |
| 319 | while (mInputWindowHandleCount != 0) { |
| 320 | mInputWindowHandles[--mInputWindowHandleCount] = null; |
| 321 | } |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 322 | } |
| 323 | |
| 324 | public void setUpdateInputWindowsNeededLw() { |
| 325 | mUpdateInputWindowsNeeded = true; |
| 326 | } |
| 327 | |
| 328 | /* Updates the cached window information provided to the input dispatcher. */ |
| 329 | public void updateInputWindowsLw(boolean force) { |
| 330 | if (!force && !mUpdateInputWindowsNeeded) { |
| 331 | return; |
| 332 | } |
| 333 | mUpdateInputWindowsNeeded = false; |
| 334 | |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 335 | if (false) Slog.d(TAG_WM, ">>>>>> ENTERED updateInputWindowsLw"); |
Jeff Brown | 9302c87 | 2011-07-13 22:51:29 -0700 | [diff] [blame] | 336 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 337 | // Populate the input window list with information about all of the windows that |
| 338 | // could potentially receive input. |
| 339 | // As an optimization, we could try to prune the list of windows but this turns |
| 340 | // out to be difficult because only the native code knows for sure which window |
| 341 | // currently has touch focus. |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 342 | |
Wale Ogunwale | e05f501 | 2016-09-16 16:27:29 -0700 | [diff] [blame] | 343 | // If there's a drag in flight, provide a pseudo-window to catch drag input |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 344 | final boolean inDrag = (mService.mDragState != null); |
| 345 | if (inDrag) { |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 346 | if (DEBUG_DRAG) { |
| 347 | Log.d(TAG_WM, "Inserting drag window"); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 348 | } |
Vladislav Kaznacheev | 64b103a | 2016-08-10 11:49:08 -0700 | [diff] [blame] | 349 | final InputWindowHandle dragWindowHandle = mService.mDragState.getInputWindowHandle(); |
Jeff Brown | cc4f7db | 2011-08-30 20:34:48 -0700 | [diff] [blame] | 350 | if (dragWindowHandle != null) { |
Wale Ogunwale | e05f501 | 2016-09-16 16:27:29 -0700 | [diff] [blame] | 351 | addInputWindowHandle(dragWindowHandle); |
Jeff Brown | cc4f7db | 2011-08-30 20:34:48 -0700 | [diff] [blame] | 352 | } else { |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 353 | Slog.w(TAG_WM, "Drag is in progress but there is no " |
Jeff Brown | cc4f7db | 2011-08-30 20:34:48 -0700 | [diff] [blame] | 354 | + "drag window handle."); |
| 355 | } |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 356 | } |
| 357 | |
Chong Zhang | 8e89b31 | 2015-09-09 15:09:30 -0700 | [diff] [blame] | 358 | final boolean inPositioning = (mService.mTaskPositioner != null); |
| 359 | if (inPositioning) { |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 360 | if (DEBUG_TASK_POSITIONING) { |
| 361 | Log.d(TAG_WM, "Inserting window handle for repositioning"); |
Chong Zhang | 8e89b31 | 2015-09-09 15:09:30 -0700 | [diff] [blame] | 362 | } |
| 363 | final InputWindowHandle dragWindowHandle = mService.mTaskPositioner.mDragWindowHandle; |
| 364 | if (dragWindowHandle != null) { |
Wale Ogunwale | e05f501 | 2016-09-16 16:27:29 -0700 | [diff] [blame] | 365 | addInputWindowHandle(dragWindowHandle); |
Chong Zhang | 8e89b31 | 2015-09-09 15:09:30 -0700 | [diff] [blame] | 366 | } else { |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 367 | Slog.e(TAG_WM, |
Chong Zhang | 8e89b31 | 2015-09-09 15:09:30 -0700 | [diff] [blame] | 368 | "Repositioning is in progress but there is no drag window handle."); |
| 369 | } |
| 370 | } |
| 371 | |
Jeff Brown | 83d616a | 2012-09-09 20:33:43 -0700 | [diff] [blame] | 372 | // Add all windows on the default display. |
Wale Ogunwale | e05f501 | 2016-09-16 16:27:29 -0700 | [diff] [blame] | 373 | mService.mRoot.updateInputWindows(this, mInputFocus, inDrag); |
Vladislav Kaznacheev | 0d50d86 | 2016-03-29 15:43:28 -0700 | [diff] [blame] | 374 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 375 | // Send windows to native code. |
Jeff Brown | 9302c87 | 2011-07-13 22:51:29 -0700 | [diff] [blame] | 376 | mService.mInputManager.setInputWindows(mInputWindowHandles); |
| 377 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 378 | // Clear the list in preparation for the next round. |
Jeff Brown | 9302c87 | 2011-07-13 22:51:29 -0700 | [diff] [blame] | 379 | clearInputWindowHandlesLw(); |
| 380 | |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 381 | if (false) Slog.d(TAG_WM, "<<<<<<< EXITED updateInputWindowsLw"); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 382 | } |
| 383 | |
| 384 | /* Notifies that the input device configuration has changed. */ |
Jeff Brown | 0b31d81 | 2013-08-22 19:41:29 -0700 | [diff] [blame] | 385 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 386 | public void notifyConfigurationChanged() { |
| 387 | mService.sendNewConfiguration(); |
| 388 | |
| 389 | synchronized (mInputDevicesReadyMonitor) { |
| 390 | if (!mInputDevicesReady) { |
| 391 | mInputDevicesReady = true; |
| 392 | mInputDevicesReadyMonitor.notifyAll(); |
| 393 | } |
| 394 | } |
| 395 | } |
| 396 | |
| 397 | /* Waits until the built-in input devices have been configured. */ |
| 398 | public boolean waitForInputDevicesReady(long timeoutMillis) { |
| 399 | synchronized (mInputDevicesReadyMonitor) { |
| 400 | if (!mInputDevicesReady) { |
| 401 | try { |
| 402 | mInputDevicesReadyMonitor.wait(timeoutMillis); |
| 403 | } catch (InterruptedException ex) { |
| 404 | } |
| 405 | } |
| 406 | return mInputDevicesReady; |
| 407 | } |
| 408 | } |
| 409 | |
| 410 | /* Notifies that the lid switch changed state. */ |
Jeff Brown | 0b31d81 | 2013-08-22 19:41:29 -0700 | [diff] [blame] | 411 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 412 | public void notifyLidSwitchChanged(long whenNanos, boolean lidOpen) { |
| 413 | mService.mPolicy.notifyLidSwitchChanged(whenNanos, lidOpen); |
| 414 | } |
Craig Mautner | 5845812 | 2013-09-14 14:59:50 -0700 | [diff] [blame] | 415 | |
Michael Wright | 3818c92 | 2014-09-02 13:59:07 -0700 | [diff] [blame] | 416 | /* Notifies that the camera lens cover state has changed. */ |
| 417 | @Override |
| 418 | public void notifyCameraLensCoverSwitchChanged(long whenNanos, boolean lensCovered) { |
| 419 | mService.mPolicy.notifyCameraLensCoverSwitchChanged(whenNanos, lensCovered); |
| 420 | } |
| 421 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 422 | /* Provides an opportunity for the window manager policy to intercept early key |
| 423 | * processing as soon as the key has been read from the device. */ |
Jeff Brown | 0b31d81 | 2013-08-22 19:41:29 -0700 | [diff] [blame] | 424 | @Override |
Jeff Brown | 037c33e | 2014-04-09 00:31:55 -0700 | [diff] [blame] | 425 | public int interceptKeyBeforeQueueing(KeyEvent event, int policyFlags) { |
| 426 | return mService.mPolicy.interceptKeyBeforeQueueing(event, policyFlags); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 427 | } |
Jeff Brown | 56194eb | 2011-03-02 19:23:13 -0800 | [diff] [blame] | 428 | |
Michael Wright | 70af00a | 2014-09-03 19:30:20 -0700 | [diff] [blame] | 429 | /* Provides an opportunity for the window manager policy to intercept early motion event |
| 430 | * processing when the device is in a non-interactive state since these events are normally |
Jeff Brown | 56194eb | 2011-03-02 19:23:13 -0800 | [diff] [blame] | 431 | * dropped. */ |
Jeff Brown | 0b31d81 | 2013-08-22 19:41:29 -0700 | [diff] [blame] | 432 | @Override |
Michael Wright | 70af00a | 2014-09-03 19:30:20 -0700 | [diff] [blame] | 433 | public int interceptMotionBeforeQueueingNonInteractive(long whenNanos, int policyFlags) { |
| 434 | return mService.mPolicy.interceptMotionBeforeQueueingNonInteractive( |
| 435 | whenNanos, policyFlags); |
Jeff Brown | 56194eb | 2011-03-02 19:23:13 -0800 | [diff] [blame] | 436 | } |
| 437 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 438 | /* Provides an opportunity for the window manager policy to process a key before |
| 439 | * ordinary dispatch. */ |
Jeff Brown | 0b31d81 | 2013-08-22 19:41:29 -0700 | [diff] [blame] | 440 | @Override |
Jeff Brown | 905805a | 2011-10-12 13:57:59 -0700 | [diff] [blame] | 441 | public long interceptKeyBeforeDispatching( |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 442 | InputWindowHandle focus, KeyEvent event, int policyFlags) { |
| 443 | WindowState windowState = focus != null ? (WindowState) focus.windowState : null; |
| 444 | return mService.mPolicy.interceptKeyBeforeDispatching(windowState, event, policyFlags); |
| 445 | } |
Craig Mautner | 5845812 | 2013-09-14 14:59:50 -0700 | [diff] [blame] | 446 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 447 | /* Provides an opportunity for the window manager policy to process a key that |
| 448 | * the application did not handle. */ |
Jeff Brown | 0b31d81 | 2013-08-22 19:41:29 -0700 | [diff] [blame] | 449 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 450 | public KeyEvent dispatchUnhandledKey( |
| 451 | InputWindowHandle focus, KeyEvent event, int policyFlags) { |
| 452 | WindowState windowState = focus != null ? (WindowState) focus.windowState : null; |
| 453 | return mService.mPolicy.dispatchUnhandledKey(windowState, event, policyFlags); |
| 454 | } |
Jeff Brown | 4532e61 | 2012-04-05 14:27:12 -0700 | [diff] [blame] | 455 | |
| 456 | /* Callback to get pointer layer. */ |
Jeff Brown | 0b31d81 | 2013-08-22 19:41:29 -0700 | [diff] [blame] | 457 | @Override |
Jeff Brown | 4532e61 | 2012-04-05 14:27:12 -0700 | [diff] [blame] | 458 | public int getPointerLayer() { |
| 459 | return mService.mPolicy.windowTypeToLayerLw(WindowManager.LayoutParams.TYPE_POINTER) |
| 460 | * WindowManagerService.TYPE_LAYER_MULTIPLIER |
| 461 | + WindowManagerService.TYPE_LAYER_OFFSET; |
| 462 | } |
| 463 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 464 | /* Called when the current input focus changes. |
| 465 | * Layer assignment is assumed to be complete by the time this is called. |
| 466 | */ |
| 467 | public void setInputFocusLw(WindowState newWindow, boolean updateInputWindows) { |
Filip Gruszczynski | f8a2a63 | 2015-10-28 11:18:02 -0700 | [diff] [blame] | 468 | if (DEBUG_FOCUS_LIGHT || DEBUG_INPUT) { |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 469 | Slog.d(TAG_WM, "Input focus has changed to " + newWindow); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 470 | } |
| 471 | |
| 472 | if (newWindow != mInputFocus) { |
| 473 | if (newWindow != null && newWindow.canReceiveKeys()) { |
| 474 | // Displaying a window implicitly causes dispatching to be unpaused. |
| 475 | // This is to protect against bugs if someone pauses dispatching but |
| 476 | // forgets to resume. |
| 477 | newWindow.mToken.paused = false; |
| 478 | } |
| 479 | |
| 480 | mInputFocus = newWindow; |
| 481 | setUpdateInputWindowsNeededLw(); |
| 482 | |
| 483 | if (updateInputWindows) { |
| 484 | updateInputWindowsLw(false /*force*/); |
| 485 | } |
| 486 | } |
| 487 | } |
Craig Mautner | 5845812 | 2013-09-14 14:59:50 -0700 | [diff] [blame] | 488 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 489 | public void setFocusedAppLw(AppWindowToken newApp) { |
| 490 | // Focused app has changed. |
| 491 | if (newApp == null) { |
| 492 | mService.mInputManager.setFocusedApplication(null); |
| 493 | } else { |
Jeff Brown | 9302c87 | 2011-07-13 22:51:29 -0700 | [diff] [blame] | 494 | final InputApplicationHandle handle = newApp.mInputApplicationHandle; |
| 495 | handle.name = newApp.toString(); |
| 496 | handle.dispatchingTimeoutNanos = newApp.inputDispatchingTimeoutNanos; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 497 | |
Jeff Brown | 9302c87 | 2011-07-13 22:51:29 -0700 | [diff] [blame] | 498 | mService.mInputManager.setFocusedApplication(handle); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 499 | } |
| 500 | } |
Craig Mautner | 5845812 | 2013-09-14 14:59:50 -0700 | [diff] [blame] | 501 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 502 | public void pauseDispatchingLw(WindowToken window) { |
| 503 | if (! window.paused) { |
Filip Gruszczynski | f8a2a63 | 2015-10-28 11:18:02 -0700 | [diff] [blame] | 504 | if (DEBUG_INPUT) { |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 505 | Slog.v(TAG_WM, "Pausing WindowToken " + window); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 506 | } |
Chong Zhang | 8e89b31 | 2015-09-09 15:09:30 -0700 | [diff] [blame] | 507 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 508 | window.paused = true; |
| 509 | updateInputWindowsLw(true /*force*/); |
| 510 | } |
| 511 | } |
Chong Zhang | 8e89b31 | 2015-09-09 15:09:30 -0700 | [diff] [blame] | 512 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 513 | public void resumeDispatchingLw(WindowToken window) { |
| 514 | if (window.paused) { |
Filip Gruszczynski | f8a2a63 | 2015-10-28 11:18:02 -0700 | [diff] [blame] | 515 | if (DEBUG_INPUT) { |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 516 | Slog.v(TAG_WM, "Resuming WindowToken " + window); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 517 | } |
Chong Zhang | 8e89b31 | 2015-09-09 15:09:30 -0700 | [diff] [blame] | 518 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 519 | window.paused = false; |
| 520 | updateInputWindowsLw(true /*force*/); |
| 521 | } |
| 522 | } |
Chong Zhang | 8e89b31 | 2015-09-09 15:09:30 -0700 | [diff] [blame] | 523 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 524 | public void freezeInputDispatchingLw() { |
Wale Ogunwale | e89eeac | 2016-03-12 11:07:58 -0800 | [diff] [blame] | 525 | if (!mInputDispatchFrozen) { |
Filip Gruszczynski | f8a2a63 | 2015-10-28 11:18:02 -0700 | [diff] [blame] | 526 | if (DEBUG_INPUT) { |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 527 | Slog.v(TAG_WM, "Freezing input dispatching"); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 528 | } |
Chong Zhang | 8e89b31 | 2015-09-09 15:09:30 -0700 | [diff] [blame] | 529 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 530 | mInputDispatchFrozen = true; |
Wale Ogunwale | e89eeac | 2016-03-12 11:07:58 -0800 | [diff] [blame] | 531 | |
| 532 | if (DEBUG_INPUT || true) { |
| 533 | mInputFreezeReason = Debug.getCallers(6); |
| 534 | } |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 535 | updateInputDispatchModeLw(); |
| 536 | } |
| 537 | } |
Chong Zhang | 8e89b31 | 2015-09-09 15:09:30 -0700 | [diff] [blame] | 538 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 539 | public void thawInputDispatchingLw() { |
| 540 | if (mInputDispatchFrozen) { |
Filip Gruszczynski | f8a2a63 | 2015-10-28 11:18:02 -0700 | [diff] [blame] | 541 | if (DEBUG_INPUT) { |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 542 | Slog.v(TAG_WM, "Thawing input dispatching"); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 543 | } |
Chong Zhang | 8e89b31 | 2015-09-09 15:09:30 -0700 | [diff] [blame] | 544 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 545 | mInputDispatchFrozen = false; |
Wale Ogunwale | e89eeac | 2016-03-12 11:07:58 -0800 | [diff] [blame] | 546 | mInputFreezeReason = null; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 547 | updateInputDispatchModeLw(); |
| 548 | } |
| 549 | } |
Chong Zhang | 8e89b31 | 2015-09-09 15:09:30 -0700 | [diff] [blame] | 550 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 551 | public void setEventDispatchingLw(boolean enabled) { |
| 552 | if (mInputDispatchEnabled != enabled) { |
Filip Gruszczynski | f8a2a63 | 2015-10-28 11:18:02 -0700 | [diff] [blame] | 553 | if (DEBUG_INPUT) { |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 554 | Slog.v(TAG_WM, "Setting event dispatching to " + enabled); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 555 | } |
Chong Zhang | 8e89b31 | 2015-09-09 15:09:30 -0700 | [diff] [blame] | 556 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 557 | mInputDispatchEnabled = enabled; |
| 558 | updateInputDispatchModeLw(); |
| 559 | } |
| 560 | } |
Chong Zhang | 8e89b31 | 2015-09-09 15:09:30 -0700 | [diff] [blame] | 561 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 562 | private void updateInputDispatchModeLw() { |
| 563 | mService.mInputManager.setInputDispatchMode(mInputDispatchEnabled, mInputDispatchFrozen); |
| 564 | } |
Wale Ogunwale | e89eeac | 2016-03-12 11:07:58 -0800 | [diff] [blame] | 565 | |
| 566 | void dump(PrintWriter pw, String prefix) { |
| 567 | if (mInputFreezeReason != null) { |
| 568 | pw.println(prefix + "mInputFreezeReason=" + mInputFreezeReason); |
| 569 | } |
| 570 | } |
Jeff Brown | ea42655 | 2011-07-18 16:53:48 -0700 | [diff] [blame] | 571 | } |