Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [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.systemui.bubbles; |
| 18 | |
Mady Mellor | d1c78b26 | 2018-11-06 18:04:40 -0800 | [diff] [blame] | 19 | import static android.view.View.INVISIBLE; |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 20 | import static android.view.View.VISIBLE; |
Joshua Tsuji | b1a796b | 2019-01-16 15:43:12 -0800 | [diff] [blame] | 21 | import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 22 | |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 23 | import static com.android.systemui.statusbar.StatusBarState.SHADE; |
| 24 | import static com.android.systemui.statusbar.notification.NotificationAlertingManager.alertAgain; |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 25 | |
Mady Mellor | b4991e6 | 2019-01-10 15:14:51 -0800 | [diff] [blame] | 26 | import android.annotation.Nullable; |
Mark Renouf | c808f06 | 2019-02-07 15:20:37 -0500 | [diff] [blame] | 27 | import android.app.ActivityManager.RunningTaskInfo; |
Mark Renouf | cecc77b | 2019-01-30 16:32:24 -0500 | [diff] [blame] | 28 | import android.app.ActivityTaskManager; |
| 29 | import android.app.IActivityTaskManager; |
Mady Mellor | b4991e6 | 2019-01-10 15:14:51 -0800 | [diff] [blame] | 30 | import android.app.INotificationManager; |
Mady Mellor | 5549dd2 | 2018-11-06 18:07:34 -0800 | [diff] [blame] | 31 | import android.app.Notification; |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 32 | import android.content.Context; |
Joshua Tsuji | a19515f | 2019-02-13 18:02:29 -0500 | [diff] [blame] | 33 | import android.content.pm.ParceledListSlice; |
Mady Mellor | d1c78b26 | 2018-11-06 18:04:40 -0800 | [diff] [blame] | 34 | import android.graphics.Rect; |
Mark Renouf | cecc77b | 2019-01-30 16:32:24 -0500 | [diff] [blame] | 35 | import android.os.RemoteException; |
Mady Mellor | b4991e6 | 2019-01-10 15:14:51 -0800 | [diff] [blame] | 36 | import android.os.ServiceManager; |
Mady Mellor | ceced17 | 2018-11-27 11:18:39 -0800 | [diff] [blame] | 37 | import android.provider.Settings; |
Mady Mellor | 5549dd2 | 2018-11-06 18:07:34 -0800 | [diff] [blame] | 38 | import android.service.notification.StatusBarNotification; |
Mark Renouf | cecc77b | 2019-01-30 16:32:24 -0500 | [diff] [blame] | 39 | import android.view.Display; |
Joshua Tsuji | a19515f | 2019-02-13 18:02:29 -0500 | [diff] [blame] | 40 | import android.view.IPinnedStackController; |
| 41 | import android.view.IPinnedStackListener; |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 42 | import android.view.ViewGroup; |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 43 | import android.widget.FrameLayout; |
| 44 | |
Mark Renouf | 658c6bc | 2019-01-30 10:26:54 -0500 | [diff] [blame] | 45 | import androidx.annotation.MainThread; |
| 46 | |
Mady Mellor | ebdbbb9 | 2018-11-15 14:36:48 -0800 | [diff] [blame] | 47 | import com.android.internal.annotations.VisibleForTesting; |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 48 | import com.android.internal.statusbar.NotificationVisibility; |
Ned Burns | 01e3821 | 2019-01-03 16:32:52 -0500 | [diff] [blame] | 49 | import com.android.systemui.Dependency; |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 50 | import com.android.systemui.R; |
Beverly | 8fdb533 | 2019-02-04 14:29:49 -0500 | [diff] [blame] | 51 | import com.android.systemui.plugins.statusbar.StatusBarStateController; |
Mark Renouf | cecc77b | 2019-01-30 16:32:24 -0500 | [diff] [blame] | 52 | import com.android.systemui.shared.system.ActivityManagerWrapper; |
| 53 | import com.android.systemui.shared.system.TaskStackChangeListener; |
Joshua Tsuji | a19515f | 2019-02-13 18:02:29 -0500 | [diff] [blame] | 54 | import com.android.systemui.shared.system.WindowManagerWrapper; |
Ned Burns | 01e3821 | 2019-01-03 16:32:52 -0500 | [diff] [blame] | 55 | import com.android.systemui.statusbar.notification.NotificationEntryListener; |
| 56 | import com.android.systemui.statusbar.notification.NotificationEntryManager; |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 57 | import com.android.systemui.statusbar.notification.NotificationInterruptionStateProvider; |
Ned Burns | f81c4c4 | 2019-01-07 14:10:43 -0500 | [diff] [blame] | 58 | import com.android.systemui.statusbar.notification.collection.NotificationEntry; |
Ned Burns | 1a5e22f | 2019-02-14 15:11:52 -0500 | [diff] [blame] | 59 | import com.android.systemui.statusbar.notification.row.NotificationContentInflater.InflationFlag; |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 60 | import com.android.systemui.statusbar.phone.StatusBarWindowController; |
| 61 | |
Jason Monk | 27d01a62 | 2018-12-10 15:57:09 -0500 | [diff] [blame] | 62 | import javax.inject.Inject; |
| 63 | import javax.inject.Singleton; |
| 64 | |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 65 | /** |
| 66 | * Bubbles are a special type of content that can "float" on top of other apps or System UI. |
| 67 | * Bubbles can be expanded to show more content. |
| 68 | * |
| 69 | * The controller manages addition, removal, and visible state of bubbles on screen. |
| 70 | */ |
Jason Monk | 27d01a62 | 2018-12-10 15:57:09 -0500 | [diff] [blame] | 71 | @Singleton |
Mady Mellor | 3d82e68 | 2019-02-05 13:34:48 -0800 | [diff] [blame] | 72 | public class BubbleController implements BubbleExpandedView.OnBubbleBlockedListener { |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 73 | private static final int MAX_BUBBLES = 5; // TODO: actually enforce this |
| 74 | |
| 75 | private static final String TAG = "BubbleController"; |
| 76 | |
Mady Mellor | 5549dd2 | 2018-11-06 18:07:34 -0800 | [diff] [blame] | 77 | // Enables some subset of notifs to automatically become bubbles |
Ned Burns | 01e3821 | 2019-01-03 16:32:52 -0500 | [diff] [blame] | 78 | private static final boolean DEBUG_ENABLE_AUTO_BUBBLE = false; |
Mady Mellor | 5549dd2 | 2018-11-06 18:07:34 -0800 | [diff] [blame] | 79 | |
Mady Mellor | 44ee2fe | 2019-01-30 17:51:16 -0800 | [diff] [blame] | 80 | /** Flag to enable or disable the entire feature */ |
Mady Mellor | f6e3ac0 | 2019-01-29 10:37:52 -0800 | [diff] [blame] | 81 | private static final String ENABLE_BUBBLES = "experiment_enable_bubbles"; |
Mady Mellor | 44ee2fe | 2019-01-30 17:51:16 -0800 | [diff] [blame] | 82 | /** Auto bubble flags set whether different notif types should be presented as a bubble */ |
Mady Mellor | ceced17 | 2018-11-27 11:18:39 -0800 | [diff] [blame] | 83 | private static final String ENABLE_AUTO_BUBBLE_MESSAGES = "experiment_autobubble_messaging"; |
| 84 | private static final String ENABLE_AUTO_BUBBLE_ONGOING = "experiment_autobubble_ongoing"; |
| 85 | private static final String ENABLE_AUTO_BUBBLE_ALL = "experiment_autobubble_all"; |
Mady Mellor | 44ee2fe | 2019-01-30 17:51:16 -0800 | [diff] [blame] | 86 | |
| 87 | /** Use an activityView for an auto-bubbled notifs if it has an appropriate content intent */ |
Mark Renouf | 89b1a4a | 2018-12-04 14:59:45 -0500 | [diff] [blame] | 88 | private static final String ENABLE_BUBBLE_CONTENT_INTENT = "experiment_bubble_content_intent"; |
Mady Mellor | ceced17 | 2018-11-27 11:18:39 -0800 | [diff] [blame] | 89 | |
Mady Mellor | 44ee2fe | 2019-01-30 17:51:16 -0800 | [diff] [blame] | 90 | /** Whether the row of bubble circles are anchored to the top or bottom of the screen. */ |
| 91 | private static final String ENABLE_BUBBLES_AT_TOP = "experiment_enable_top_bubbles"; |
| 92 | /** Flag to position the header below the activity view */ |
| 93 | private static final String ENABLE_BUBBLE_FOOTER = "experiment_enable_bubble_footer"; |
| 94 | |
Joshua Tsuji | 010c2b1 | 2019-02-25 18:11:25 -0500 | [diff] [blame] | 95 | private static final String BUBBLE_STIFFNESS = "experiment_bubble_stiffness"; |
| 96 | private static final String BUBBLE_BOUNCINESS = "experiment_bubble_bounciness"; |
| 97 | |
Ned Burns | 01e3821 | 2019-01-03 16:32:52 -0500 | [diff] [blame] | 98 | private final Context mContext; |
| 99 | private final NotificationEntryManager mNotificationEntryManager; |
Mark Renouf | cecc77b | 2019-01-30 16:32:24 -0500 | [diff] [blame] | 100 | private final IActivityTaskManager mActivityTaskManager; |
| 101 | private final BubbleTaskStackListener mTaskStackListener; |
Mady Mellor | d1c78b26 | 2018-11-06 18:04:40 -0800 | [diff] [blame] | 102 | private BubbleStateChangeListener mStateChangeListener; |
Mady Mellor | cd9b130 | 2018-11-06 18:08:04 -0800 | [diff] [blame] | 103 | private BubbleExpandListener mExpandListener; |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 104 | |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 105 | private BubbleData mBubbleData; |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 106 | private BubbleStackView mStackView; |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 107 | |
| 108 | // Bubbles get added to the status bar view |
Ned Burns | 01e3821 | 2019-01-03 16:32:52 -0500 | [diff] [blame] | 109 | private final StatusBarWindowController mStatusBarWindowController; |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 110 | private StatusBarStateListener mStatusBarStateListener; |
| 111 | |
| 112 | private final NotificationInterruptionStateProvider mNotificationInterruptionStateProvider = |
| 113 | Dependency.get(NotificationInterruptionStateProvider.class); |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 114 | |
Mady Mellor | b4991e6 | 2019-01-10 15:14:51 -0800 | [diff] [blame] | 115 | private INotificationManager mNotificationManagerService; |
| 116 | |
Mady Mellor | d1c78b26 | 2018-11-06 18:04:40 -0800 | [diff] [blame] | 117 | // Used for determining view rect for touch interaction |
| 118 | private Rect mTempRect = new Rect(); |
| 119 | |
Mady Mellor | 5549dd2 | 2018-11-06 18:07:34 -0800 | [diff] [blame] | 120 | /** |
Mady Mellor | d1c78b26 | 2018-11-06 18:04:40 -0800 | [diff] [blame] | 121 | * Listener to be notified when some states of the bubbles change. |
| 122 | */ |
| 123 | public interface BubbleStateChangeListener { |
| 124 | /** |
| 125 | * Called when the stack has bubbles or no longer has bubbles. |
| 126 | */ |
| 127 | void onHasBubblesChanged(boolean hasBubbles); |
| 128 | } |
| 129 | |
Mady Mellor | cd9b130 | 2018-11-06 18:08:04 -0800 | [diff] [blame] | 130 | /** |
| 131 | * Listener to find out about stack expansion / collapse events. |
| 132 | */ |
| 133 | public interface BubbleExpandListener { |
| 134 | /** |
| 135 | * Called when the expansion state of the bubble stack changes. |
Mady Mellor | cd9b130 | 2018-11-06 18:08:04 -0800 | [diff] [blame] | 136 | * @param isExpanding whether it's expanding or collapsing |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 137 | * @param key the notification key associated with bubble being expanded |
Mady Mellor | cd9b130 | 2018-11-06 18:08:04 -0800 | [diff] [blame] | 138 | */ |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 139 | void onBubbleExpandChanged(boolean isExpanding, String key); |
| 140 | } |
| 141 | |
| 142 | /** |
| 143 | * Listens for the current state of the status bar and updates the visibility state |
| 144 | * of bubbles as needed. |
| 145 | */ |
| 146 | private class StatusBarStateListener implements StatusBarStateController.StateListener { |
| 147 | private int mState; |
| 148 | /** |
| 149 | * Returns the current status bar state. |
| 150 | */ |
| 151 | public int getCurrentState() { |
| 152 | return mState; |
| 153 | } |
| 154 | |
| 155 | @Override |
| 156 | public void onStateChanged(int newState) { |
| 157 | mState = newState; |
| 158 | updateVisibility(); |
| 159 | } |
Mady Mellor | cd9b130 | 2018-11-06 18:08:04 -0800 | [diff] [blame] | 160 | } |
| 161 | |
Jason Monk | 27d01a62 | 2018-12-10 15:57:09 -0500 | [diff] [blame] | 162 | @Inject |
Mady Mellor | cfd06c1 | 2019-02-13 14:32:12 -0800 | [diff] [blame] | 163 | public BubbleController(Context context, StatusBarWindowController statusBarWindowController, |
| 164 | BubbleData data) { |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 165 | mContext = context; |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 166 | |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 167 | mNotificationEntryManager = Dependency.get(NotificationEntryManager.class); |
Ned Burns | 01e3821 | 2019-01-03 16:32:52 -0500 | [diff] [blame] | 168 | mNotificationEntryManager.addNotificationEntryListener(mEntryListener); |
Mady Mellor | b4991e6 | 2019-01-10 15:14:51 -0800 | [diff] [blame] | 169 | |
| 170 | try { |
| 171 | mNotificationManagerService = INotificationManager.Stub.asInterface( |
| 172 | ServiceManager.getServiceOrThrow(Context.NOTIFICATION_SERVICE)); |
| 173 | } catch (ServiceManager.ServiceNotFoundException e) { |
| 174 | e.printStackTrace(); |
| 175 | } |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 176 | |
| 177 | mStatusBarWindowController = statusBarWindowController; |
| 178 | mStatusBarStateListener = new StatusBarStateListener(); |
| 179 | Dependency.get(StatusBarStateController.class).addCallback(mStatusBarStateListener); |
Mark Renouf | cecc77b | 2019-01-30 16:32:24 -0500 | [diff] [blame] | 180 | |
| 181 | mActivityTaskManager = ActivityTaskManager.getService(); |
| 182 | mTaskStackListener = new BubbleTaskStackListener(); |
| 183 | ActivityManagerWrapper.getInstance().registerTaskStackListener(mTaskStackListener); |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 184 | |
Joshua Tsuji | a19515f | 2019-02-13 18:02:29 -0500 | [diff] [blame] | 185 | try { |
| 186 | WindowManagerWrapper.getInstance().addPinnedStackListener(new BubblesImeListener()); |
| 187 | } catch (RemoteException e) { |
| 188 | e.printStackTrace(); |
| 189 | } |
| 190 | |
Mady Mellor | cfd06c1 | 2019-02-13 14:32:12 -0800 | [diff] [blame] | 191 | mBubbleData = data; |
Mady Mellor | 5549dd2 | 2018-11-06 18:07:34 -0800 | [diff] [blame] | 192 | } |
| 193 | |
| 194 | /** |
Mady Mellor | d1c78b26 | 2018-11-06 18:04:40 -0800 | [diff] [blame] | 195 | * Set a listener to be notified when some states of the bubbles change. |
| 196 | */ |
| 197 | public void setBubbleStateChangeListener(BubbleStateChangeListener listener) { |
| 198 | mStateChangeListener = listener; |
| 199 | } |
| 200 | |
| 201 | /** |
Mady Mellor | cd9b130 | 2018-11-06 18:08:04 -0800 | [diff] [blame] | 202 | * Set a listener to be notified of bubble expand events. |
| 203 | */ |
| 204 | public void setExpandListener(BubbleExpandListener listener) { |
Issei Suzuki | ac9fcb7 | 2019-02-04 17:45:57 +0100 | [diff] [blame] | 205 | mExpandListener = ((isExpanding, key) -> { |
| 206 | if (listener != null) { |
| 207 | listener.onBubbleExpandChanged(isExpanding, key); |
| 208 | } |
| 209 | mStatusBarWindowController.setBubbleExpanded(isExpanding); |
| 210 | }); |
Mady Mellor | cd9b130 | 2018-11-06 18:08:04 -0800 | [diff] [blame] | 211 | if (mStackView != null) { |
| 212 | mStackView.setExpandListener(mExpandListener); |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | /** |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 217 | * Whether or not there are bubbles present, regardless of them being visible on the |
| 218 | * screen (e.g. if on AOD). |
| 219 | */ |
| 220 | public boolean hasBubbles() { |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 221 | if (mStackView == null) { |
| 222 | return false; |
| 223 | } |
| 224 | for (Bubble bubble : mBubbleData.getBubbles()) { |
| 225 | if (!bubble.entry.isBubbleDismissed()) { |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 226 | return true; |
| 227 | } |
| 228 | } |
| 229 | return false; |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 230 | } |
| 231 | |
| 232 | /** |
| 233 | * Whether the stack of bubbles is expanded or not. |
| 234 | */ |
| 235 | public boolean isStackExpanded() { |
| 236 | return mStackView != null && mStackView.isExpanded(); |
| 237 | } |
| 238 | |
| 239 | /** |
| 240 | * Tell the stack of bubbles to collapse. |
| 241 | */ |
| 242 | public void collapseStack() { |
| 243 | if (mStackView != null) { |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 244 | mStackView.collapseStack(); |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 245 | } |
| 246 | } |
| 247 | |
| 248 | /** |
| 249 | * Tell the stack of bubbles to be dismissed, this will remove all of the bubbles in the stack. |
| 250 | */ |
Ned Burns | 01e3821 | 2019-01-03 16:32:52 -0500 | [diff] [blame] | 251 | void dismissStack() { |
Mady Mellor | d1c78b26 | 2018-11-06 18:04:40 -0800 | [diff] [blame] | 252 | if (mStackView == null) { |
| 253 | return; |
| 254 | } |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 255 | mStackView.stackDismissed(); |
| 256 | |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 257 | updateVisibility(); |
Ned Burns | 01e3821 | 2019-01-03 16:32:52 -0500 | [diff] [blame] | 258 | mNotificationEntryManager.updateNotifications(); |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 259 | } |
| 260 | |
| 261 | /** |
Mark Renouf | 041d726 | 2019-02-06 12:09:41 -0500 | [diff] [blame] | 262 | * Directs a back gesture at the bubble stack. When opened, the current expanded bubble |
| 263 | * is forwarded a back key down/up pair. |
| 264 | */ |
| 265 | public void performBackPressIfNeeded() { |
| 266 | if (mStackView != null) { |
| 267 | mStackView.performBackPressIfNeeded(); |
| 268 | } |
| 269 | } |
| 270 | |
| 271 | /** |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 272 | * Adds or updates a bubble associated with the provided notification entry. |
| 273 | * |
| 274 | * @param notif the notification associated with this bubble. |
| 275 | * @param updatePosition whether this update should promote the bubble to the top of the stack. |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 276 | */ |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 277 | public void updateBubble(NotificationEntry notif, boolean updatePosition) { |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 278 | if (mStackView != null && mBubbleData.getBubble(notif.key) != null) { |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 279 | // It's an update |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 280 | mStackView.updateBubble(notif, updatePosition); |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 281 | } else { |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 282 | if (mStackView == null) { |
Mady Mellor | cfd06c1 | 2019-02-13 14:32:12 -0800 | [diff] [blame] | 283 | mStackView = new BubbleStackView(mContext, mBubbleData); |
Mady Mellor | d1c78b26 | 2018-11-06 18:04:40 -0800 | [diff] [blame] | 284 | ViewGroup sbv = mStatusBarWindowController.getStatusBarView(); |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 285 | // XXX: Bug when you expand the shade on top of expanded bubble, there is no scrim |
| 286 | // between bubble and the shade |
| 287 | int bubblePosition = sbv.indexOfChild(sbv.findViewById(R.id.scrim_behind)) + 1; |
| 288 | sbv.addView(mStackView, bubblePosition, |
Joshua Tsuji | b1a796b | 2019-01-16 15:43:12 -0800 | [diff] [blame] | 289 | new FrameLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT)); |
Mady Mellor | cd9b130 | 2018-11-06 18:08:04 -0800 | [diff] [blame] | 290 | if (mExpandListener != null) { |
| 291 | mStackView.setExpandListener(mExpandListener); |
| 292 | } |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 293 | mStackView.setOnBlockedListener(this); |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 294 | } |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 295 | // It's new |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 296 | mStackView.addBubble(notif); |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 297 | } |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 298 | updateVisibility(); |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 299 | } |
| 300 | |
| 301 | /** |
| 302 | * Removes the bubble associated with the {@param uri}. |
Mark Renouf | 658c6bc | 2019-01-30 10:26:54 -0500 | [diff] [blame] | 303 | * <p> |
| 304 | * Must be called from the main thread. |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 305 | */ |
Mark Renouf | 658c6bc | 2019-01-30 10:26:54 -0500 | [diff] [blame] | 306 | @MainThread |
Ned Burns | 01e3821 | 2019-01-03 16:32:52 -0500 | [diff] [blame] | 307 | void removeBubble(String key) { |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 308 | if (mStackView != null) { |
| 309 | mStackView.removeBubble(key); |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 310 | } |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 311 | mNotificationEntryManager.updateNotifications(); |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 312 | updateVisibility(); |
Mady Mellor | d1c78b26 | 2018-11-06 18:04:40 -0800 | [diff] [blame] | 313 | } |
| 314 | |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 315 | @Override |
| 316 | public void onBubbleBlocked(NotificationEntry entry) { |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 317 | Object[] bubbles = mBubbleData.getBubbles().toArray(); |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 318 | for (int i = 0; i < bubbles.length; i++) { |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 319 | NotificationEntry e = ((Bubble) bubbles[i]).entry; |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 320 | boolean samePackage = entry.notification.getPackageName().equals( |
| 321 | e.notification.getPackageName()); |
| 322 | if (samePackage) { |
| 323 | removeBubble(entry.key); |
| 324 | } |
| 325 | } |
| 326 | } |
| 327 | |
Ned Burns | 01e3821 | 2019-01-03 16:32:52 -0500 | [diff] [blame] | 328 | @SuppressWarnings("FieldCanBeLocal") |
| 329 | private final NotificationEntryListener mEntryListener = new NotificationEntryListener() { |
| 330 | @Override |
Ned Burns | f81c4c4 | 2019-01-07 14:10:43 -0500 | [diff] [blame] | 331 | public void onPendingEntryAdded(NotificationEntry entry) { |
Mady Mellor | f6e3ac0 | 2019-01-29 10:37:52 -0800 | [diff] [blame] | 332 | if (!areBubblesEnabled(mContext)) { |
| 333 | return; |
| 334 | } |
| 335 | if (shouldAutoBubbleForFlags(mContext, entry) || shouldBubble(entry)) { |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 336 | // TODO: handle group summaries |
| 337 | // It's a new notif, it shows in the shade and as a bubble |
Ned Burns | 01e3821 | 2019-01-03 16:32:52 -0500 | [diff] [blame] | 338 | entry.setIsBubble(true); |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 339 | entry.setShowInShadeWhenBubble(true); |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | @Override |
Ned Burns | 1a5e22f | 2019-02-14 15:11:52 -0500 | [diff] [blame] | 344 | public void onEntryInflated(NotificationEntry entry, @InflationFlag int inflatedFlags) { |
Mady Mellor | f6e3ac0 | 2019-01-29 10:37:52 -0800 | [diff] [blame] | 345 | if (!areBubblesEnabled(mContext)) { |
| 346 | return; |
| 347 | } |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 348 | if (entry.isBubble() && mNotificationInterruptionStateProvider.shouldBubbleUp(entry)) { |
| 349 | updateBubble(entry, true /* updatePosition */); |
| 350 | } |
| 351 | } |
| 352 | |
| 353 | @Override |
| 354 | public void onPreEntryUpdated(NotificationEntry entry) { |
Mady Mellor | f6e3ac0 | 2019-01-29 10:37:52 -0800 | [diff] [blame] | 355 | if (!areBubblesEnabled(mContext)) { |
| 356 | return; |
| 357 | } |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 358 | if (mNotificationInterruptionStateProvider.shouldBubbleUp(entry) |
| 359 | && alertAgain(entry, entry.notification.getNotification())) { |
| 360 | entry.setShowInShadeWhenBubble(true); |
| 361 | entry.setBubbleDismissed(false); // updates come back as bubbles even if dismissed |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 362 | updateBubble(entry, true /* updatePosition */); |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 363 | mStackView.updateDotVisibility(entry.key); |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 364 | } |
| 365 | } |
| 366 | |
| 367 | @Override |
| 368 | public void onEntryRemoved(NotificationEntry entry, |
| 369 | @Nullable NotificationVisibility visibility, |
| 370 | boolean removedByUser) { |
Mady Mellor | f6e3ac0 | 2019-01-29 10:37:52 -0800 | [diff] [blame] | 371 | if (!areBubblesEnabled(mContext)) { |
| 372 | return; |
| 373 | } |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 374 | entry.setShowInShadeWhenBubble(false); |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 375 | if (mStackView != null) { |
| 376 | mStackView.updateDotVisibility(entry.key); |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 377 | } |
| 378 | if (!removedByUser) { |
| 379 | // This was a cancel so we should remove the bubble |
| 380 | removeBubble(entry.key); |
Ned Burns | 01e3821 | 2019-01-03 16:32:52 -0500 | [diff] [blame] | 381 | } |
| 382 | } |
| 383 | }; |
| 384 | |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 385 | /** |
| 386 | * Lets any listeners know if bubble state has changed. |
| 387 | */ |
Mady Mellor | d1c78b26 | 2018-11-06 18:04:40 -0800 | [diff] [blame] | 388 | private void updateBubblesShowing() { |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 389 | if (mStackView == null) { |
| 390 | return; |
Mady Mellor | d1c78b26 | 2018-11-06 18:04:40 -0800 | [diff] [blame] | 391 | } |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 392 | |
Mady Mellor | d1c78b26 | 2018-11-06 18:04:40 -0800 | [diff] [blame] | 393 | boolean hadBubbles = mStatusBarWindowController.getBubblesShowing(); |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 394 | boolean hasBubblesShowing = hasBubbles() && mStackView.getVisibility() == VISIBLE; |
Mady Mellor | d1c78b26 | 2018-11-06 18:04:40 -0800 | [diff] [blame] | 395 | mStatusBarWindowController.setBubblesShowing(hasBubblesShowing); |
Mady Mellor | d1c78b26 | 2018-11-06 18:04:40 -0800 | [diff] [blame] | 396 | if (mStateChangeListener != null && hadBubbles != hasBubblesShowing) { |
| 397 | mStateChangeListener.onHasBubblesChanged(hasBubblesShowing); |
| 398 | } |
Mady Mellor | 5549dd2 | 2018-11-06 18:07:34 -0800 | [diff] [blame] | 399 | } |
| 400 | |
| 401 | /** |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 402 | * Updates the visibility of the bubbles based on current state. |
| 403 | * Does not un-bubble, just hides or un-hides. Will notify any |
| 404 | * {@link BubbleStateChangeListener}s if visibility changes. |
Mady Mellor | 5549dd2 | 2018-11-06 18:07:34 -0800 | [diff] [blame] | 405 | */ |
Mady Mellor | 3f2efdb | 2018-11-21 11:30:45 -0800 | [diff] [blame] | 406 | public void updateVisibility() { |
| 407 | if (mStatusBarStateListener.getCurrentState() == SHADE && hasBubbles()) { |
| 408 | // Bubbles only appear in unlocked shade |
| 409 | mStackView.setVisibility(hasBubbles() ? VISIBLE : INVISIBLE); |
| 410 | } else if (mStackView != null) { |
| 411 | mStackView.setVisibility(INVISIBLE); |
| 412 | collapseStack(); |
Mady Mellor | 5549dd2 | 2018-11-06 18:07:34 -0800 | [diff] [blame] | 413 | } |
Mady Mellor | d1c78b26 | 2018-11-06 18:04:40 -0800 | [diff] [blame] | 414 | updateBubblesShowing(); |
| 415 | } |
| 416 | |
| 417 | /** |
| 418 | * Rect indicating the touchable region for the bubble stack / expanded stack. |
| 419 | */ |
| 420 | public Rect getTouchableRegion() { |
| 421 | if (mStackView == null || mStackView.getVisibility() != VISIBLE) { |
| 422 | return null; |
| 423 | } |
| 424 | mStackView.getBoundsOnScreen(mTempRect); |
| 425 | return mTempRect; |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 426 | } |
| 427 | |
Mady Mellor | f6e3ac0 | 2019-01-29 10:37:52 -0800 | [diff] [blame] | 428 | @VisibleForTesting |
| 429 | BubbleStackView getStackView() { |
| 430 | return mStackView; |
| 431 | } |
| 432 | |
Mady Mellor | 5549dd2 | 2018-11-06 18:07:34 -0800 | [diff] [blame] | 433 | /** |
Mady Mellor | b4991e6 | 2019-01-10 15:14:51 -0800 | [diff] [blame] | 434 | * Whether the notification has been developer configured to bubble and is allowed by the user. |
| 435 | */ |
Mady Mellor | c18ba96 | 2019-01-29 11:11:56 -0800 | [diff] [blame] | 436 | @VisibleForTesting |
| 437 | protected boolean shouldBubble(NotificationEntry entry) { |
Mady Mellor | b4991e6 | 2019-01-10 15:14:51 -0800 | [diff] [blame] | 438 | StatusBarNotification n = entry.notification; |
Mady Mellor | c39b4ae | 2019-01-09 17:11:37 -0800 | [diff] [blame] | 439 | boolean hasOverlayIntent = n.getNotification().getBubbleMetadata() != null |
| 440 | && n.getNotification().getBubbleMetadata().getIntent() != null; |
Julia Reynolds | 4509ce7 | 2019-01-31 13:12:43 -0500 | [diff] [blame] | 441 | return hasOverlayIntent && entry.canBubble; |
Mady Mellor | b4991e6 | 2019-01-10 15:14:51 -0800 | [diff] [blame] | 442 | } |
| 443 | |
| 444 | /** |
Mady Mellor | f6e3ac0 | 2019-01-29 10:37:52 -0800 | [diff] [blame] | 445 | * Whether the notification should automatically bubble or not. Gated by secure settings flags. |
Mady Mellor | 5549dd2 | 2018-11-06 18:07:34 -0800 | [diff] [blame] | 446 | */ |
Mady Mellor | 9bad224 | 2019-01-28 11:21:51 -0800 | [diff] [blame] | 447 | @VisibleForTesting |
Mady Mellor | f6e3ac0 | 2019-01-29 10:37:52 -0800 | [diff] [blame] | 448 | protected boolean shouldAutoBubbleForFlags(Context context, NotificationEntry entry) { |
Mady Mellor | ceced17 | 2018-11-27 11:18:39 -0800 | [diff] [blame] | 449 | if (entry.isBubbleDismissed()) { |
Mady Mellor | 5549dd2 | 2018-11-06 18:07:34 -0800 | [diff] [blame] | 450 | return false; |
| 451 | } |
Mady Mellor | b4991e6 | 2019-01-10 15:14:51 -0800 | [diff] [blame] | 452 | StatusBarNotification n = entry.notification; |
Mady Mellor | ceced17 | 2018-11-27 11:18:39 -0800 | [diff] [blame] | 453 | |
| 454 | boolean autoBubbleMessages = shouldAutoBubbleMessages(context) || DEBUG_ENABLE_AUTO_BUBBLE; |
| 455 | boolean autoBubbleOngoing = shouldAutoBubbleOngoing(context) || DEBUG_ENABLE_AUTO_BUBBLE; |
| 456 | boolean autoBubbleAll = shouldAutoBubbleAll(context) || DEBUG_ENABLE_AUTO_BUBBLE; |
| 457 | |
Mady Mellor | 5549dd2 | 2018-11-06 18:07:34 -0800 | [diff] [blame] | 458 | boolean hasRemoteInput = false; |
| 459 | if (n.getNotification().actions != null) { |
| 460 | for (Notification.Action action : n.getNotification().actions) { |
| 461 | if (action.getRemoteInputs() != null) { |
| 462 | hasRemoteInput = true; |
| 463 | break; |
| 464 | } |
| 465 | } |
| 466 | } |
Mady Mellor | 711f956 | 2018-12-05 14:53:46 -0800 | [diff] [blame] | 467 | boolean isCall = Notification.CATEGORY_CALL.equals(n.getNotification().category) |
| 468 | && n.isOngoing(); |
| 469 | boolean isMusic = n.getNotification().hasMediaSession(); |
| 470 | boolean isImportantOngoing = isMusic || isCall; |
Mady Mellor | ceced17 | 2018-11-27 11:18:39 -0800 | [diff] [blame] | 471 | |
Mady Mellor | 5549dd2 | 2018-11-06 18:07:34 -0800 | [diff] [blame] | 472 | Class<? extends Notification.Style> style = n.getNotification().getNotificationStyle(); |
Mady Mellor | e317537 | 2018-12-04 17:05:11 -0800 | [diff] [blame] | 473 | boolean isMessageType = Notification.CATEGORY_MESSAGE.equals(n.getNotification().category); |
| 474 | boolean isMessageStyle = Notification.MessagingStyle.class.equals(style); |
Mady Mellor | f6e3ac0 | 2019-01-29 10:37:52 -0800 | [diff] [blame] | 475 | return (((isMessageType && hasRemoteInput) || isMessageStyle) && autoBubbleMessages) |
Mady Mellor | 711f956 | 2018-12-05 14:53:46 -0800 | [diff] [blame] | 476 | || (isImportantOngoing && autoBubbleOngoing) |
Mady Mellor | ceced17 | 2018-11-27 11:18:39 -0800 | [diff] [blame] | 477 | || autoBubbleAll; |
| 478 | } |
| 479 | |
Mark Renouf | cecc77b | 2019-01-30 16:32:24 -0500 | [diff] [blame] | 480 | /** |
| 481 | * This task stack listener is responsible for responding to tasks moved to the front |
| 482 | * which are on the default (main) display. When this happens, expanded bubbles must be |
| 483 | * collapsed so the user may interact with the app which was just moved to the front. |
| 484 | * <p> |
| 485 | * This listener is registered with SystemUI's ActivityManagerWrapper which dispatches |
| 486 | * these calls via a main thread Handler. |
| 487 | */ |
| 488 | @MainThread |
| 489 | private class BubbleTaskStackListener extends TaskStackChangeListener { |
| 490 | |
Mark Renouf | cecc77b | 2019-01-30 16:32:24 -0500 | [diff] [blame] | 491 | @Override |
Mark Renouf | c808f06 | 2019-02-07 15:20:37 -0500 | [diff] [blame] | 492 | public void onTaskMovedToFront(RunningTaskInfo taskInfo) { |
| 493 | if (mStackView != null && taskInfo.displayId == Display.DEFAULT_DISPLAY) { |
Mark Renouf | cecc77b | 2019-01-30 16:32:24 -0500 | [diff] [blame] | 494 | mStackView.collapseStack(); |
| 495 | } |
| 496 | } |
| 497 | |
Mark Renouf | cecc77b | 2019-01-30 16:32:24 -0500 | [diff] [blame] | 498 | @Override |
Mark Renouf | a12e876 | 2019-03-07 15:43:01 -0500 | [diff] [blame] | 499 | public void onActivityLaunchOnSecondaryDisplayRerouted() { |
Mark Renouf | cecc77b | 2019-01-30 16:32:24 -0500 | [diff] [blame] | 500 | if (mStackView != null) { |
| 501 | mStackView.collapseStack(); |
| 502 | } |
| 503 | } |
| 504 | } |
| 505 | |
Mady Mellor | ceced17 | 2018-11-27 11:18:39 -0800 | [diff] [blame] | 506 | private static boolean shouldAutoBubbleMessages(Context context) { |
| 507 | return Settings.Secure.getInt(context.getContentResolver(), |
| 508 | ENABLE_AUTO_BUBBLE_MESSAGES, 0) != 0; |
| 509 | } |
| 510 | |
| 511 | private static boolean shouldAutoBubbleOngoing(Context context) { |
| 512 | return Settings.Secure.getInt(context.getContentResolver(), |
| 513 | ENABLE_AUTO_BUBBLE_ONGOING, 0) != 0; |
| 514 | } |
| 515 | |
| 516 | private static boolean shouldAutoBubbleAll(Context context) { |
| 517 | return Settings.Secure.getInt(context.getContentResolver(), |
| 518 | ENABLE_AUTO_BUBBLE_ALL, 0) != 0; |
Mady Mellor | 5549dd2 | 2018-11-06 18:07:34 -0800 | [diff] [blame] | 519 | } |
Mark Renouf | 89b1a4a | 2018-12-04 14:59:45 -0500 | [diff] [blame] | 520 | |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 521 | static boolean shouldUseContentIntent(Context context) { |
Mark Renouf | 89b1a4a | 2018-12-04 14:59:45 -0500 | [diff] [blame] | 522 | return Settings.Secure.getInt(context.getContentResolver(), |
| 523 | ENABLE_BUBBLE_CONTENT_INTENT, 0) != 0; |
| 524 | } |
Mady Mellor | f6e3ac0 | 2019-01-29 10:37:52 -0800 | [diff] [blame] | 525 | |
| 526 | private static boolean areBubblesEnabled(Context context) { |
| 527 | return Settings.Secure.getInt(context.getContentResolver(), |
| 528 | ENABLE_BUBBLES, 1) != 0; |
| 529 | } |
Joshua Tsuji | a19515f | 2019-02-13 18:02:29 -0500 | [diff] [blame] | 530 | |
Mady Mellor | 44ee2fe | 2019-01-30 17:51:16 -0800 | [diff] [blame] | 531 | /** |
| 532 | * Whether bubbles should be positioned at the top of the screen or not. |
| 533 | */ |
| 534 | public static boolean showBubblesAtTop(Context context) { |
| 535 | return Settings.Secure.getInt(context.getContentResolver(), |
| 536 | ENABLE_BUBBLES_AT_TOP, 0) != 0; |
| 537 | } |
| 538 | |
| 539 | /** |
| 540 | * Whether the bubble chrome should display as a footer or not (in which case it's a header). |
| 541 | */ |
| 542 | public static boolean useFooter(Context context) { |
| 543 | return Settings.Secure.getInt(context.getContentResolver(), |
| 544 | ENABLE_BUBBLE_FOOTER, 0) != 0; |
| 545 | } |
| 546 | |
Joshua Tsuji | 010c2b1 | 2019-02-25 18:11:25 -0500 | [diff] [blame] | 547 | /** Default stiffness to use for bubble physics animations. */ |
| 548 | public static int getBubbleStiffness(Context context, int defaultStiffness) { |
| 549 | return Settings.Secure.getInt( |
| 550 | context.getContentResolver(), BUBBLE_STIFFNESS, defaultStiffness); |
| 551 | } |
| 552 | |
| 553 | /** Default bounciness/damping ratio to use for bubble physics animations. */ |
| 554 | public static float getBubbleBounciness(Context context, float defaultBounciness) { |
| 555 | return Settings.Secure.getInt( |
| 556 | context.getContentResolver(), |
| 557 | BUBBLE_BOUNCINESS, |
| 558 | (int) (defaultBounciness * 100)) / 100f; |
| 559 | } |
| 560 | |
Joshua Tsuji | a19515f | 2019-02-13 18:02:29 -0500 | [diff] [blame] | 561 | /** PinnedStackListener that dispatches IME visibility updates to the stack. */ |
| 562 | private class BubblesImeListener extends IPinnedStackListener.Stub { |
| 563 | |
| 564 | @Override |
| 565 | public void onListenerRegistered(IPinnedStackController controller) throws RemoteException { |
| 566 | } |
| 567 | |
| 568 | @Override |
| 569 | public void onMovementBoundsChanged(Rect insetBounds, Rect normalBounds, |
| 570 | Rect animatingBounds, boolean fromImeAdjustment, boolean fromShelfAdjustment, |
| 571 | int displayRotation) throws RemoteException {} |
| 572 | |
| 573 | @Override |
Joshua Tsuji | d942283 | 2019-03-05 13:32:37 -0500 | [diff] [blame] | 574 | public void onImeVisibilityChanged(boolean imeVisible, int imeHeight) { |
| 575 | if (mStackView != null && mStackView.getBubbleCount() > 0) { |
| 576 | mStackView.post(() -> mStackView.onImeVisibilityChanged(imeVisible, imeHeight)); |
Joshua Tsuji | a19515f | 2019-02-13 18:02:29 -0500 | [diff] [blame] | 577 | } |
| 578 | } |
| 579 | |
| 580 | @Override |
| 581 | public void onShelfVisibilityChanged(boolean shelfVisible, int shelfHeight) |
| 582 | throws RemoteException {} |
| 583 | |
| 584 | @Override |
| 585 | public void onMinimizedStateChanged(boolean isMinimized) throws RemoteException {} |
| 586 | |
| 587 | @Override |
| 588 | public void onActionsChanged(ParceledListSlice actions) throws RemoteException {} |
| 589 | } |
Mady Mellor | c3d6f7d | 2018-11-07 09:36:56 -0800 | [diff] [blame] | 590 | } |