Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -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 | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 19 | import static android.content.pm.ActivityInfo.DOCUMENT_LAUNCH_ALWAYS; |
| 20 | import static android.util.StatsLogInternal.BUBBLE_DEVELOPER_ERROR_REPORTED__ERROR__ACTIVITY_INFO_MISSING; |
| 21 | import static android.util.StatsLogInternal.BUBBLE_DEVELOPER_ERROR_REPORTED__ERROR__ACTIVITY_INFO_NOT_RESIZABLE; |
| 22 | import static android.util.StatsLogInternal.BUBBLE_DEVELOPER_ERROR_REPORTED__ERROR__DOCUMENT_LAUNCH_NOT_ALWAYS; |
| 23 | |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 24 | import android.animation.LayoutTransition; |
| 25 | import android.animation.ObjectAnimator; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 26 | import android.annotation.Nullable; |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 27 | import android.app.ActivityView; |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 28 | import android.app.INotificationManager; |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 29 | import android.app.Notification; |
| 30 | import android.app.PendingIntent; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 31 | import android.content.Context; |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 32 | import android.content.Intent; |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 33 | import android.content.pm.ActivityInfo; |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 34 | import android.content.pm.ApplicationInfo; |
| 35 | import android.content.pm.PackageManager; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 36 | import android.content.res.Resources; |
Mady Mellor | dd49705 | 2019-01-30 17:23:48 -0800 | [diff] [blame] | 37 | import android.content.res.TypedArray; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 38 | import android.graphics.Color; |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 39 | import android.graphics.Insets; |
| 40 | import android.graphics.Point; |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 41 | import android.graphics.drawable.Drawable; |
Mady Mellor | 310c7c6 | 2019-02-21 17:03:08 -0800 | [diff] [blame^] | 42 | import android.graphics.drawable.GradientDrawable; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 43 | import android.graphics.drawable.ShapeDrawable; |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 44 | import android.os.RemoteException; |
| 45 | import android.os.ServiceManager; |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 46 | import android.provider.Settings; |
Steven Wu | b00225b | 2019-02-08 14:27:42 -0500 | [diff] [blame] | 47 | import android.service.notification.StatusBarNotification; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 48 | import android.util.AttributeSet; |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 49 | import android.util.Log; |
Steven Wu | b00225b | 2019-02-08 14:27:42 -0500 | [diff] [blame] | 50 | import android.util.StatsLog; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 51 | import android.view.View; |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 52 | import android.view.ViewGroup; |
| 53 | import android.view.WindowInsets; |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 54 | import android.widget.FrameLayout; |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 55 | import android.widget.ImageButton; |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 56 | import android.widget.ImageView; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 57 | import android.widget.LinearLayout; |
Mark Renouf | 89b1a4a | 2018-12-04 14:59:45 -0500 | [diff] [blame] | 58 | import android.widget.TextView; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 59 | |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 60 | import com.android.systemui.Dependency; |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 61 | import com.android.systemui.Interpolators; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 62 | import com.android.systemui.R; |
| 63 | import com.android.systemui.recents.TriangleShape; |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 64 | import com.android.systemui.statusbar.notification.collection.NotificationEntry; |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 65 | import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; |
| 66 | import com.android.systemui.statusbar.notification.stack.ExpandableViewState; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 67 | |
| 68 | /** |
| 69 | * Container for the expanded bubble view, handles rendering the caret and header of the view. |
| 70 | */ |
Mady Mellor | 3d82e68 | 2019-02-05 13:34:48 -0800 | [diff] [blame] | 71 | public class BubbleExpandedView extends LinearLayout implements View.OnClickListener { |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 72 | private static final String TAG = "BubbleExpandedView"; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 73 | |
Mady Mellor | 44ee2fe | 2019-01-30 17:51:16 -0800 | [diff] [blame] | 74 | // Configurable via bubble settings; just for testing |
| 75 | private boolean mUseFooter; |
| 76 | private boolean mShowOnTop; |
| 77 | |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 78 | // The triangle pointing to the expanded view |
| 79 | private View mPointerView; |
Mady Mellor | 44ee2fe | 2019-01-30 17:51:16 -0800 | [diff] [blame] | 80 | private int mPointerMargin; |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 81 | |
| 82 | // Header |
| 83 | private View mHeaderView; |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 84 | private ImageButton mDeepLinkIcon; |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 85 | private ImageButton mSettingsIcon; |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 86 | |
| 87 | // Permission view |
| 88 | private View mPermissionView; |
| 89 | |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 90 | // Views for expanded state |
| 91 | private ExpandableNotificationRow mNotifRow; |
| 92 | private ActivityView mActivityView; |
| 93 | |
| 94 | private boolean mActivityViewReady = false; |
| 95 | private PendingIntent mBubbleIntent; |
| 96 | |
Mady Mellor | fe7ec03 | 2019-01-30 17:32:49 -0800 | [diff] [blame] | 97 | private int mMinHeight; |
| 98 | private int mHeaderHeight; |
Mady Mellor | 44ee2fe | 2019-01-30 17:51:16 -0800 | [diff] [blame] | 99 | private int mBubbleHeight; |
| 100 | private int mPermissionHeight; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 101 | |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 102 | private NotificationEntry mEntry; |
| 103 | private PackageManager mPm; |
| 104 | private String mAppName; |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 105 | private Drawable mAppIcon; |
| 106 | |
| 107 | private INotificationManager mNotificationManagerService; |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 108 | private BubbleController mBubbleController = Dependency.get(BubbleController.class); |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 109 | |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 110 | private BubbleStackView mStackView; |
| 111 | |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 112 | private BubbleExpandedView.OnBubbleBlockedListener mOnBubbleBlockedListener; |
| 113 | |
| 114 | private ActivityView.StateCallback mStateCallback = new ActivityView.StateCallback() { |
| 115 | @Override |
| 116 | public void onActivityViewReady(ActivityView view) { |
Mady Mellor | 6d00203 | 2019-02-13 13:45:17 -0800 | [diff] [blame] | 117 | if (!mActivityViewReady) { |
| 118 | mActivityViewReady = true; |
| 119 | mActivityView.startActivity(mBubbleIntent); |
| 120 | } |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 121 | } |
| 122 | |
| 123 | @Override |
| 124 | public void onActivityViewDestroyed(ActivityView view) { |
| 125 | mActivityViewReady = false; |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * This is only called for tasks on this ActivityView, which is also set to |
| 130 | * single-task mode -- meaning never more than one task on this display. If a task |
| 131 | * is being removed, it's the top Activity finishing and this bubble should |
| 132 | * be removed or collapsed. |
| 133 | */ |
| 134 | @Override |
| 135 | public void onTaskRemovalStarted(int taskId) { |
| 136 | if (mEntry != null) { |
| 137 | // Must post because this is called from a binder thread. |
| 138 | post(() -> mBubbleController.removeBubble(mEntry.key)); |
| 139 | } |
| 140 | } |
| 141 | }; |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 142 | |
Mady Mellor | 3d82e68 | 2019-02-05 13:34:48 -0800 | [diff] [blame] | 143 | public BubbleExpandedView(Context context) { |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 144 | this(context, null); |
| 145 | } |
| 146 | |
Mady Mellor | 3d82e68 | 2019-02-05 13:34:48 -0800 | [diff] [blame] | 147 | public BubbleExpandedView(Context context, AttributeSet attrs) { |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 148 | this(context, attrs, 0); |
| 149 | } |
| 150 | |
Mady Mellor | 3d82e68 | 2019-02-05 13:34:48 -0800 | [diff] [blame] | 151 | public BubbleExpandedView(Context context, AttributeSet attrs, int defStyleAttr) { |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 152 | this(context, attrs, defStyleAttr, 0); |
| 153 | } |
| 154 | |
Mady Mellor | 3d82e68 | 2019-02-05 13:34:48 -0800 | [diff] [blame] | 155 | public BubbleExpandedView(Context context, AttributeSet attrs, int defStyleAttr, |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 156 | int defStyleRes) { |
| 157 | super(context, attrs, defStyleAttr, defStyleRes); |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 158 | mPm = context.getPackageManager(); |
Mady Mellor | fe7ec03 | 2019-01-30 17:32:49 -0800 | [diff] [blame] | 159 | mMinHeight = getResources().getDimensionPixelSize( |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 160 | R.dimen.bubble_expanded_default_height); |
Mady Mellor | 44ee2fe | 2019-01-30 17:51:16 -0800 | [diff] [blame] | 161 | mPointerMargin = getResources().getDimensionPixelSize(R.dimen.bubble_pointer_margin); |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 162 | try { |
| 163 | mNotificationManagerService = INotificationManager.Stub.asInterface( |
| 164 | ServiceManager.getServiceOrThrow(Context.NOTIFICATION_SERVICE)); |
| 165 | } catch (ServiceManager.ServiceNotFoundException e) { |
| 166 | Log.w(TAG, e); |
| 167 | } |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 168 | } |
| 169 | |
| 170 | @Override |
| 171 | protected void onFinishInflate() { |
| 172 | super.onFinishInflate(); |
| 173 | |
| 174 | Resources res = getResources(); |
| 175 | mPointerView = findViewById(R.id.pointer_view); |
| 176 | int width = res.getDimensionPixelSize(R.dimen.bubble_pointer_width); |
| 177 | int height = res.getDimensionPixelSize(R.dimen.bubble_pointer_height); |
Mady Mellor | dd49705 | 2019-01-30 17:23:48 -0800 | [diff] [blame] | 178 | |
| 179 | TypedArray ta = getContext().obtainStyledAttributes( |
| 180 | new int[] {android.R.attr.colorBackgroundFloating}); |
| 181 | int bgColor = ta.getColor(0, Color.WHITE); |
| 182 | ta.recycle(); |
| 183 | |
Mady Mellor | 44ee2fe | 2019-01-30 17:51:16 -0800 | [diff] [blame] | 184 | mShowOnTop = BubbleController.showBubblesAtTop(getContext()); |
| 185 | mUseFooter = BubbleController.useFooter(getContext()); |
| 186 | |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 187 | ShapeDrawable triangleDrawable = new ShapeDrawable( |
Mady Mellor | 44ee2fe | 2019-01-30 17:51:16 -0800 | [diff] [blame] | 188 | TriangleShape.create(width, height, mShowOnTop /* pointUp */)); |
Mady Mellor | dd49705 | 2019-01-30 17:23:48 -0800 | [diff] [blame] | 189 | triangleDrawable.setTint(bgColor); |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 190 | mPointerView.setBackground(triangleDrawable); |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 191 | |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 192 | FrameLayout viewWrapper = findViewById(R.id.header_permission_wrapper); |
Mady Mellor | 310c7c6 | 2019-02-21 17:03:08 -0800 | [diff] [blame^] | 193 | viewWrapper.setBackground(createHeaderPermissionBackground(bgColor)); |
| 194 | |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 195 | LayoutTransition transition = new LayoutTransition(); |
| 196 | transition.setDuration(200); |
| 197 | |
| 198 | ObjectAnimator appearAnimator = ObjectAnimator.ofFloat(null, View.ALPHA, 0f, 1f); |
| 199 | transition.setAnimator(LayoutTransition.APPEARING, appearAnimator); |
| 200 | transition.setInterpolator(LayoutTransition.APPEARING, Interpolators.ALPHA_IN); |
| 201 | |
| 202 | ObjectAnimator disappearAnimator = ObjectAnimator.ofFloat(null, View.ALPHA, 1f, 0f); |
| 203 | transition.setAnimator(LayoutTransition.DISAPPEARING, disappearAnimator); |
| 204 | transition.setInterpolator(LayoutTransition.DISAPPEARING, Interpolators.ALPHA_OUT); |
| 205 | |
| 206 | transition.setAnimateParentHierarchy(false); |
| 207 | viewWrapper.setLayoutTransition(transition); |
| 208 | viewWrapper.getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING); |
| 209 | |
Mady Mellor | 310c7c6 | 2019-02-21 17:03:08 -0800 | [diff] [blame^] | 210 | |
Mady Mellor | fe7ec03 | 2019-01-30 17:32:49 -0800 | [diff] [blame] | 211 | mHeaderHeight = getContext().getResources().getDimensionPixelSize( |
| 212 | R.dimen.bubble_expanded_header_height); |
Mady Mellor | 44ee2fe | 2019-01-30 17:51:16 -0800 | [diff] [blame] | 213 | mPermissionHeight = getContext().getResources().getDimensionPixelSize( |
| 214 | R.dimen.bubble_permission_height); |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 215 | mHeaderView = findViewById(R.id.header_layout); |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 216 | mDeepLinkIcon = findViewById(R.id.deep_link_button); |
| 217 | mSettingsIcon = findViewById(R.id.settings_button); |
| 218 | mDeepLinkIcon.setOnClickListener(this); |
| 219 | mSettingsIcon.setOnClickListener(this); |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 220 | |
| 221 | mPermissionView = findViewById(R.id.permission_layout); |
| 222 | findViewById(R.id.no_bubbles_button).setOnClickListener(this); |
| 223 | findViewById(R.id.yes_bubbles_button).setOnClickListener(this); |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 224 | |
| 225 | mActivityView = new ActivityView(mContext, null /* attrs */, 0 /* defStyle */, |
| 226 | true /* singleTaskInstance */); |
| 227 | addView(mActivityView); |
| 228 | |
| 229 | mActivityView.setOnApplyWindowInsetsListener((View view, WindowInsets insets) -> { |
| 230 | ActivityView activityView = (ActivityView) view; |
| 231 | // Here we assume that the position of the ActivityView on the screen |
| 232 | // remains regardless of IME status. When we move ActivityView, the |
| 233 | // forwardedInsets should be computed not against the current location |
| 234 | // and size, but against the post-moved location and size. |
| 235 | Point displaySize = new Point(); |
| 236 | view.getContext().getDisplay().getSize(displaySize); |
| 237 | int[] windowLocation = view.getLocationOnScreen(); |
| 238 | final int windowBottom = windowLocation[1] + view.getHeight(); |
| 239 | final int keyboardHeight = insets.getSystemWindowInsetBottom() |
| 240 | - insets.getStableInsetBottom(); |
| 241 | final int insetsBottom = Math.max(0, |
| 242 | windowBottom + keyboardHeight - displaySize.y); |
| 243 | activityView.setForwardedInsets(Insets.of(0, 0, 0, insetsBottom)); |
| 244 | return view.onApplyWindowInsets(insets); |
| 245 | }); |
Mady Mellor | 44ee2fe | 2019-01-30 17:51:16 -0800 | [diff] [blame] | 246 | |
| 247 | if (!mShowOnTop) { |
| 248 | removeView(mPointerView); |
| 249 | if (mUseFooter) { |
Mady Mellor | 310c7c6 | 2019-02-21 17:03:08 -0800 | [diff] [blame^] | 250 | View divider = findViewById(R.id.divider); |
| 251 | viewWrapper.removeView(divider); |
Mady Mellor | 44ee2fe | 2019-01-30 17:51:16 -0800 | [diff] [blame] | 252 | removeView(viewWrapper); |
Mady Mellor | 310c7c6 | 2019-02-21 17:03:08 -0800 | [diff] [blame^] | 253 | addView(divider); |
Mady Mellor | 44ee2fe | 2019-01-30 17:51:16 -0800 | [diff] [blame] | 254 | addView(viewWrapper); |
| 255 | } |
| 256 | addView(mPointerView); |
| 257 | } |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 258 | } |
| 259 | |
| 260 | /** |
Mady Mellor | 310c7c6 | 2019-02-21 17:03:08 -0800 | [diff] [blame^] | 261 | * Creates a background with corners rounded based on how the view is configured to display |
| 262 | */ |
| 263 | private Drawable createHeaderPermissionBackground(int bgColor) { |
| 264 | TypedArray ta2 = getContext().obtainStyledAttributes( |
| 265 | new int[] {android.R.attr.dialogCornerRadius}); |
| 266 | final float cr = ta2.getDimension(0, 0f); |
| 267 | ta2.recycle(); |
| 268 | |
| 269 | float[] radii = mUseFooter |
| 270 | ? new float[] {0, 0, 0, 0, cr, cr, cr, cr} |
| 271 | : new float[] {cr, cr, cr, cr, 0, 0, 0, 0}; |
| 272 | GradientDrawable chromeBackground = new GradientDrawable(); |
| 273 | chromeBackground.setShape(GradientDrawable.RECTANGLE); |
| 274 | chromeBackground.setCornerRadii(radii); |
| 275 | chromeBackground.setColor(bgColor); |
| 276 | return chromeBackground; |
| 277 | } |
| 278 | |
| 279 | /** |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 280 | * Sets the listener to notify when a bubble has been blocked. |
| 281 | */ |
| 282 | public void setOnBlockedListener(OnBubbleBlockedListener listener) { |
| 283 | mOnBubbleBlockedListener = listener; |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 284 | } |
| 285 | |
| 286 | /** |
| 287 | * Sets the notification entry used to populate this view. |
| 288 | */ |
| 289 | public void setEntry(NotificationEntry entry, BubbleStackView stackView) { |
| 290 | mStackView = stackView; |
| 291 | mEntry = entry; |
| 292 | |
| 293 | ApplicationInfo info; |
| 294 | try { |
| 295 | info = mPm.getApplicationInfo( |
| 296 | entry.notification.getPackageName(), |
| 297 | PackageManager.MATCH_UNINSTALLED_PACKAGES |
| 298 | | PackageManager.MATCH_DISABLED_COMPONENTS |
| 299 | | PackageManager.MATCH_DIRECT_BOOT_UNAWARE |
| 300 | | PackageManager.MATCH_DIRECT_BOOT_AWARE); |
| 301 | if (info != null) { |
| 302 | mAppName = String.valueOf(mPm.getApplicationLabel(info)); |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 303 | mAppIcon = mPm.getApplicationIcon(info); |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 304 | } |
| 305 | } catch (PackageManager.NameNotFoundException e) { |
| 306 | // Ahh... just use package name |
| 307 | mAppName = entry.notification.getPackageName(); |
| 308 | } |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 309 | if (mAppIcon == null) { |
| 310 | mAppIcon = mPm.getDefaultActivityIcon(); |
| 311 | } |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 312 | updateHeaderView(); |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 313 | updatePermissionView(); |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 314 | updateExpandedView(); |
Mady Mellor | 6d00203 | 2019-02-13 13:45:17 -0800 | [diff] [blame] | 315 | } |
| 316 | |
| 317 | /** |
| 318 | * Lets activity view know it should be shown / populated. |
| 319 | */ |
| 320 | public void populateActivityView() { |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 321 | mActivityView.setCallback(mStateCallback); |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 322 | } |
| 323 | |
Mady Mellor | fe7ec03 | 2019-01-30 17:32:49 -0800 | [diff] [blame] | 324 | /** |
| 325 | * Updates the entry backing this view. This will not re-populate ActivityView, it will |
| 326 | * only update the deep-links in the header, the title, and the height of the view. |
| 327 | */ |
| 328 | public void update(NotificationEntry entry) { |
| 329 | if (entry.key.equals(mEntry.key)) { |
| 330 | mEntry = entry; |
| 331 | updateHeaderView(); |
| 332 | updateHeight(); |
| 333 | } else { |
| 334 | Log.w(TAG, "Trying to update entry with different key, new entry: " |
| 335 | + entry.key + " old entry: " + mEntry.key); |
| 336 | } |
| 337 | } |
| 338 | |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 339 | private void updateHeaderView() { |
| 340 | mSettingsIcon.setContentDescription(getResources().getString( |
| 341 | R.string.bubbles_settings_button_description, mAppName)); |
| 342 | mDeepLinkIcon.setContentDescription(getResources().getString( |
| 343 | R.string.bubbles_deep_link_button_description, mAppName)); |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 344 | } |
| 345 | |
| 346 | private void updatePermissionView() { |
| 347 | boolean hasUserApprovedBubblesForPackage = false; |
| 348 | try { |
| 349 | hasUserApprovedBubblesForPackage = |
| 350 | mNotificationManagerService.hasUserApprovedBubblesForPackage( |
| 351 | mEntry.notification.getPackageName(), mEntry.notification.getUid()); |
| 352 | } catch (RemoteException e) { |
| 353 | Log.w(TAG, e); |
| 354 | } |
| 355 | if (hasUserApprovedBubblesForPackage) { |
| 356 | mHeaderView.setVisibility(VISIBLE); |
| 357 | mPermissionView.setVisibility(GONE); |
| 358 | } else { |
| 359 | mHeaderView.setVisibility(GONE); |
| 360 | mPermissionView.setVisibility(VISIBLE); |
| 361 | ((ImageView) mPermissionView.findViewById(R.id.pkgicon)).setImageDrawable(mAppIcon); |
| 362 | ((TextView) mPermissionView.findViewById(R.id.pkgname)).setText(mAppName); |
Steven Wu | a62cb6a | 2019-02-15 17:12:51 -0500 | [diff] [blame] | 363 | logBubbleClickEvent(mEntry.notification, |
| 364 | StatsLog.BUBBLE_UICHANGED__ACTION__PERMISSION_DIALOG_SHOWN); |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 365 | } |
| 366 | } |
| 367 | |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 368 | private void updateExpandedView() { |
| 369 | mBubbleIntent = getBubbleIntent(mEntry); |
| 370 | if (mBubbleIntent != null) { |
| 371 | if (mNotifRow != null) { |
| 372 | // Clear out the row if we had it previously |
| 373 | removeView(mNotifRow); |
| 374 | mNotifRow = null; |
| 375 | } |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 376 | mActivityView.setVisibility(VISIBLE); |
| 377 | } else { |
| 378 | // Hide activity view if we had it previously |
| 379 | mActivityView.setVisibility(GONE); |
| 380 | |
| 381 | // Use notification view |
| 382 | mNotifRow = mEntry.getRow(); |
Mady Mellor | 44ee2fe | 2019-01-30 17:51:16 -0800 | [diff] [blame] | 383 | if (mShowOnTop) { |
| 384 | addView(mNotifRow); |
| 385 | } else { |
| 386 | addView(mNotifRow, mUseFooter ? 0 : 1); |
| 387 | } |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 388 | } |
| 389 | updateView(); |
| 390 | } |
| 391 | |
Mark Renouf | 041d726 | 2019-02-06 12:09:41 -0500 | [diff] [blame] | 392 | boolean performBackPressIfNeeded() { |
| 393 | if (mActivityView == null || !usingActivityView()) { |
| 394 | return false; |
| 395 | } |
| 396 | mActivityView.performBackPress(); |
| 397 | return true; |
| 398 | } |
| 399 | |
Mady Mellor | 44ee2fe | 2019-01-30 17:51:16 -0800 | [diff] [blame] | 400 | /** |
| 401 | * @return total height that the expanded view occupies. |
| 402 | */ |
| 403 | int getExpandedSize() { |
| 404 | int chromeHeight = mPermissionView.getVisibility() != View.VISIBLE |
| 405 | ? mHeaderHeight |
| 406 | : mPermissionHeight; |
| 407 | return mBubbleHeight + mPointerView.getHeight() + mPointerMargin |
| 408 | + chromeHeight; |
| 409 | } |
| 410 | |
Mady Mellor | fe7ec03 | 2019-01-30 17:32:49 -0800 | [diff] [blame] | 411 | void updateHeight() { |
| 412 | if (usingActivityView()) { |
| 413 | Notification.BubbleMetadata data = mEntry.getBubbleMetadata(); |
| 414 | int desiredHeight; |
| 415 | if (data == null) { |
| 416 | // This is a contentIntent based bubble, lets allow it to be the max height |
| 417 | // as it was forced into this mode and not prepared to be small |
| 418 | desiredHeight = mStackView.getMaxExpandedHeight(); |
| 419 | } else { |
| 420 | desiredHeight = data.getDesiredHeight() > 0 |
| 421 | ? data.getDesiredHeight() |
| 422 | : mMinHeight; |
| 423 | } |
Mady Mellor | 44ee2fe | 2019-01-30 17:51:16 -0800 | [diff] [blame] | 424 | int chromeHeight = mPermissionView.getVisibility() != View.VISIBLE |
| 425 | ? mHeaderHeight |
| 426 | : mPermissionHeight; |
| 427 | int max = mStackView.getMaxExpandedHeight() - chromeHeight - mPointerView.getHeight() |
| 428 | - mPointerMargin; |
Mady Mellor | fe7ec03 | 2019-01-30 17:32:49 -0800 | [diff] [blame] | 429 | int height = Math.min(desiredHeight, max); |
| 430 | height = Math.max(height, mMinHeight); |
| 431 | LayoutParams lp = (LayoutParams) mActivityView.getLayoutParams(); |
| 432 | lp.height = height; |
Mady Mellor | 44ee2fe | 2019-01-30 17:51:16 -0800 | [diff] [blame] | 433 | mBubbleHeight = height; |
Mady Mellor | fe7ec03 | 2019-01-30 17:32:49 -0800 | [diff] [blame] | 434 | mActivityView.setLayoutParams(lp); |
Mady Mellor | 44ee2fe | 2019-01-30 17:51:16 -0800 | [diff] [blame] | 435 | } else { |
| 436 | mBubbleHeight = mNotifRow != null ? mNotifRow.getIntrinsicHeight() : mMinHeight; |
Mady Mellor | fe7ec03 | 2019-01-30 17:32:49 -0800 | [diff] [blame] | 437 | } |
| 438 | } |
| 439 | |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 440 | @Override |
| 441 | public void onClick(View view) { |
| 442 | if (mEntry == null) { |
| 443 | return; |
| 444 | } |
| 445 | Notification n = mEntry.notification.getNotification(); |
| 446 | int id = view.getId(); |
| 447 | if (id == R.id.deep_link_button) { |
| 448 | mStackView.collapseStack(() -> { |
| 449 | try { |
| 450 | n.contentIntent.send(); |
Steven Wu | b00225b | 2019-02-08 14:27:42 -0500 | [diff] [blame] | 451 | logBubbleClickEvent(mEntry.notification, |
| 452 | StatsLog.BUBBLE_UICHANGED__ACTION__HEADER_GO_TO_APP); |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 453 | } catch (PendingIntent.CanceledException e) { |
| 454 | Log.w(TAG, "Failed to send intent for bubble with key: " |
| 455 | + (mEntry != null ? mEntry.key : " null entry")); |
| 456 | } |
| 457 | }); |
| 458 | } else if (id == R.id.settings_button) { |
| 459 | Intent intent = getSettingsIntent(mEntry.notification.getPackageName(), |
| 460 | mEntry.notification.getUid()); |
Steven Wu | b00225b | 2019-02-08 14:27:42 -0500 | [diff] [blame] | 461 | mStackView.collapseStack(() -> { |
| 462 | mContext.startActivity(intent); |
| 463 | logBubbleClickEvent(mEntry.notification, |
| 464 | StatsLog.BUBBLE_UICHANGED__ACTION__HEADER_GO_TO_SETTINGS); |
| 465 | }); |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 466 | } else if (id == R.id.no_bubbles_button) { |
| 467 | setBubblesAllowed(false); |
| 468 | } else if (id == R.id.yes_bubbles_button) { |
| 469 | setBubblesAllowed(true); |
| 470 | } |
| 471 | } |
| 472 | |
| 473 | private void setBubblesAllowed(boolean allowed) { |
| 474 | try { |
| 475 | mNotificationManagerService.setBubblesAllowed( |
| 476 | mEntry.notification.getPackageName(), |
| 477 | mEntry.notification.getUid(), |
| 478 | allowed); |
| 479 | if (allowed) { |
| 480 | mPermissionView.setVisibility(GONE); |
| 481 | mHeaderView.setVisibility(VISIBLE); |
| 482 | } else if (mOnBubbleBlockedListener != null) { |
| 483 | mOnBubbleBlockedListener.onBubbleBlocked(mEntry); |
| 484 | } |
Mady Mellor | 44ee2fe | 2019-01-30 17:51:16 -0800 | [diff] [blame] | 485 | mStackView.onExpandedHeightChanged(); |
Steven Wu | b00225b | 2019-02-08 14:27:42 -0500 | [diff] [blame] | 486 | logBubbleClickEvent(mEntry.notification, |
| 487 | allowed ? StatsLog.BUBBLE_UICHANGED__ACTION__PERMISSION_OPT_IN : |
| 488 | StatsLog.BUBBLE_UICHANGED__ACTION__PERMISSION_OPT_OUT); |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 489 | } catch (RemoteException e) { |
| 490 | Log.w(TAG, e); |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 491 | } |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 492 | } |
| 493 | |
| 494 | /** |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 495 | * Update appearance of the expanded view being displayed. |
| 496 | */ |
| 497 | public void updateView() { |
| 498 | if (usingActivityView() |
| 499 | && mActivityView.getVisibility() == VISIBLE |
| 500 | && mActivityView.isAttachedToWindow()) { |
| 501 | mActivityView.onLocationChanged(); |
| 502 | } else if (mNotifRow != null) { |
| 503 | applyRowState(mNotifRow); |
| 504 | } |
Mady Mellor | fe7ec03 | 2019-01-30 17:32:49 -0800 | [diff] [blame] | 505 | updateHeight(); |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 506 | } |
| 507 | |
| 508 | /** |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 509 | * Set the x position that the tip of the triangle should point to. |
| 510 | */ |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 511 | public void setPointerPosition(float x) { |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 512 | // Adjust for the pointer size |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 513 | x -= (mPointerView.getWidth() / 2f); |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 514 | mPointerView.setTranslationX(x); |
| 515 | } |
| 516 | |
| 517 | /** |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 518 | * Removes and releases an ActivityView if one was previously created for this bubble. |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 519 | */ |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 520 | public void destroyActivityView(ViewGroup tmpParent) { |
| 521 | if (mActivityView == null) { |
Mark Renouf | 89b1a4a | 2018-12-04 14:59:45 -0500 | [diff] [blame] | 522 | return; |
| 523 | } |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 524 | if (!mActivityViewReady) { |
| 525 | // release not needed, never initialized? |
| 526 | mActivityView = null; |
| 527 | return; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 528 | } |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 529 | // HACK: release() will crash if the view is not attached. |
| 530 | if (!isAttachedToWindow()) { |
| 531 | mActivityView.setVisibility(View.GONE); |
| 532 | tmpParent.addView(this); |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 533 | } |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 534 | |
| 535 | mActivityView.release(); |
| 536 | ((ViewGroup) getParent()).removeView(this); |
| 537 | mActivityView = null; |
| 538 | mActivityViewReady = false; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 539 | } |
| 540 | |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 541 | private boolean usingActivityView() { |
| 542 | return mBubbleIntent != null; |
| 543 | } |
| 544 | |
| 545 | private void applyRowState(ExpandableNotificationRow view) { |
| 546 | view.reset(); |
| 547 | view.setHeadsUp(false); |
| 548 | view.resetTranslation(); |
| 549 | view.setOnKeyguard(false); |
| 550 | view.setOnAmbient(false); |
| 551 | view.setClipBottomAmount(0); |
| 552 | view.setClipTopAmount(0); |
| 553 | view.setContentTransformationAmount(0, false); |
| 554 | view.setIconsVisible(true); |
| 555 | |
| 556 | // TODO - Need to reset this (and others) when view goes back in shade, leave for now |
| 557 | // view.setTopRoundness(1, false); |
| 558 | // view.setBottomRoundness(1, false); |
| 559 | |
| 560 | ExpandableViewState viewState = view.getViewState(); |
| 561 | viewState = viewState == null ? new ExpandableViewState() : viewState; |
| 562 | viewState.height = view.getIntrinsicHeight(); |
| 563 | viewState.gone = false; |
| 564 | viewState.hidden = false; |
| 565 | viewState.dimmed = false; |
| 566 | viewState.dark = false; |
| 567 | viewState.alpha = 1f; |
| 568 | viewState.notGoneIndex = -1; |
| 569 | viewState.xTranslation = 0; |
| 570 | viewState.yTranslation = 0; |
| 571 | viewState.zTranslation = 0; |
| 572 | viewState.scaleX = 1; |
| 573 | viewState.scaleY = 1; |
| 574 | viewState.inShelf = true; |
| 575 | viewState.headsUpIsVisible = false; |
| 576 | viewState.applyToView(view); |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 577 | } |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 578 | |
| 579 | private Intent getSettingsIntent(String packageName, final int appUid) { |
| 580 | final Intent intent = new Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS); |
| 581 | intent.putExtra(Settings.EXTRA_APP_PACKAGE, packageName); |
| 582 | intent.putExtra(Settings.EXTRA_APP_UID, appUid); |
| 583 | intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK); |
| 584 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| 585 | return intent; |
| 586 | } |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 587 | |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 588 | @Nullable |
| 589 | private PendingIntent getBubbleIntent(NotificationEntry entry) { |
| 590 | Notification notif = entry.notification.getNotification(); |
| 591 | String packageName = entry.notification.getPackageName(); |
| 592 | Notification.BubbleMetadata data = notif.getBubbleMetadata(); |
| 593 | if (data != null && canLaunchInActivityView(data.getIntent(), true /* enableLogging */, |
| 594 | packageName)) { |
| 595 | return data.getIntent(); |
| 596 | } else if (BubbleController.shouldUseContentIntent(mContext) |
| 597 | && canLaunchInActivityView(notif.contentIntent, false /* enableLogging */, |
| 598 | packageName)) { |
| 599 | return notif.contentIntent; |
| 600 | } |
| 601 | return null; |
| 602 | } |
| 603 | |
| 604 | /** |
| 605 | * Whether an intent is properly configured to display in an {@link android.app.ActivityView}. |
| 606 | * |
| 607 | * @param intent the pending intent of the bubble. |
| 608 | * @param enableLogging whether bubble developer error should be logged. |
| 609 | * @param packageName the notification package name for this bubble. |
| 610 | * @return |
| 611 | */ |
| 612 | private boolean canLaunchInActivityView(PendingIntent intent, boolean enableLogging, |
| 613 | String packageName) { |
| 614 | if (intent == null) { |
| 615 | return false; |
| 616 | } |
| 617 | ActivityInfo info = |
| 618 | intent.getIntent().resolveActivityInfo(mContext.getPackageManager(), 0); |
| 619 | if (info == null) { |
| 620 | if (enableLogging) { |
| 621 | StatsLog.write(StatsLog.BUBBLE_DEVELOPER_ERROR_REPORTED, packageName, |
| 622 | BUBBLE_DEVELOPER_ERROR_REPORTED__ERROR__ACTIVITY_INFO_MISSING); |
| 623 | } |
| 624 | return false; |
| 625 | } |
| 626 | if (!ActivityInfo.isResizeableMode(info.resizeMode)) { |
| 627 | if (enableLogging) { |
| 628 | StatsLog.write(StatsLog.BUBBLE_DEVELOPER_ERROR_REPORTED, packageName, |
| 629 | BUBBLE_DEVELOPER_ERROR_REPORTED__ERROR__ACTIVITY_INFO_NOT_RESIZABLE); |
| 630 | } |
| 631 | return false; |
| 632 | } |
| 633 | if (info.documentLaunchMode != DOCUMENT_LAUNCH_ALWAYS) { |
| 634 | if (enableLogging) { |
| 635 | StatsLog.write(StatsLog.BUBBLE_DEVELOPER_ERROR_REPORTED, packageName, |
| 636 | BUBBLE_DEVELOPER_ERROR_REPORTED__ERROR__DOCUMENT_LAUNCH_NOT_ALWAYS); |
| 637 | } |
| 638 | return false; |
| 639 | } |
| 640 | return (info.flags & ActivityInfo.FLAG_ALLOW_EMBEDDED) != 0; |
| 641 | } |
| 642 | |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 643 | /** |
| 644 | * Listener that is notified when a bubble is blocked. |
| 645 | */ |
| 646 | public interface OnBubbleBlockedListener { |
| 647 | /** |
| 648 | * Called when a bubble is blocked for the provided entry. |
| 649 | */ |
| 650 | void onBubbleBlocked(NotificationEntry entry); |
| 651 | } |
Steven Wu | b00225b | 2019-02-08 14:27:42 -0500 | [diff] [blame] | 652 | |
| 653 | /** |
| 654 | * Logs bubble UI click event. |
| 655 | * |
| 656 | * @param notification the bubble notification that user is interacting with. |
| 657 | * @param action the user interaction enum. |
| 658 | */ |
| 659 | private void logBubbleClickEvent(StatusBarNotification notification, int action) { |
| 660 | StatsLog.write(StatsLog.BUBBLE_UI_CHANGED, |
| 661 | notification.getPackageName(), |
| 662 | notification.getNotification().getChannelId(), |
| 663 | notification.getId(), |
| 664 | mStackView.getBubbleIndex(mStackView.getExpandedBubble()), |
| 665 | mStackView.getBubbleCount(), |
| 666 | action, |
| 667 | mStackView.getNormalizedXPosition(), |
| 668 | mStackView.getNormalizedYPosition()); |
| 669 | } |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 670 | } |