Winson Chung | 655332c | 2016-10-31 13:14:28 -0700 | [diff] [blame] | 1 | /** |
| 2 | * Copyright (c) 2016, 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 android.view; |
| 18 | |
Winson Chung | a29eb98 | 2016-12-14 12:01:27 -0800 | [diff] [blame] | 19 | import android.content.pm.ParceledListSlice; |
Winson Chung | 2a82fe5 | 2017-02-02 14:43:34 -0800 | [diff] [blame] | 20 | import android.graphics.Rect; |
Winson Chung | 655332c | 2016-10-31 13:14:28 -0700 | [diff] [blame] | 21 | import android.view.IPinnedStackController; |
| 22 | |
| 23 | /** |
Winson Chung | a29eb98 | 2016-12-14 12:01:27 -0800 | [diff] [blame] | 24 | * Listener for changes to the pinned stack made by the WindowManager. |
| 25 | * |
| 26 | * @hide |
| 27 | */ |
Winson Chung | 655332c | 2016-10-31 13:14:28 -0700 | [diff] [blame] | 28 | oneway interface IPinnedStackListener { |
| 29 | |
| 30 | /** |
| 31 | * Called when the listener is registered and provides an interface to call back to the pinned |
| 32 | * stack controller to update the controller of the pinned stack state. |
| 33 | */ |
| 34 | void onListenerRegistered(IPinnedStackController controller); |
| 35 | |
| 36 | /** |
Winson Chung | 2a82fe5 | 2017-02-02 14:43:34 -0800 | [diff] [blame] | 37 | * Called when the window manager has detected a change that would cause the movement bounds |
| 38 | * to be changed (ie. after configuration change, aspect ratio change, etc). It then provides |
| 39 | * the components that allow the listener to calculate the movement bounds itself. The |
| 40 | * {@param normalBounds} are also the default bounds that the PiP would be entered in its |
Winson Chung | baa7b72 | 2017-03-03 21:33:44 -0800 | [diff] [blame] | 41 | * current state with the aspect ratio applied. The {@param animatingBounds} are provided |
| 42 | * to indicate the current target bounds of the pinned stack (the final bounds if animating, |
| 43 | * the current bounds if not), which may be helpful in calculating dependent animation bounds. |
Winson Chung | ef4dc81 | 2017-04-11 13:31:44 -0700 | [diff] [blame] | 44 | * |
| 45 | * The {@param displayRotation} is provided so that the client can verify when making certain |
| 46 | * calls that it will not provide stale information based on an old display rotation (ie. if |
| 47 | * the WM has changed in the mean time but the client has not received onMovementBoundsChanged). |
Winson Chung | 655332c | 2016-10-31 13:14:28 -0700 | [diff] [blame] | 48 | */ |
Winson Chung | baa7b72 | 2017-03-03 21:33:44 -0800 | [diff] [blame] | 49 | void onMovementBoundsChanged(in Rect insetBounds, in Rect normalBounds, in Rect animatingBounds, |
Tracy Zhou | 4351308 | 2018-03-08 21:58:36 -0800 | [diff] [blame] | 50 | boolean fromImeAdjustment, boolean fromShelfAdjustment, int displayRotation); |
Winson Chung | 2a82fe5 | 2017-02-02 14:43:34 -0800 | [diff] [blame] | 51 | |
| 52 | /** |
| 53 | * Called when window manager decides to adjust the pinned stack bounds because of the IME, or |
| 54 | * when the listener is first registered to allow the listener to synchronized its state with |
| 55 | * the controller. This call will always be followed by a onMovementBoundsChanged() call |
Tracy Zhou | 4351308 | 2018-03-08 21:58:36 -0800 | [diff] [blame] | 56 | * with fromImeAdjustement set to {@code true}. |
Winson Chung | 2a82fe5 | 2017-02-02 14:43:34 -0800 | [diff] [blame] | 57 | */ |
| 58 | void onImeVisibilityChanged(boolean imeVisible, int imeHeight); |
Winson Chung | a29eb98 | 2016-12-14 12:01:27 -0800 | [diff] [blame] | 59 | |
| 60 | /** |
Tracy Zhou | 4351308 | 2018-03-08 21:58:36 -0800 | [diff] [blame] | 61 | * Called when window manager decides to adjust the pinned stack bounds because of the shelf, or |
| 62 | * when the listener is first registered to allow the listener to synchronized its state with |
| 63 | * the controller. This call will always be followed by a onMovementBoundsChanged() call |
| 64 | * with fromShelfAdjustment set to {@code true}. |
| 65 | */ |
| 66 | void onShelfVisibilityChanged(boolean shelfVisible, int shelfHeight); |
| 67 | |
| 68 | /** |
Winson Chung | a29eb98 | 2016-12-14 12:01:27 -0800 | [diff] [blame] | 69 | * Called when window manager decides to adjust the minimized state, or when the listener |
| 70 | * is first registered to allow the listener to synchronized its state with the controller. |
| 71 | */ |
| 72 | void onMinimizedStateChanged(boolean isMinimized); |
| 73 | |
| 74 | /** |
Winson Chung | a29eb98 | 2016-12-14 12:01:27 -0800 | [diff] [blame] | 75 | * Called when the set of actions for the current PiP activity changes, or when the listener |
| 76 | * is first registered to allow the listener to synchronized its state with the controller. |
| 77 | */ |
| 78 | void onActionsChanged(in ParceledListSlice actions); |
Winson Chung | 655332c | 2016-10-31 13:14:28 -0700 | [diff] [blame] | 79 | } |