Jorim Jaggi | 1fcbab6 | 2015-11-04 16:39:50 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 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.systemui.stackdivider; |
| 18 | |
Evan Rosky | 90d5b6d | 2020-05-13 19:39:05 -0700 | [diff] [blame] | 19 | import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED; |
Jorim Jaggi | 1fcbab6 | 2015-11-04 16:39:50 +0100 | [diff] [blame] | 20 | import static android.content.res.Configuration.ORIENTATION_LANDSCAPE; |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 21 | import static android.view.Display.DEFAULT_DISPLAY; |
Jorim Jaggi | 1fcbab6 | 2015-11-04 16:39:50 +0100 | [diff] [blame] | 22 | |
Evan Rosky | 8d1c24e | 2020-04-23 09:21:16 -0700 | [diff] [blame] | 23 | import static com.android.systemui.shared.system.WindowManagerWrapper.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY; |
| 24 | |
Evan Rosky | 8d1c24e | 2020-04-23 09:21:16 -0700 | [diff] [blame] | 25 | import android.app.ActivityManager; |
Evan Rosky | b8540a0 | 2020-03-25 16:30:24 -0700 | [diff] [blame] | 26 | import android.app.ActivityTaskManager; |
Dave Mankoff | a5d8a39 | 2019-10-10 12:21:09 -0400 | [diff] [blame] | 27 | import android.content.Context; |
Winson Chung | 67f5c8b | 2018-09-24 12:09:19 -0700 | [diff] [blame] | 28 | import android.content.res.Configuration; |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 29 | import android.graphics.Rect; |
| 30 | import android.os.Handler; |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 31 | import android.provider.Settings; |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 32 | import android.util.Slog; |
Winson Chung | 67f5c8b | 2018-09-24 12:09:19 -0700 | [diff] [blame] | 33 | import android.view.LayoutInflater; |
| 34 | import android.view.View; |
Evan Rosky | 8d1c24e | 2020-04-23 09:21:16 -0700 | [diff] [blame] | 35 | import android.window.WindowContainerToken; |
Wale Ogunwale | 5794658 | 2020-03-21 14:29:07 -0700 | [diff] [blame] | 36 | import android.window.WindowContainerTransaction; |
Wale Ogunwale | 568f9f41 | 2020-03-21 22:27:35 -0700 | [diff] [blame] | 37 | import android.window.WindowOrganizer; |
Gus Prevas | ab33679 | 2018-11-14 13:52:20 -0500 | [diff] [blame] | 38 | |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 39 | import com.android.internal.policy.DividerSnapAlgorithm; |
Winson Chung | 67f5c8b | 2018-09-24 12:09:19 -0700 | [diff] [blame] | 40 | import com.android.systemui.R; |
| 41 | import com.android.systemui.SystemUI; |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 42 | import com.android.systemui.TransactionPool; |
Winson Chung | 67f5c8b | 2018-09-24 12:09:19 -0700 | [diff] [blame] | 43 | import com.android.systemui.recents.Recents; |
Evan Rosky | 8d1c24e | 2020-04-23 09:21:16 -0700 | [diff] [blame] | 44 | import com.android.systemui.shared.system.ActivityManagerWrapper; |
| 45 | import com.android.systemui.shared.system.TaskStackChangeListener; |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 46 | import com.android.systemui.statusbar.policy.KeyguardStateController; |
| 47 | import com.android.systemui.wm.DisplayChangeController; |
| 48 | import com.android.systemui.wm.DisplayController; |
| 49 | import com.android.systemui.wm.DisplayImeController; |
| 50 | import com.android.systemui.wm.DisplayLayout; |
| 51 | import com.android.systemui.wm.SystemWindows; |
Gus Prevas | ab33679 | 2018-11-14 13:52:20 -0500 | [diff] [blame] | 52 | |
Jorim Jaggi | 31f7170 | 2016-05-04 16:43:04 -0700 | [diff] [blame] | 53 | import java.io.FileDescriptor; |
| 54 | import java.io.PrintWriter; |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 55 | import java.lang.ref.WeakReference; |
| 56 | import java.util.ArrayList; |
Dave Mankoff | 6c64d1f | 2019-11-07 17:27:50 -0500 | [diff] [blame] | 57 | import java.util.Optional; |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 58 | import java.util.function.Consumer; |
| 59 | |
| 60 | import javax.inject.Singleton; |
Dave Mankoff | 6c64d1f | 2019-11-07 17:27:50 -0500 | [diff] [blame] | 61 | |
| 62 | import dagger.Lazy; |
Jorim Jaggi | 31f7170 | 2016-05-04 16:43:04 -0700 | [diff] [blame] | 63 | |
Jorim Jaggi | 1fcbab6 | 2015-11-04 16:39:50 +0100 | [diff] [blame] | 64 | /** |
| 65 | * Controls the docked stack divider. |
| 66 | */ |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 67 | @Singleton |
| 68 | public class Divider extends SystemUI implements DividerView.DividerCallbacks, |
| 69 | DisplayController.OnDisplaysChangedListener { |
Winson Chung | 67f5c8b | 2018-09-24 12:09:19 -0700 | [diff] [blame] | 70 | private static final String TAG = "Divider"; |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 71 | |
Evan Rosky | fdc71c4 | 2020-03-13 18:23:08 -0700 | [diff] [blame] | 72 | static final boolean DEBUG = false; |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 73 | |
| 74 | static final int DEFAULT_APP_TRANSITION_DURATION = 336; |
| 75 | |
Dave Mankoff | 6c64d1f | 2019-11-07 17:27:50 -0500 | [diff] [blame] | 76 | private final Optional<Lazy<Recents>> mRecentsOptionalLazy; |
Winson Chung | 67f5c8b | 2018-09-24 12:09:19 -0700 | [diff] [blame] | 77 | |
Jorim Jaggi | 1fcbab6 | 2015-11-04 16:39:50 +0100 | [diff] [blame] | 78 | private DividerWindowManager mWindowManager; |
Jorim Jaggi | dd98d41 | 2015-11-18 15:57:38 -0800 | [diff] [blame] | 79 | private DividerView mView; |
Jorim Jaggi | a6c05d5 | 2016-05-27 00:31:21 -0700 | [diff] [blame] | 80 | private final DividerState mDividerState = new DividerState(); |
Filip Gruszczynski | 64cdc14 | 2015-11-29 21:10:07 -0800 | [diff] [blame] | 81 | private boolean mVisible = false; |
Jorim Jaggi | 42625d1b | 2016-02-11 20:11:07 -0800 | [diff] [blame] | 82 | private boolean mMinimized = false; |
Jorim Jaggi | 698e763 | 2016-04-13 21:02:22 -0700 | [diff] [blame] | 83 | private boolean mAdjustedForIme = false; |
Matthew Ng | e15352e | 2016-12-20 15:36:29 -0800 | [diff] [blame] | 84 | private boolean mHomeStackResizable = false; |
Jorim Jaggi | 2adba07 | 2016-03-03 13:43:39 +0100 | [diff] [blame] | 85 | private ForcedResizableInfoActivityController mForcedResizableController; |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 86 | private SystemWindows mSystemWindows; |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 87 | private DisplayController mDisplayController; |
| 88 | private DisplayImeController mImeController; |
| 89 | final TransactionPool mTransactionPool; |
Jorim Jaggi | 1fcbab6 | 2015-11-04 16:39:50 +0100 | [diff] [blame] | 90 | |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 91 | // Keeps track of real-time split geometry including snap positions and ime adjustments |
| 92 | private SplitDisplayLayout mSplitLayout; |
| 93 | |
| 94 | // Transient: this contains the layout calculated for a new rotation requested by WM. This is |
| 95 | // kept around so that we can wait for a matching configuration change and then use the exact |
| 96 | // layout that we sent back to WM. |
| 97 | private SplitDisplayLayout mRotateSplitLayout; |
| 98 | |
| 99 | private Handler mHandler; |
| 100 | private KeyguardStateController mKeyguardStateController; |
| 101 | |
Evan Rosky | 3613854 | 2020-05-01 18:02:11 -0700 | [diff] [blame] | 102 | private WindowManagerProxy mWindowManagerProxy; |
| 103 | |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 104 | private final ArrayList<WeakReference<Consumer<Boolean>>> mDockedStackExistsListeners = |
| 105 | new ArrayList<>(); |
| 106 | |
| 107 | private SplitScreenTaskOrganizer mSplits = new SplitScreenTaskOrganizer(this); |
| 108 | |
| 109 | private DisplayChangeController.OnDisplayChangingListener mRotationController = |
Evan Rosky | 3613854 | 2020-05-01 18:02:11 -0700 | [diff] [blame] | 110 | (display, fromRotation, toRotation, wct) -> { |
| 111 | if (!mSplits.isSplitScreenSupported() || mWindowManagerProxy == null) { |
Evan Rosky | b8540a0 | 2020-03-25 16:30:24 -0700 | [diff] [blame] | 112 | return; |
| 113 | } |
Evan Rosky | 3613854 | 2020-05-01 18:02:11 -0700 | [diff] [blame] | 114 | WindowContainerTransaction t = new WindowContainerTransaction(); |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 115 | DisplayLayout displayLayout = |
| 116 | new DisplayLayout(mDisplayController.getDisplayLayout(display)); |
| 117 | SplitDisplayLayout sdl = new SplitDisplayLayout(mContext, displayLayout, mSplits); |
| 118 | sdl.rotateTo(toRotation); |
| 119 | mRotateSplitLayout = sdl; |
Evan Rosky | 90d5b6d | 2020-05-13 19:39:05 -0700 | [diff] [blame] | 120 | final int position = isDividerVisible() |
| 121 | ? (mMinimized ? mView.mSnapTargetBeforeMinimized.position |
| 122 | : mView.getCurrentPosition()) |
| 123 | // snap resets to middle target when not in split-mode |
| 124 | : sdl.getSnapAlgorithm().getMiddleTarget().position; |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 125 | DividerSnapAlgorithm snap = sdl.getSnapAlgorithm(); |
| 126 | final DividerSnapAlgorithm.SnapTarget target = |
| 127 | snap.calculateNonDismissingSnapTarget(position); |
| 128 | sdl.resizeSplits(target.position, t); |
| 129 | |
Evan Rosky | 89c285e | 2020-06-17 21:21:53 -0700 | [diff] [blame] | 130 | if (isSplitActive() && mHomeStackResizable) { |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 131 | WindowManagerProxy.applyHomeTasksMinimized(sdl, mSplits.mSecondary.token, t); |
| 132 | } |
Evan Rosky | 3613854 | 2020-05-01 18:02:11 -0700 | [diff] [blame] | 133 | if (mWindowManagerProxy.queueSyncTransactionIfWaiting(t)) { |
| 134 | // Because sync transactions are serialized, its possible for an "older" |
| 135 | // bounds-change to get applied after a screen rotation. In that case, we |
| 136 | // want to actually defer on that rather than apply immediately. Of course, |
| 137 | // this means that the bounds may not change until after the rotation so |
| 138 | // the user might see some artifacts. This should be rare. |
| 139 | Slog.w(TAG, "Screen rotated while other operations were pending, this may" |
| 140 | + " result in some graphical artifacts."); |
| 141 | } else { |
| 142 | wct.merge(t, true /* transfer */); |
| 143 | } |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 144 | }; |
| 145 | |
Evan Rosky | c48c939 | 2020-05-19 11:54:21 -0700 | [diff] [blame] | 146 | private final DividerImeController mImePositionProcessor; |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 147 | |
Evan Rosky | 8d1c24e | 2020-04-23 09:21:16 -0700 | [diff] [blame] | 148 | private TaskStackChangeListener mActivityRestartListener = new TaskStackChangeListener() { |
| 149 | @Override |
| 150 | public void onActivityRestartAttempt(ActivityManager.RunningTaskInfo task, |
| 151 | boolean homeTaskVisible, boolean clearedTask, boolean wasVisible) { |
| 152 | if (!wasVisible || task.configuration.windowConfiguration.getWindowingMode() |
| 153 | != WINDOWING_MODE_SPLIT_SCREEN_PRIMARY || !mSplits.isSplitScreenSupported()) { |
| 154 | return; |
| 155 | } |
| 156 | |
| 157 | if (isMinimized()) { |
| 158 | onUndockingTask(); |
| 159 | } |
| 160 | } |
| 161 | }; |
| 162 | |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 163 | public Divider(Context context, Optional<Lazy<Recents>> recentsOptionalLazy, |
| 164 | DisplayController displayController, SystemWindows systemWindows, |
| 165 | DisplayImeController imeController, Handler handler, |
| 166 | KeyguardStateController keyguardStateController, TransactionPool transactionPool) { |
Dave Mankoff | a5d8a39 | 2019-10-10 12:21:09 -0400 | [diff] [blame] | 167 | super(context); |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 168 | mDisplayController = displayController; |
| 169 | mSystemWindows = systemWindows; |
| 170 | mImeController = imeController; |
| 171 | mHandler = handler; |
| 172 | mKeyguardStateController = keyguardStateController; |
Dave Mankoff | 6c64d1f | 2019-11-07 17:27:50 -0500 | [diff] [blame] | 173 | mRecentsOptionalLazy = recentsOptionalLazy; |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 174 | mForcedResizableController = new ForcedResizableInfoActivityController(context, this); |
| 175 | mTransactionPool = transactionPool; |
Evan Rosky | 3613854 | 2020-05-01 18:02:11 -0700 | [diff] [blame] | 176 | mWindowManagerProxy = new WindowManagerProxy(mTransactionPool, mHandler); |
Evan Rosky | c48c939 | 2020-05-19 11:54:21 -0700 | [diff] [blame] | 177 | mImePositionProcessor = new DividerImeController(mSplits, mTransactionPool, mHandler); |
Dave Mankoff | a5d8a39 | 2019-10-10 12:21:09 -0400 | [diff] [blame] | 178 | } |
| 179 | |
Jorim Jaggi | 1fcbab6 | 2015-11-04 16:39:50 +0100 | [diff] [blame] | 180 | @Override |
| 181 | public void start() { |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 182 | mWindowManager = new DividerWindowManager(mSystemWindows); |
| 183 | mDisplayController.addDisplayWindowListener(this); |
| 184 | // Hide the divider when keyguard is showing. Even though keyguard/statusbar is above |
| 185 | // everything, it is actually transparent except for notifications, so we still need to |
| 186 | // hide any surfaces that are below it. |
| 187 | // TODO(b/148906453): Figure out keyguard dismiss animation for divider view. |
| 188 | mKeyguardStateController.addCallback(new KeyguardStateController.Callback() { |
| 189 | @Override |
| 190 | public void onUnlockedChanged() { |
| 191 | |
| 192 | } |
| 193 | |
| 194 | @Override |
| 195 | public void onKeyguardShowingChanged() { |
Evan Rosky | 90d5b6d | 2020-05-13 19:39:05 -0700 | [diff] [blame] | 196 | if (!isDividerVisible() || mView == null) { |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 197 | return; |
| 198 | } |
| 199 | mView.setHidden(mKeyguardStateController.isShowing()); |
| 200 | } |
| 201 | |
| 202 | @Override |
| 203 | public void onKeyguardFadingAwayChanged() { |
| 204 | |
| 205 | } |
| 206 | }); |
| 207 | // Don't initialize the divider or anything until we get the default display. |
Evan Rosky | bed2d1b | 2019-11-05 10:26:24 -0800 | [diff] [blame] | 208 | } |
| 209 | |
| 210 | @Override |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 211 | public void onDisplayAdded(int displayId) { |
| 212 | if (displayId != DEFAULT_DISPLAY) { |
| 213 | return; |
| 214 | } |
| 215 | mSplitLayout = new SplitDisplayLayout(mDisplayController.getDisplayContext(displayId), |
| 216 | mDisplayController.getDisplayLayout(displayId), mSplits); |
| 217 | mImeController.addPositionProcessor(mImePositionProcessor); |
| 218 | mDisplayController.addDisplayChangingController(mRotationController); |
Evan Rosky | b8540a0 | 2020-03-25 16:30:24 -0700 | [diff] [blame] | 219 | if (!ActivityTaskManager.supportsSplitScreenMultiWindow(mContext)) { |
| 220 | removeDivider(); |
| 221 | return; |
| 222 | } |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 223 | try { |
chaviw | da7b3c2 | 2020-04-24 11:25:08 -0700 | [diff] [blame] | 224 | mSplits.init(); |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 225 | // Set starting tile bounds based on middle target |
| 226 | final WindowContainerTransaction tct = new WindowContainerTransaction(); |
| 227 | int midPos = mSplitLayout.getSnapAlgorithm().getMiddleTarget().position; |
| 228 | mSplitLayout.resizeSplits(midPos, tct); |
Wale Ogunwale | 568f9f41 | 2020-03-21 22:27:35 -0700 | [diff] [blame] | 229 | WindowOrganizer.applyTransaction(tct); |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 230 | } catch (Exception e) { |
| 231 | Slog.e(TAG, "Failed to register docked stack listener", e); |
Evan Rosky | b8540a0 | 2020-03-25 16:30:24 -0700 | [diff] [blame] | 232 | removeDivider(); |
| 233 | return; |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 234 | } |
Evan Rosky | 8d1c24e | 2020-04-23 09:21:16 -0700 | [diff] [blame] | 235 | ActivityManagerWrapper.getInstance().registerTaskStackListener(mActivityRestartListener); |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 236 | } |
| 237 | |
| 238 | @Override |
| 239 | public void onDisplayConfigurationChanged(int displayId, Configuration newConfig) { |
Evan Rosky | b8540a0 | 2020-03-25 16:30:24 -0700 | [diff] [blame] | 240 | if (displayId != DEFAULT_DISPLAY || !mSplits.isSplitScreenSupported()) { |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 241 | return; |
| 242 | } |
| 243 | mSplitLayout = new SplitDisplayLayout(mDisplayController.getDisplayContext(displayId), |
| 244 | mDisplayController.getDisplayLayout(displayId), mSplits); |
| 245 | if (mRotateSplitLayout == null) { |
| 246 | int midPos = mSplitLayout.getSnapAlgorithm().getMiddleTarget().position; |
| 247 | final WindowContainerTransaction tct = new WindowContainerTransaction(); |
| 248 | mSplitLayout.resizeSplits(midPos, tct); |
Wale Ogunwale | adf116e | 2020-03-27 16:36:01 -0700 | [diff] [blame] | 249 | WindowOrganizer.applyTransaction(tct); |
| 250 | } else if (mSplitLayout.mDisplayLayout.rotation() |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 251 | == mRotateSplitLayout.mDisplayLayout.rotation()) { |
| 252 | mSplitLayout.mPrimary = new Rect(mRotateSplitLayout.mPrimary); |
| 253 | mSplitLayout.mSecondary = new Rect(mRotateSplitLayout.mSecondary); |
| 254 | mRotateSplitLayout = null; |
| 255 | } |
Tony Huang | 3dd2b93 | 2020-06-15 05:40:40 +0000 | [diff] [blame] | 256 | update(newConfig); |
Jorim Jaggi | 1fcbab6 | 2015-11-04 16:39:50 +0100 | [diff] [blame] | 257 | } |
| 258 | |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 259 | Handler getHandler() { |
| 260 | return mHandler; |
| 261 | } |
| 262 | |
Jorim Jaggi | dd98d41 | 2015-11-18 15:57:38 -0800 | [diff] [blame] | 263 | public DividerView getView() { |
| 264 | return mView; |
| 265 | } |
| 266 | |
Matthew Ng | 8d37288 | 2016-12-20 11:06:49 -0800 | [diff] [blame] | 267 | public boolean isMinimized() { |
| 268 | return mMinimized; |
| 269 | } |
| 270 | |
Matthew Ng | fb692ac | 2017-02-02 14:02:56 -0800 | [diff] [blame] | 271 | public boolean isHomeStackResizable() { |
| 272 | return mHomeStackResizable; |
| 273 | } |
| 274 | |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 275 | /** {@code true} if this is visible */ |
Evan Rosky | 90d5b6d | 2020-05-13 19:39:05 -0700 | [diff] [blame] | 276 | public boolean isDividerVisible() { |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 277 | return mView != null && mView.getVisibility() == View.VISIBLE; |
| 278 | } |
| 279 | |
Evan Rosky | 90d5b6d | 2020-05-13 19:39:05 -0700 | [diff] [blame] | 280 | /** |
| 281 | * This indicates that at-least one of the splits has content. This differs from |
| 282 | * isDividerVisible because the divider is only visible once *everything* is in split mode |
| 283 | * while this only cares if some things are (eg. while entering/exiting as well). |
| 284 | */ |
| 285 | private boolean isSplitActive() { |
| 286 | return mSplits.mPrimary.topActivityType != ACTIVITY_TYPE_UNDEFINED |
| 287 | || mSplits.mSecondary.topActivityType != ACTIVITY_TYPE_UNDEFINED; |
| 288 | } |
| 289 | |
Jorim Jaggi | 1fcbab6 | 2015-11-04 16:39:50 +0100 | [diff] [blame] | 290 | private void addDivider(Configuration configuration) { |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 291 | Context dctx = mDisplayController.getDisplayContext(mContext.getDisplayId()); |
Jorim Jaggi | dd98d41 | 2015-11-18 15:57:38 -0800 | [diff] [blame] | 292 | mView = (DividerView) |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 293 | LayoutInflater.from(dctx).inflate(R.layout.docked_stack_divider, null); |
| 294 | DisplayLayout displayLayout = mDisplayController.getDisplayLayout(mContext.getDisplayId()); |
Evan Rosky | c3a5090 | 2020-05-19 13:36:28 -0700 | [diff] [blame] | 295 | mView.injectDependencies(mWindowManager, mDividerState, this, mSplits, mSplitLayout, |
Evan Rosky | 3613854 | 2020-05-01 18:02:11 -0700 | [diff] [blame] | 296 | mImePositionProcessor, mWindowManagerProxy); |
Filip Gruszczynski | 64cdc14 | 2015-11-29 21:10:07 -0800 | [diff] [blame] | 297 | mView.setVisibility(mVisible ? View.VISIBLE : View.INVISIBLE); |
Evan Rosky | 3613854 | 2020-05-01 18:02:11 -0700 | [diff] [blame] | 298 | mView.setMinimizedDockStack(mMinimized, mHomeStackResizable, null /* transaction */); |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 299 | final int size = dctx.getResources().getDimensionPixelSize( |
Jorim Jaggi | 11c62e1 | 2016-04-05 20:41:21 -0700 | [diff] [blame] | 300 | com.android.internal.R.dimen.docked_stack_divider_thickness); |
Jorim Jaggi | 1fcbab6 | 2015-11-04 16:39:50 +0100 | [diff] [blame] | 301 | final boolean landscape = configuration.orientation == ORIENTATION_LANDSCAPE; |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 302 | final int width = landscape ? size : displayLayout.width(); |
| 303 | final int height = landscape ? displayLayout.height() : size; |
| 304 | mWindowManager.add(mView, width, height, mContext.getDisplayId()); |
Jorim Jaggi | 1fcbab6 | 2015-11-04 16:39:50 +0100 | [diff] [blame] | 305 | } |
| 306 | |
| 307 | private void removeDivider() { |
Wale Ogunwale | 15ba151 | 2017-06-06 08:31:17 -0700 | [diff] [blame] | 308 | if (mView != null) { |
| 309 | mView.onDividerRemoved(); |
| 310 | } |
Jorim Jaggi | 1fcbab6 | 2015-11-04 16:39:50 +0100 | [diff] [blame] | 311 | mWindowManager.remove(); |
| 312 | } |
| 313 | |
| 314 | private void update(Configuration configuration) { |
Tony Huang | df3cfc1 | 2020-04-29 15:47:53 +0800 | [diff] [blame] | 315 | final boolean isDividerHidden = mView != null && mView.isHidden(); |
| 316 | |
Jorim Jaggi | 1fcbab6 | 2015-11-04 16:39:50 +0100 | [diff] [blame] | 317 | removeDivider(); |
| 318 | addDivider(configuration); |
Tony Huang | df3cfc1 | 2020-04-29 15:47:53 +0800 | [diff] [blame] | 319 | |
Vishnu Nair | 4880a30 | 2020-05-08 11:05:58 -0700 | [diff] [blame] | 320 | if (mMinimized) { |
Evan Rosky | 3613854 | 2020-05-01 18:02:11 -0700 | [diff] [blame] | 321 | mView.setMinimizedDockStack(true, mHomeStackResizable, null /* transaction */); |
Vishnu Nair | 4880a30 | 2020-05-08 11:05:58 -0700 | [diff] [blame] | 322 | updateTouchable(); |
Jorim Jaggi | 42625d1b | 2016-02-11 20:11:07 -0800 | [diff] [blame] | 323 | } |
Vishnu Nair | 4880a30 | 2020-05-08 11:05:58 -0700 | [diff] [blame] | 324 | mView.setHidden(isDividerHidden); |
Jorim Jaggi | 1fcbab6 | 2015-11-04 16:39:50 +0100 | [diff] [blame] | 325 | } |
Filip Gruszczynski | 64cdc14 | 2015-11-29 21:10:07 -0800 | [diff] [blame] | 326 | |
chaviw | da7b3c2 | 2020-04-24 11:25:08 -0700 | [diff] [blame] | 327 | void onTaskVanished() { |
| 328 | mHandler.post(this::removeDivider); |
| 329 | } |
| 330 | |
Tony Huang | 3dd2b93 | 2020-06-15 05:40:40 +0000 | [diff] [blame] | 331 | void onTasksReady() { |
| 332 | mHandler.post(() -> update(mDisplayController.getDisplayContext( |
| 333 | mContext.getDisplayId()).getResources().getConfiguration())); |
| 334 | } |
| 335 | |
Vishnu Nair | 4880a30 | 2020-05-08 11:05:58 -0700 | [diff] [blame] | 336 | private void updateVisibility(final boolean visible) { |
Evan Rosky | fdc71c4 | 2020-03-13 18:23:08 -0700 | [diff] [blame] | 337 | if (DEBUG) Slog.d(TAG, "Updating visibility " + mVisible + "->" + visible); |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 338 | if (mVisible != visible) { |
| 339 | mVisible = visible; |
| 340 | mView.setVisibility(visible ? View.VISIBLE : View.INVISIBLE); |
Jorim Jaggi | ef92d6f | 2016-03-25 22:07:16 -0700 | [diff] [blame] | 341 | |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 342 | if (visible) { |
| 343 | mView.enterSplitMode(mHomeStackResizable); |
| 344 | // Update state because animations won't finish. |
Evan Rosky | 3613854 | 2020-05-01 18:02:11 -0700 | [diff] [blame] | 345 | mWindowManagerProxy.runInSync( |
| 346 | t -> mView.setMinimizedDockStack(mMinimized, mHomeStackResizable, t)); |
| 347 | |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 348 | } else { |
| 349 | mView.exitSplitMode(); |
Evan Rosky | 3613854 | 2020-05-01 18:02:11 -0700 | [diff] [blame] | 350 | mWindowManagerProxy.runInSync( |
| 351 | t -> mView.setMinimizedDockStack(false, mHomeStackResizable, t)); |
Filip Gruszczynski | 64cdc14 | 2015-11-29 21:10:07 -0800 | [diff] [blame] | 352 | } |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 353 | // Notify existence listeners |
| 354 | synchronized (mDockedStackExistsListeners) { |
| 355 | mDockedStackExistsListeners.removeIf(wf -> { |
| 356 | Consumer<Boolean> l = wf.get(); |
| 357 | if (l != null) l.accept(visible); |
| 358 | return l == null; |
| 359 | }); |
| 360 | } |
| 361 | } |
| 362 | } |
| 363 | |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 364 | /** Switch to minimized state if appropriate */ |
| 365 | public void setMinimized(final boolean minimized) { |
Evan Rosky | fdc71c4 | 2020-03-13 18:23:08 -0700 | [diff] [blame] | 366 | if (DEBUG) Slog.d(TAG, "posting ext setMinimized " + minimized + " vis:" + mVisible); |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 367 | mHandler.post(() -> { |
Evan Rosky | fdc71c4 | 2020-03-13 18:23:08 -0700 | [diff] [blame] | 368 | if (DEBUG) Slog.d(TAG, "run posted ext setMinimized " + minimized + " vis:" + mVisible); |
| 369 | if (!mVisible) { |
| 370 | return; |
| 371 | } |
Evan Rosky | fe31c04 | 2020-03-06 19:35:48 -0800 | [diff] [blame] | 372 | setHomeMinimized(minimized, mHomeStackResizable); |
Wale Ogunwale | 91ac7d7 | 2020-03-10 13:46:27 +0000 | [diff] [blame] | 373 | }); |
Evan Rosky | 877739b | 2020-03-06 19:35:48 -0800 | [diff] [blame] | 374 | } |
| 375 | |
Evan Rosky | fe31c04 | 2020-03-06 19:35:48 -0800 | [diff] [blame] | 376 | private void setHomeMinimized(final boolean minimized, boolean homeStackResizable) { |
Evan Rosky | fdc71c4 | 2020-03-13 18:23:08 -0700 | [diff] [blame] | 377 | if (DEBUG) { |
| 378 | Slog.d(TAG, "setHomeMinimized min:" + mMinimized + "->" + minimized + " hrsz:" |
Evan Rosky | 90d5b6d | 2020-05-13 19:39:05 -0700 | [diff] [blame] | 379 | + mHomeStackResizable + "->" + homeStackResizable |
| 380 | + " split:" + isDividerVisible()); |
Evan Rosky | fdc71c4 | 2020-03-13 18:23:08 -0700 | [diff] [blame] | 381 | } |
Evan Rosky | fe31c04 | 2020-03-06 19:35:48 -0800 | [diff] [blame] | 382 | WindowContainerTransaction wct = new WindowContainerTransaction(); |
Evan Rosky | f64f5da | 2020-03-16 13:47:48 -0700 | [diff] [blame] | 383 | final boolean minimizedChanged = mMinimized != minimized; |
Evan Rosky | fe31c04 | 2020-03-06 19:35:48 -0800 | [diff] [blame] | 384 | // Update minimized state |
Evan Rosky | f64f5da | 2020-03-16 13:47:48 -0700 | [diff] [blame] | 385 | if (minimizedChanged) { |
Evan Rosky | fe31c04 | 2020-03-06 19:35:48 -0800 | [diff] [blame] | 386 | mMinimized = minimized; |
| 387 | } |
| 388 | // Always set this because we could be entering split when mMinimized is already true |
| 389 | wct.setFocusable(mSplits.mPrimary.token, !mMinimized); |
| 390 | |
| 391 | // Update home-stack resizability |
Evan Rosky | f64f5da | 2020-03-16 13:47:48 -0700 | [diff] [blame] | 392 | final boolean homeResizableChanged = mHomeStackResizable != homeStackResizable; |
| 393 | if (homeResizableChanged) { |
Evan Rosky | fe31c04 | 2020-03-06 19:35:48 -0800 | [diff] [blame] | 394 | mHomeStackResizable = homeStackResizable; |
Evan Rosky | 90d5b6d | 2020-05-13 19:39:05 -0700 | [diff] [blame] | 395 | if (isDividerVisible()) { |
Evan Rosky | fe31c04 | 2020-03-06 19:35:48 -0800 | [diff] [blame] | 396 | WindowManagerProxy.applyHomeTasksMinimized( |
| 397 | mSplitLayout, mSplits.mSecondary.token, wct); |
| 398 | } |
| 399 | } |
| 400 | |
| 401 | // Sync state to DividerView if it exists. |
| 402 | if (mView != null) { |
Evan Rosky | c0eec05 | 2020-03-06 18:54:55 -0800 | [diff] [blame] | 403 | final int displayId = mView.getDisplay() != null |
| 404 | ? mView.getDisplay().getDisplayId() : DEFAULT_DISPLAY; |
| 405 | // pause ime here (before updateMinimizedDockedStack) |
| 406 | if (mMinimized) { |
| 407 | mImePositionProcessor.pause(displayId); |
| 408 | } |
Evan Rosky | f64f5da | 2020-03-16 13:47:48 -0700 | [diff] [blame] | 409 | if (minimizedChanged || homeResizableChanged) { |
| 410 | // This conflicts with IME adjustment, so only call it when things change. |
| 411 | mView.setMinimizedDockStack(minimized, getAnimDuration(), homeStackResizable); |
| 412 | } |
Evan Rosky | c0eec05 | 2020-03-06 18:54:55 -0800 | [diff] [blame] | 413 | if (!mMinimized) { |
| 414 | // afterwards so it can end any animations started in view |
| 415 | mImePositionProcessor.resume(displayId); |
| 416 | } |
Evan Rosky | fe31c04 | 2020-03-06 19:35:48 -0800 | [diff] [blame] | 417 | } |
| 418 | updateTouchable(); |
Evan Rosky | 3613854 | 2020-05-01 18:02:11 -0700 | [diff] [blame] | 419 | mWindowManagerProxy.applySyncTransaction(wct); |
Evan Rosky | fe31c04 | 2020-03-06 19:35:48 -0800 | [diff] [blame] | 420 | } |
| 421 | |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 422 | void setAdjustedForIme(boolean adjustedForIme) { |
| 423 | if (mAdjustedForIme == adjustedForIme) { |
| 424 | return; |
| 425 | } |
| 426 | mAdjustedForIme = adjustedForIme; |
| 427 | updateTouchable(); |
Jorim Jaggi | 2adba07 | 2016-03-03 13:43:39 +0100 | [diff] [blame] | 428 | } |
| 429 | |
Jorim Jaggi | 698e763 | 2016-04-13 21:02:22 -0700 | [diff] [blame] | 430 | private void updateTouchable() { |
Evan Rosky | 89c285e | 2020-06-17 21:21:53 -0700 | [diff] [blame] | 431 | mWindowManager.setTouchable(!mAdjustedForIme); |
Jorim Jaggi | 698e763 | 2016-04-13 21:02:22 -0700 | [diff] [blame] | 432 | } |
| 433 | |
Winson Chung | 60fa647 | 2017-06-12 15:30:14 -0700 | [diff] [blame] | 434 | /** |
Winson Chung | 67f5c8b | 2018-09-24 12:09:19 -0700 | [diff] [blame] | 435 | * Workaround for b/62528361, at the time recents has drawn, it may happen before a |
Winson Chung | 60fa647 | 2017-06-12 15:30:14 -0700 | [diff] [blame] | 436 | * configuration change to the Divider, and internally, the event will be posted to the |
| 437 | * subscriber, or DividerView, which has been removed and prevented from resizing. Instead, |
| 438 | * register the event handler here and proxy the event to the current DividerView. |
| 439 | */ |
Winson Chung | 67f5c8b | 2018-09-24 12:09:19 -0700 | [diff] [blame] | 440 | public void onRecentsDrawn() { |
Winson Chung | 60fa647 | 2017-06-12 15:30:14 -0700 | [diff] [blame] | 441 | if (mView != null) { |
| 442 | mView.onRecentsDrawn(); |
| 443 | } |
| 444 | } |
| 445 | |
Winson Chung | 67f5c8b | 2018-09-24 12:09:19 -0700 | [diff] [blame] | 446 | public void onUndockingTask() { |
| 447 | if (mView != null) { |
| 448 | mView.onUndockingTask(); |
| 449 | } |
| 450 | } |
| 451 | |
| 452 | public void onDockedFirstAnimationFrame() { |
| 453 | if (mView != null) { |
| 454 | mView.onDockedFirstAnimationFrame(); |
| 455 | } |
| 456 | } |
| 457 | |
| 458 | public void onDockedTopTask() { |
| 459 | if (mView != null) { |
| 460 | mView.onDockedTopTask(); |
| 461 | } |
| 462 | } |
| 463 | |
| 464 | public void onAppTransitionFinished() { |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 465 | if (mView == null) { |
| 466 | return; |
| 467 | } |
Winson Chung | 67f5c8b | 2018-09-24 12:09:19 -0700 | [diff] [blame] | 468 | mForcedResizableController.onAppTransitionFinished(); |
| 469 | } |
| 470 | |
| 471 | @Override |
| 472 | public void onDraggingStart() { |
| 473 | mForcedResizableController.onDraggingStart(); |
| 474 | } |
| 475 | |
| 476 | @Override |
| 477 | public void onDraggingEnd() { |
| 478 | mForcedResizableController.onDraggingEnd(); |
| 479 | } |
| 480 | |
| 481 | @Override |
| 482 | public void growRecents() { |
Dave Mankoff | 6c64d1f | 2019-11-07 17:27:50 -0500 | [diff] [blame] | 483 | mRecentsOptionalLazy.ifPresent(recentsLazy -> recentsLazy.get().growRecents()); |
Winson Chung | 67f5c8b | 2018-09-24 12:09:19 -0700 | [diff] [blame] | 484 | } |
| 485 | |
Jorim Jaggi | 31f7170 | 2016-05-04 16:43:04 -0700 | [diff] [blame] | 486 | @Override |
| 487 | public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { |
| 488 | pw.print(" mVisible="); pw.println(mVisible); |
| 489 | pw.print(" mMinimized="); pw.println(mMinimized); |
| 490 | pw.print(" mAdjustedForIme="); pw.println(mAdjustedForIme); |
| 491 | } |
| 492 | |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 493 | long getAnimDuration() { |
| 494 | float transitionScale = Settings.Global.getFloat(mContext.getContentResolver(), |
| 495 | Settings.Global.TRANSITION_ANIMATION_SCALE, |
| 496 | mContext.getResources().getFloat( |
| 497 | com.android.internal.R.dimen |
| 498 | .config_appTransitionAnimationDurationScaleDefault)); |
| 499 | final long transitionDuration = DEFAULT_APP_TRANSITION_DURATION; |
| 500 | return (long) (transitionDuration * transitionScale); |
| 501 | } |
Jorim Jaggi | a6c934e | 2015-12-21 13:22:31 +0100 | [diff] [blame] | 502 | |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 503 | /** Register a listener that gets called whenever the existence of the divider changes */ |
| 504 | public void registerInSplitScreenListener(Consumer<Boolean> listener) { |
Evan Rosky | 90d5b6d | 2020-05-13 19:39:05 -0700 | [diff] [blame] | 505 | listener.accept(isDividerVisible()); |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 506 | synchronized (mDockedStackExistsListeners) { |
| 507 | mDockedStackExistsListeners.add(new WeakReference<>(listener)); |
Filip Gruszczynski | 64cdc14 | 2015-11-29 21:10:07 -0800 | [diff] [blame] | 508 | } |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 509 | } |
Jorim Jaggi | a6c934e | 2015-12-21 13:22:31 +0100 | [diff] [blame] | 510 | |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 511 | void startEnterSplit() { |
Vishnu Nair | 4880a30 | 2020-05-08 11:05:58 -0700 | [diff] [blame] | 512 | update(mDisplayController.getDisplayContext( |
| 513 | mContext.getDisplayId()).getResources().getConfiguration()); |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 514 | // Set resizable directly here because applyEnterSplit already resizes home stack. |
Evan Rosky | 3613854 | 2020-05-01 18:02:11 -0700 | [diff] [blame] | 515 | mHomeStackResizable = mWindowManagerProxy.applyEnterSplit(mSplits, mSplitLayout); |
| 516 | } |
| 517 | |
| 518 | void startDismissSplit() { |
| 519 | mWindowManagerProxy.applyDismissSplit(mSplits, mSplitLayout, true /* dismissOrMaximize */); |
| 520 | updateVisibility(false /* visible */); |
| 521 | mMinimized = false; |
| 522 | removeDivider(); |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 523 | } |
| 524 | |
| 525 | void ensureMinimizedSplit() { |
Evan Rosky | 89c285e | 2020-06-17 21:21:53 -0700 | [diff] [blame] | 526 | setHomeMinimized(true /* minimized */, mHomeStackResizable); |
Tony Huang | 3dd2b93 | 2020-06-15 05:40:40 +0000 | [diff] [blame] | 527 | if (!isDividerVisible()) { |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 528 | // Wasn't in split-mode yet, so enter now. |
| 529 | if (DEBUG) { |
Evan Rosky | fdc71c4 | 2020-03-13 18:23:08 -0700 | [diff] [blame] | 530 | Slog.d(TAG, " entering split mode with minimized=true"); |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 531 | } |
| 532 | updateVisibility(true /* visible */); |
Jorim Jaggi | a6c934e | 2015-12-21 13:22:31 +0100 | [diff] [blame] | 533 | } |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 534 | } |
Jorim Jaggi | 42625d1b | 2016-02-11 20:11:07 -0800 | [diff] [blame] | 535 | |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 536 | void ensureNormalSplit() { |
Evan Rosky | fe31c04 | 2020-03-06 19:35:48 -0800 | [diff] [blame] | 537 | setHomeMinimized(false /* minimized */, mHomeStackResizable); |
Tony Huang | 3dd2b93 | 2020-06-15 05:40:40 +0000 | [diff] [blame] | 538 | if (!isDividerVisible()) { |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 539 | // Wasn't in split-mode, so enter now. |
| 540 | if (DEBUG) { |
Evan Rosky | fdc71c4 | 2020-03-13 18:23:08 -0700 | [diff] [blame] | 541 | Slog.d(TAG, " enter split mode unminimized "); |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 542 | } |
Evan Rosky | af9f27c | 2020-02-18 18:58:35 +0000 | [diff] [blame] | 543 | updateVisibility(true /* visible */); |
Jorim Jaggi | 42625d1b | 2016-02-11 20:11:07 -0800 | [diff] [blame] | 544 | } |
Filip Gruszczynski | 64cdc14 | 2015-11-29 21:10:07 -0800 | [diff] [blame] | 545 | } |
Evan Rosky | 2af969c | 2020-05-08 16:26:31 +0000 | [diff] [blame] | 546 | |
Evan Rosky | c48c939 | 2020-05-19 11:54:21 -0700 | [diff] [blame] | 547 | SplitDisplayLayout getSplitLayout() { |
| 548 | return mSplitLayout; |
| 549 | } |
| 550 | |
Evan Rosky | 3613854 | 2020-05-01 18:02:11 -0700 | [diff] [blame] | 551 | WindowManagerProxy getWmProxy() { |
| 552 | return mWindowManagerProxy; |
| 553 | } |
| 554 | |
Evan Rosky | 2af969c | 2020-05-08 16:26:31 +0000 | [diff] [blame] | 555 | /** @return the container token for the secondary split root task. */ |
| 556 | public WindowContainerToken getSecondaryRoot() { |
| 557 | if (mSplits == null || mSplits.mSecondary == null) { |
| 558 | return null; |
| 559 | } |
| 560 | return mSplits.mSecondary.token; |
| 561 | } |
Jorim Jaggi | 1fcbab6 | 2015-11-04 16:39:50 +0100 | [diff] [blame] | 562 | } |