Jorim Jaggi | f96c90a | 2018-09-26 16:55:15 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 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. |
| 15 | */ |
| 16 | |
| 17 | package com.android.server.wm; |
| 18 | |
Tiger Huang | 332793b | 2019-10-29 23:21:27 +0800 | [diff] [blame] | 19 | import static android.view.InsetsState.ITYPE_IME; |
| 20 | import static android.view.InsetsState.ITYPE_NAVIGATION_BAR; |
| 21 | import static android.view.InsetsState.ITYPE_STATUS_BAR; |
Jorim Jaggi | a12ea56 | 2019-01-07 17:47:47 +0100 | [diff] [blame] | 22 | import static android.view.ViewRootImpl.NEW_INSETS_MODE_FULL; |
| 23 | import static android.view.ViewRootImpl.sNewInsetsMode; |
Jorim Jaggi | f96c90a | 2018-09-26 16:55:15 +0200 | [diff] [blame] | 24 | |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 25 | import android.annotation.NonNull; |
| 26 | import android.annotation.Nullable; |
Jorim Jaggi | f96c90a | 2018-09-26 16:55:15 +0200 | [diff] [blame] | 27 | import android.util.ArrayMap; |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 28 | import android.util.ArraySet; |
| 29 | import android.util.SparseArray; |
Jorim Jaggi | e35c059 | 2018-11-06 16:21:08 +0100 | [diff] [blame] | 30 | import android.view.InsetsSource; |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 31 | import android.view.InsetsSourceControl; |
Jorim Jaggi | f96c90a | 2018-09-26 16:55:15 +0200 | [diff] [blame] | 32 | import android.view.InsetsState; |
Tiger Huang | 332793b | 2019-10-29 23:21:27 +0800 | [diff] [blame] | 33 | import android.view.InsetsState.InternalInsetsType; |
Jorim Jaggi | f96c90a | 2018-09-26 16:55:15 +0200 | [diff] [blame] | 34 | |
| 35 | import java.io.PrintWriter; |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 36 | import java.util.ArrayList; |
Jorim Jaggi | f96c90a | 2018-09-26 16:55:15 +0200 | [diff] [blame] | 37 | import java.util.function.Consumer; |
| 38 | |
| 39 | /** |
| 40 | * Manages global window inset state in the system represented by {@link InsetsState}. |
| 41 | */ |
| 42 | class InsetsStateController { |
| 43 | |
| 44 | private final InsetsState mLastState = new InsetsState(); |
| 45 | private final InsetsState mState = new InsetsState(); |
| 46 | private final DisplayContent mDisplayContent; |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 47 | |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 48 | private final ArrayMap<Integer, InsetsSourceProvider> mProviders = new ArrayMap<>(); |
| 49 | private final ArrayMap<InsetsControlTarget, ArrayList<Integer>> mControlTargetTypeMap = |
| 50 | new ArrayMap<>(); |
| 51 | private final SparseArray<InsetsControlTarget> mTypeControlTargetMap = new SparseArray<>(); |
Jorim Jaggi | a12ea56 | 2019-01-07 17:47:47 +0100 | [diff] [blame] | 52 | |
| 53 | /** @see #onControlFakeTargetChanged */ |
| 54 | private final SparseArray<InsetsControlTarget> mTypeFakeControlTargetMap = new SparseArray<>(); |
| 55 | |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 56 | private final ArraySet<InsetsControlTarget> mPendingControlChanged = new ArraySet<>(); |
Jorim Jaggi | f96c90a | 2018-09-26 16:55:15 +0200 | [diff] [blame] | 57 | |
| 58 | private final Consumer<WindowState> mDispatchInsetsChanged = w -> { |
| 59 | if (w.isVisible()) { |
| 60 | w.notifyInsetsChanged(); |
| 61 | } |
| 62 | }; |
| 63 | |
| 64 | InsetsStateController(DisplayContent displayContent) { |
| 65 | mDisplayContent = displayContent; |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * When dispatching window state to the client, we'll need to exclude the source that represents |
| 70 | * the window that is being dispatched. |
| 71 | * |
| 72 | * @param target The client we dispatch the state to. |
| 73 | * @return The state stripped of the necessary information. |
| 74 | */ |
| 75 | InsetsState getInsetsForDispatch(WindowState target) { |
Jorim Jaggi | 956ca41 | 2019-01-07 14:49:14 +0100 | [diff] [blame] | 76 | final InsetsSourceProvider provider = target.getControllableInsetProvider(); |
Jorim Jaggi | f96c90a | 2018-09-26 16:55:15 +0200 | [diff] [blame] | 77 | if (provider == null) { |
| 78 | return mState; |
| 79 | } |
| 80 | |
| 81 | final InsetsState state = new InsetsState(); |
| 82 | state.set(mState); |
| 83 | final int type = provider.getSource().getType(); |
| 84 | state.removeSource(type); |
| 85 | |
| 86 | // Navigation bar doesn't get influenced by anything else |
Tiger Huang | 332793b | 2019-10-29 23:21:27 +0800 | [diff] [blame] | 87 | if (type == ITYPE_NAVIGATION_BAR) { |
| 88 | state.removeSource(ITYPE_IME); |
| 89 | state.removeSource(ITYPE_STATUS_BAR); |
Jorim Jaggi | f96c90a | 2018-09-26 16:55:15 +0200 | [diff] [blame] | 90 | } |
| 91 | return state; |
| 92 | } |
| 93 | |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 94 | @Nullable InsetsSourceControl[] getControlsForDispatch(InsetsControlTarget target) { |
| 95 | ArrayList<Integer> controlled = mControlTargetTypeMap.get(target); |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 96 | if (controlled == null) { |
| 97 | return null; |
| 98 | } |
| 99 | final int size = controlled.size(); |
| 100 | final InsetsSourceControl[] result = new InsetsSourceControl[size]; |
| 101 | for (int i = 0; i < size; i++) { |
Jorim Jaggi | a12ea56 | 2019-01-07 17:47:47 +0100 | [diff] [blame] | 102 | result[i] = mProviders.get(controlled.get(i)).getControl(target); |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 103 | } |
| 104 | return result; |
| 105 | } |
| 106 | |
Jorim Jaggi | f96c90a | 2018-09-26 16:55:15 +0200 | [diff] [blame] | 107 | /** |
| 108 | * @return The provider of a specific type. |
| 109 | */ |
Tiger Huang | 332793b | 2019-10-29 23:21:27 +0800 | [diff] [blame] | 110 | InsetsSourceProvider getSourceProvider(@InternalInsetsType int type) { |
| 111 | if (type == ITYPE_IME) { |
Tarandeep Singh | 500a38f | 2019-09-26 13:36:40 -0700 | [diff] [blame] | 112 | return mProviders.computeIfAbsent(type, |
| 113 | key -> new ImeInsetsSourceProvider( |
| 114 | mState.getSource(key), this, mDisplayContent)); |
| 115 | } else { |
| 116 | return mProviders.computeIfAbsent(type, |
| 117 | key -> new InsetsSourceProvider(mState.getSource(key), this, mDisplayContent)); |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | ImeInsetsSourceProvider getImeSourceProvider() { |
Tiger Huang | 332793b | 2019-10-29 23:21:27 +0800 | [diff] [blame] | 122 | return (ImeInsetsSourceProvider) getSourceProvider(ITYPE_IME); |
Jorim Jaggi | f96c90a | 2018-09-26 16:55:15 +0200 | [diff] [blame] | 123 | } |
| 124 | |
| 125 | /** |
Jorim Jaggi | 956ca41 | 2019-01-07 14:49:14 +0100 | [diff] [blame] | 126 | * @return The provider of a specific type or null if we don't have it. |
| 127 | */ |
Tiger Huang | 332793b | 2019-10-29 23:21:27 +0800 | [diff] [blame] | 128 | @Nullable InsetsSourceProvider peekSourceProvider(@InternalInsetsType int type) { |
Jorim Jaggi | 956ca41 | 2019-01-07 14:49:14 +0100 | [diff] [blame] | 129 | return mProviders.get(type); |
| 130 | } |
| 131 | |
| 132 | /** |
Jorim Jaggi | f96c90a | 2018-09-26 16:55:15 +0200 | [diff] [blame] | 133 | * Called when a layout pass has occurred. |
| 134 | */ |
| 135 | void onPostLayout() { |
Tarandeep Singh | a6f3561 | 2019-01-11 19:50:46 -0800 | [diff] [blame] | 136 | mState.setDisplayFrame(mDisplayContent.getBounds()); |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 137 | for (int i = mProviders.size() - 1; i >= 0; i--) { |
| 138 | mProviders.valueAt(i).onPostLayout(); |
Jorim Jaggi | f96c90a | 2018-09-26 16:55:15 +0200 | [diff] [blame] | 139 | } |
| 140 | if (!mLastState.equals(mState)) { |
| 141 | mLastState.set(mState, true /* copySources */); |
| 142 | notifyInsetsChanged(); |
| 143 | } |
Tarandeep Singh | 500a38f | 2019-09-26 13:36:40 -0700 | [diff] [blame] | 144 | getImeSourceProvider().onPostInsetsDispatched(); |
Jorim Jaggi | f96c90a | 2018-09-26 16:55:15 +0200 | [diff] [blame] | 145 | } |
| 146 | |
Jorim Jaggi | e35c059 | 2018-11-06 16:21:08 +0100 | [diff] [blame] | 147 | void onInsetsModified(WindowState windowState, InsetsState state) { |
| 148 | boolean changed = false; |
| 149 | for (int i = state.getSourcesCount() - 1; i >= 0; i--) { |
| 150 | final InsetsSource source = state.sourceAt(i); |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 151 | final InsetsSourceProvider provider = mProviders.get(source.getType()); |
Jorim Jaggi | e35c059 | 2018-11-06 16:21:08 +0100 | [diff] [blame] | 152 | if (provider == null) { |
| 153 | continue; |
| 154 | } |
| 155 | changed |= provider.onInsetsModified(windowState, source); |
| 156 | } |
| 157 | if (changed) { |
| 158 | notifyInsetsChanged(); |
| 159 | } |
| 160 | } |
| 161 | |
Tiger Huang | 332793b | 2019-10-29 23:21:27 +0800 | [diff] [blame] | 162 | boolean isFakeTarget(@InternalInsetsType int type, InsetsControlTarget target) { |
Jorim Jaggi | 956ca41 | 2019-01-07 14:49:14 +0100 | [diff] [blame] | 163 | return mTypeFakeControlTargetMap.get(type) == target; |
| 164 | } |
| 165 | |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 166 | void onImeTargetChanged(@Nullable InsetsControlTarget imeTarget) { |
Tiger Huang | 332793b | 2019-10-29 23:21:27 +0800 | [diff] [blame] | 167 | onControlChanged(ITYPE_IME, imeTarget); |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 168 | notifyPendingInsetsControlChanged(); |
| 169 | } |
| 170 | |
| 171 | /** |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 172 | * Called when the focused window that is able to control the system bars changes. |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 173 | * |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 174 | * @param topControlling The target that is now able to control the top bar appearance |
| 175 | * and visibility. |
| 176 | * @param navControlling The target that is now able to control the nav bar appearance |
| 177 | * and visibility. |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 178 | */ |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 179 | void onBarControlTargetChanged(@Nullable InsetsControlTarget topControlling, |
Jorim Jaggi | 956ca41 | 2019-01-07 14:49:14 +0100 | [diff] [blame] | 180 | @Nullable InsetsControlTarget fakeTopControlling, |
| 181 | @Nullable InsetsControlTarget navControlling, |
| 182 | @Nullable InsetsControlTarget fakeNavControlling) { |
Tiger Huang | 332793b | 2019-10-29 23:21:27 +0800 | [diff] [blame] | 183 | onControlChanged(ITYPE_STATUS_BAR, topControlling); |
| 184 | onControlChanged(ITYPE_NAVIGATION_BAR, navControlling); |
| 185 | onControlFakeTargetChanged(ITYPE_STATUS_BAR, fakeTopControlling); |
| 186 | onControlFakeTargetChanged(ITYPE_NAVIGATION_BAR, fakeNavControlling); |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 187 | notifyPendingInsetsControlChanged(); |
| 188 | } |
| 189 | |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 190 | void notifyControlRevoked(@NonNull InsetsControlTarget previousControlTarget, |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 191 | InsetsSourceProvider provider) { |
Jorim Jaggi | a12ea56 | 2019-01-07 17:47:47 +0100 | [diff] [blame] | 192 | removeFromControlMaps(previousControlTarget, provider.getSource().getType(), |
| 193 | false /* fake */); |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 194 | } |
| 195 | |
Tiger Huang | 332793b | 2019-10-29 23:21:27 +0800 | [diff] [blame] | 196 | private void onControlChanged(@InternalInsetsType int type, |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 197 | @Nullable InsetsControlTarget target) { |
| 198 | final InsetsControlTarget previous = mTypeControlTargetMap.get(type); |
| 199 | if (target == previous) { |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 200 | return; |
| 201 | } |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 202 | final InsetsSourceProvider provider = getSourceProvider(type); |
| 203 | if (provider == null) { |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 204 | return; |
| 205 | } |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 206 | if (!provider.isControllable()) { |
Jorim Jaggi | a2759b2 | 2019-01-24 13:21:40 +0100 | [diff] [blame] | 207 | return; |
| 208 | } |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 209 | provider.updateControlForTarget(target, false /* force */); |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 210 | if (previous != null) { |
Jorim Jaggi | a12ea56 | 2019-01-07 17:47:47 +0100 | [diff] [blame] | 211 | removeFromControlMaps(previous, type, false /* fake */); |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 212 | mPendingControlChanged.add(previous); |
| 213 | } |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 214 | if (target != null) { |
Jorim Jaggi | a12ea56 | 2019-01-07 17:47:47 +0100 | [diff] [blame] | 215 | addToControlMaps(target, type, false /* fake */); |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 216 | mPendingControlChanged.add(target); |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 217 | } |
| 218 | } |
| 219 | |
Jorim Jaggi | a12ea56 | 2019-01-07 17:47:47 +0100 | [diff] [blame] | 220 | /** |
| 221 | * The fake target saved here will be used to pretend to the app that it's still under control |
| 222 | * of the bars while it's not really, but we still need to find out the apps intentions around |
| 223 | * showing/hiding. For example, when the transient bars are showing, and the fake target |
| 224 | * requests to show system bars, the transient state will be aborted. |
| 225 | */ |
Tiger Huang | 332793b | 2019-10-29 23:21:27 +0800 | [diff] [blame] | 226 | void onControlFakeTargetChanged(@InternalInsetsType int type, |
Jorim Jaggi | a12ea56 | 2019-01-07 17:47:47 +0100 | [diff] [blame] | 227 | @Nullable InsetsControlTarget fakeTarget) { |
| 228 | if (sNewInsetsMode != NEW_INSETS_MODE_FULL) { |
| 229 | return; |
| 230 | } |
| 231 | final InsetsControlTarget previous = mTypeFakeControlTargetMap.get(type); |
| 232 | if (fakeTarget == previous) { |
| 233 | return; |
| 234 | } |
| 235 | final InsetsSourceProvider provider = mProviders.get(type); |
| 236 | if (provider == null) { |
| 237 | return; |
| 238 | } |
| 239 | provider.updateControlForFakeTarget(fakeTarget); |
| 240 | if (previous != null) { |
| 241 | removeFromControlMaps(previous, type, true /* fake */); |
| 242 | mPendingControlChanged.add(previous); |
| 243 | } |
| 244 | if (fakeTarget != null) { |
| 245 | addToControlMaps(fakeTarget, type, true /* fake */); |
| 246 | mPendingControlChanged.add(fakeTarget); |
| 247 | } |
| 248 | } |
| 249 | |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 250 | private void removeFromControlMaps(@NonNull InsetsControlTarget target, |
Tiger Huang | 332793b | 2019-10-29 23:21:27 +0800 | [diff] [blame] | 251 | @InternalInsetsType int type, boolean fake) { |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 252 | final ArrayList<Integer> array = mControlTargetTypeMap.get(target); |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 253 | if (array == null) { |
| 254 | return; |
| 255 | } |
| 256 | array.remove((Integer) type); |
| 257 | if (array.isEmpty()) { |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 258 | mControlTargetTypeMap.remove(target); |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 259 | } |
Jorim Jaggi | a12ea56 | 2019-01-07 17:47:47 +0100 | [diff] [blame] | 260 | if (fake) { |
| 261 | mTypeFakeControlTargetMap.remove(type); |
| 262 | } else { |
| 263 | mTypeControlTargetMap.remove(type); |
| 264 | } |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 265 | } |
| 266 | |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 267 | private void addToControlMaps(@NonNull InsetsControlTarget target, |
Tiger Huang | 332793b | 2019-10-29 23:21:27 +0800 | [diff] [blame] | 268 | @InternalInsetsType int type, boolean fake) { |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 269 | final ArrayList<Integer> array = mControlTargetTypeMap.computeIfAbsent(target, |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 270 | key -> new ArrayList<>()); |
| 271 | array.add(type); |
Jorim Jaggi | a12ea56 | 2019-01-07 17:47:47 +0100 | [diff] [blame] | 272 | if (fake) { |
| 273 | mTypeFakeControlTargetMap.put(type, target); |
| 274 | } else { |
| 275 | mTypeControlTargetMap.put(type, target); |
| 276 | } |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 277 | } |
| 278 | |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 279 | void notifyControlChanged(InsetsControlTarget target) { |
Tarandeep Singh | 215929b | 2019-01-11 18:24:37 -0800 | [diff] [blame] | 280 | mPendingControlChanged.add(target); |
| 281 | notifyPendingInsetsControlChanged(); |
| 282 | } |
| 283 | |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 284 | private void notifyPendingInsetsControlChanged() { |
Jorim Jaggi | f86eb49 | 2019-01-09 17:37:08 +0100 | [diff] [blame] | 285 | if (mPendingControlChanged.isEmpty()) { |
| 286 | return; |
| 287 | } |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 288 | mDisplayContent.mWmService.mAnimator.addAfterPrepareSurfacesRunnable(() -> { |
| 289 | for (int i = mPendingControlChanged.size() - 1; i >= 0; i--) { |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 290 | final InsetsControlTarget controlTarget = mPendingControlChanged.valueAt(i); |
| 291 | controlTarget.notifyInsetsControlChanged(); |
Jorim Jaggi | b603095 | 2018-10-23 18:31:52 +0200 | [diff] [blame] | 292 | } |
| 293 | mPendingControlChanged.clear(); |
| 294 | }); |
| 295 | } |
| 296 | |
Jorim Jaggi | 956ca41 | 2019-01-07 14:49:14 +0100 | [diff] [blame] | 297 | void notifyInsetsChanged() { |
Jorim Jaggi | f96c90a | 2018-09-26 16:55:15 +0200 | [diff] [blame] | 298 | mDisplayContent.forAllWindows(mDispatchInsetsChanged, true /* traverseTopToBottom */); |
| 299 | } |
| 300 | |
| 301 | void dump(String prefix, PrintWriter pw) { |
| 302 | pw.println(prefix + "WindowInsetsStateController"); |
| 303 | mState.dump(prefix + " ", pw); |
Jorim Jaggi | cfd6f3b | 2018-11-07 15:30:18 +0100 | [diff] [blame] | 304 | pw.println(prefix + " " + "Control map:"); |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 305 | for (int i = mTypeControlTargetMap.size() - 1; i >= 0; i--) { |
Jorim Jaggi | cfd6f3b | 2018-11-07 15:30:18 +0100 | [diff] [blame] | 306 | pw.print(prefix + " "); |
Jorim Jaggi | 2862047 | 2019-01-02 23:21:49 +0100 | [diff] [blame] | 307 | pw.println(InsetsState.typeToString(mTypeControlTargetMap.keyAt(i)) + " -> " |
| 308 | + mTypeControlTargetMap.valueAt(i)); |
Jorim Jaggi | cfd6f3b | 2018-11-07 15:30:18 +0100 | [diff] [blame] | 309 | } |
Jorim Jaggi | f96c90a | 2018-09-26 16:55:15 +0200 | [diff] [blame] | 310 | } |
| 311 | } |