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 | 390bff4 | 2019-04-05 15:09:01 -0700 | [diff] [blame] | 19 | import static android.view.Display.INVALID_DISPLAY; |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 20 | |
Issei Suzuki | a8d0731 | 2019-06-07 12:56:19 +0200 | [diff] [blame] | 21 | import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_BUBBLES; |
| 22 | import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; |
Mady Mellor | ca0c24c | 2019-05-16 16:14:32 -0700 | [diff] [blame] | 23 | |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 24 | import android.annotation.Nullable; |
Mady Mellor | 60101c9 | 2019-04-11 19:04:00 -0700 | [diff] [blame] | 25 | import android.app.ActivityOptions; |
Mark Renouf | 5c732b3 | 2019-06-12 15:14:54 -0400 | [diff] [blame] | 26 | import android.app.ActivityTaskManager; |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 27 | import android.app.ActivityView; |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 28 | import android.app.Notification; |
| 29 | import android.app.PendingIntent; |
Mark Renouf | 5c732b3 | 2019-06-12 15:14:54 -0400 | [diff] [blame] | 30 | import android.content.ComponentName; |
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; |
| 33 | import android.content.pm.ApplicationInfo; |
| 34 | import android.content.pm.PackageManager; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 35 | import android.content.res.Resources; |
Mady Mellor | dd49705 | 2019-01-30 17:23:48 -0800 | [diff] [blame] | 36 | import android.content.res.TypedArray; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 37 | import android.graphics.Color; |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 38 | import android.graphics.Insets; |
| 39 | import android.graphics.Point; |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 40 | import android.graphics.drawable.Drawable; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 41 | import android.graphics.drawable.ShapeDrawable; |
Mark Renouf | 5c732b3 | 2019-06-12 15:14:54 -0400 | [diff] [blame] | 42 | import android.os.RemoteException; |
Mady Mellor | 7af771a | 2019-03-07 15:04:54 -0800 | [diff] [blame] | 43 | import android.os.UserHandle; |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 44 | import android.provider.Settings; |
Steven Wu | b00225b | 2019-02-08 14:27:42 -0500 | [diff] [blame] | 45 | import android.service.notification.StatusBarNotification; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 46 | import android.util.AttributeSet; |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 47 | import android.util.Log; |
Steven Wu | b00225b | 2019-02-08 14:27:42 -0500 | [diff] [blame] | 48 | import android.util.StatsLog; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 49 | import android.view.View; |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 50 | import android.view.WindowInsets; |
Mady Mellor | a96c9ed | 2019-06-07 12:55:26 -0700 | [diff] [blame] | 51 | import android.view.WindowManager; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 52 | import android.widget.LinearLayout; |
| 53 | |
Mark Renouf | 34d04f3 | 2019-05-13 15:53:18 -0400 | [diff] [blame] | 54 | import com.android.internal.policy.ScreenDecorationsUtils; |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 55 | import com.android.systemui.Dependency; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 56 | import com.android.systemui.R; |
| 57 | import com.android.systemui.recents.TriangleShape; |
Lyn Han | 754e77b | 2019-04-30 14:34:49 -0700 | [diff] [blame] | 58 | import com.android.systemui.statusbar.AlphaOptimizedButton; |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 59 | import com.android.systemui.statusbar.notification.collection.NotificationEntry; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 60 | |
| 61 | /** |
Lyn Han | 02cca81 | 2019-04-02 16:27:32 -0700 | [diff] [blame] | 62 | * Container for the expanded bubble view, handles rendering the caret and settings icon. |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 63 | */ |
Mady Mellor | 3d82e68 | 2019-02-05 13:34:48 -0800 | [diff] [blame] | 64 | public class BubbleExpandedView extends LinearLayout implements View.OnClickListener { |
Issei Suzuki | a8d0731 | 2019-06-07 12:56:19 +0200 | [diff] [blame] | 65 | private static final String TAG = TAG_WITH_CLASS_NAME ? "BubbleExpandedView" : TAG_BUBBLES; |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 66 | |
Issei Suzuki | 734bc94 | 2019-06-05 13:59:52 +0200 | [diff] [blame] | 67 | private enum ActivityViewStatus { |
| 68 | // ActivityView is being initialized, cannot start an activity yet. |
| 69 | INITIALIZING, |
| 70 | // ActivityView is initialized, and ready to start an activity. |
| 71 | INITIALIZED, |
| 72 | // Activity runs in the ActivityView. |
| 73 | ACTIVITY_STARTED, |
| 74 | // ActivityView is released, so activity launching will no longer be permitted. |
| 75 | RELEASED, |
| 76 | } |
| 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 | |
Lyn Han | 754e77b | 2019-04-30 14:34:49 -0700 | [diff] [blame] | 82 | private AlphaOptimizedButton mSettingsIcon; |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 83 | |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 84 | // Views for expanded state |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 85 | private ActivityView mActivityView; |
| 86 | |
Issei Suzuki | 734bc94 | 2019-06-05 13:59:52 +0200 | [diff] [blame] | 87 | private ActivityViewStatus mActivityViewStatus = ActivityViewStatus.INITIALIZING; |
Mark Renouf | 5c732b3 | 2019-06-12 15:14:54 -0400 | [diff] [blame] | 88 | private int mTaskId = -1; |
| 89 | |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 90 | private PendingIntent mBubbleIntent; |
| 91 | |
Mady Mellor | 5d8f140 | 2019-02-21 18:23:52 -0800 | [diff] [blame] | 92 | private boolean mKeyboardVisible; |
| 93 | private boolean mNeedsNewHeight; |
| 94 | |
Mady Mellor | a96c9ed | 2019-06-07 12:55:26 -0700 | [diff] [blame] | 95 | private Point mDisplaySize; |
Mady Mellor | fe7ec03 | 2019-01-30 17:32:49 -0800 | [diff] [blame] | 96 | private int mMinHeight; |
Lyn Han | 02cca81 | 2019-04-02 16:27:32 -0700 | [diff] [blame] | 97 | private int mSettingsIconHeight; |
Lyn Han | 02cca81 | 2019-04-02 16:27:32 -0700 | [diff] [blame] | 98 | private int mPointerWidth; |
| 99 | private int mPointerHeight; |
Mark Renouf | 34d04f3 | 2019-05-13 15:53:18 -0400 | [diff] [blame] | 100 | private ShapeDrawable mPointerDrawable; |
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 | |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 107 | private BubbleController mBubbleController = Dependency.get(BubbleController.class); |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 108 | |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 109 | private BubbleStackView mStackView; |
| 110 | |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 111 | private ActivityView.StateCallback mStateCallback = new ActivityView.StateCallback() { |
| 112 | @Override |
| 113 | public void onActivityViewReady(ActivityView view) { |
Issei Suzuki | 734bc94 | 2019-06-05 13:59:52 +0200 | [diff] [blame] | 114 | switch (mActivityViewStatus) { |
| 115 | case INITIALIZING: |
| 116 | case INITIALIZED: |
| 117 | // Custom options so there is no activity transition animation |
| 118 | ActivityOptions options = ActivityOptions.makeCustomAnimation(getContext(), |
| 119 | 0 /* enterResId */, 0 /* exitResId */); |
| 120 | // Post to keep the lifecycle normal |
| 121 | post(() -> mActivityView.startActivity(mBubbleIntent, options)); |
| 122 | mActivityViewStatus = ActivityViewStatus.ACTIVITY_STARTED; |
Mady Mellor | 6d00203 | 2019-02-13 13:45:17 -0800 | [diff] [blame] | 123 | } |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 124 | } |
| 125 | |
| 126 | @Override |
| 127 | public void onActivityViewDestroyed(ActivityView view) { |
Issei Suzuki | 734bc94 | 2019-06-05 13:59:52 +0200 | [diff] [blame] | 128 | mActivityViewStatus = ActivityViewStatus.RELEASED; |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 129 | } |
| 130 | |
Mark Renouf | 5c732b3 | 2019-06-12 15:14:54 -0400 | [diff] [blame] | 131 | @Override |
| 132 | public void onTaskCreated(int taskId, ComponentName componentName) { |
| 133 | // Since Bubble ActivityView applies singleTaskDisplay this is |
| 134 | // guaranteed to only be called once per ActivityView. The taskId is |
| 135 | // saved to use for removeTask, preventing appearance in recent tasks. |
| 136 | mTaskId = taskId; |
| 137 | } |
| 138 | |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 139 | /** |
| 140 | * This is only called for tasks on this ActivityView, which is also set to |
| 141 | * single-task mode -- meaning never more than one task on this display. If a task |
| 142 | * is being removed, it's the top Activity finishing and this bubble should |
| 143 | * be removed or collapsed. |
| 144 | */ |
| 145 | @Override |
| 146 | public void onTaskRemovalStarted(int taskId) { |
| 147 | if (mEntry != null) { |
| 148 | // Must post because this is called from a binder thread. |
Mark Renouf | 08bc42a | 2019-03-07 13:01:59 -0500 | [diff] [blame] | 149 | post(() -> mBubbleController.removeBubble(mEntry.key, |
| 150 | BubbleController.DISMISS_TASK_FINISHED)); |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 151 | } |
| 152 | } |
| 153 | }; |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 154 | |
Mady Mellor | 3d82e68 | 2019-02-05 13:34:48 -0800 | [diff] [blame] | 155 | public BubbleExpandedView(Context context) { |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 156 | this(context, null); |
| 157 | } |
| 158 | |
Mady Mellor | 3d82e68 | 2019-02-05 13:34:48 -0800 | [diff] [blame] | 159 | public BubbleExpandedView(Context context, AttributeSet attrs) { |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 160 | this(context, attrs, 0); |
| 161 | } |
| 162 | |
Mady Mellor | 3d82e68 | 2019-02-05 13:34:48 -0800 | [diff] [blame] | 163 | public BubbleExpandedView(Context context, AttributeSet attrs, int defStyleAttr) { |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 164 | this(context, attrs, defStyleAttr, 0); |
| 165 | } |
| 166 | |
Mady Mellor | 3d82e68 | 2019-02-05 13:34:48 -0800 | [diff] [blame] | 167 | public BubbleExpandedView(Context context, AttributeSet attrs, int defStyleAttr, |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 168 | int defStyleRes) { |
| 169 | super(context, attrs, defStyleAttr, defStyleRes); |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 170 | mPm = context.getPackageManager(); |
Mady Mellor | a96c9ed | 2019-06-07 12:55:26 -0700 | [diff] [blame] | 171 | mDisplaySize = new Point(); |
| 172 | WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); |
| 173 | wm.getDefaultDisplay().getSize(mDisplaySize); |
Mady Mellor | fe7ec03 | 2019-01-30 17:32:49 -0800 | [diff] [blame] | 174 | mMinHeight = getResources().getDimensionPixelSize( |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 175 | R.dimen.bubble_expanded_default_height); |
Mady Mellor | 44ee2fe | 2019-01-30 17:51:16 -0800 | [diff] [blame] | 176 | mPointerMargin = getResources().getDimensionPixelSize(R.dimen.bubble_pointer_margin); |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 177 | } |
| 178 | |
| 179 | @Override |
| 180 | protected void onFinishInflate() { |
| 181 | super.onFinishInflate(); |
| 182 | |
| 183 | Resources res = getResources(); |
| 184 | mPointerView = findViewById(R.id.pointer_view); |
Lyn Han | 02cca81 | 2019-04-02 16:27:32 -0700 | [diff] [blame] | 185 | mPointerWidth = res.getDimensionPixelSize(R.dimen.bubble_pointer_width); |
| 186 | mPointerHeight = res.getDimensionPixelSize(R.dimen.bubble_pointer_height); |
Mady Mellor | dd49705 | 2019-01-30 17:23:48 -0800 | [diff] [blame] | 187 | |
Mady Mellor | dd49705 | 2019-01-30 17:23:48 -0800 | [diff] [blame] | 188 | |
Mark Renouf | 34d04f3 | 2019-05-13 15:53:18 -0400 | [diff] [blame] | 189 | mPointerDrawable = new ShapeDrawable(TriangleShape.create( |
Lyn Han | 5aa27e2 | 2019-05-15 10:55:07 -0700 | [diff] [blame] | 190 | mPointerWidth, mPointerHeight, true /* pointUp */)); |
Mark Renouf | 34d04f3 | 2019-05-13 15:53:18 -0400 | [diff] [blame] | 191 | mPointerView.setBackground(mPointerDrawable); |
Mady Mellor | a96c9ed | 2019-06-07 12:55:26 -0700 | [diff] [blame] | 192 | mPointerView.setVisibility(INVISIBLE); |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 193 | |
Lyn Han | 02cca81 | 2019-04-02 16:27:32 -0700 | [diff] [blame] | 194 | mSettingsIconHeight = getContext().getResources().getDimensionPixelSize( |
Mady Mellor | fe7ec03 | 2019-01-30 17:32:49 -0800 | [diff] [blame] | 195 | R.dimen.bubble_expanded_header_height); |
Lyn Han | 02cca81 | 2019-04-02 16:27:32 -0700 | [diff] [blame] | 196 | mSettingsIcon = findViewById(R.id.settings_button); |
Lyn Han | 02cca81 | 2019-04-02 16:27:32 -0700 | [diff] [blame] | 197 | mSettingsIcon.setOnClickListener(this); |
Lyn Han | 02cca81 | 2019-04-02 16:27:32 -0700 | [diff] [blame] | 198 | |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 199 | mActivityView = new ActivityView(mContext, null /* attrs */, 0 /* defStyle */, |
| 200 | true /* singleTaskInstance */); |
Issei Suzuki | cac2a50 | 2019-04-16 16:52:50 +0200 | [diff] [blame] | 201 | |
| 202 | setContentVisibility(false); |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 203 | addView(mActivityView); |
| 204 | |
Lyn Han | 5aa27e2 | 2019-05-15 10:55:07 -0700 | [diff] [blame] | 205 | // Expanded stack layout, top to bottom: |
| 206 | // Expanded view container |
| 207 | // ==> bubble row |
| 208 | // ==> expanded view |
| 209 | // ==> activity view |
| 210 | // ==> manage button |
| 211 | bringChildToFront(mActivityView); |
| 212 | bringChildToFront(mSettingsIcon); |
Mady Mellor | 52b1ac6 | 2019-04-10 16:59:03 -0700 | [diff] [blame] | 213 | |
Mark Renouf | 34d04f3 | 2019-05-13 15:53:18 -0400 | [diff] [blame] | 214 | applyThemeAttrs(); |
| 215 | |
Mady Mellor | 5d8f140 | 2019-02-21 18:23:52 -0800 | [diff] [blame] | 216 | setOnApplyWindowInsetsListener((View view, WindowInsets insets) -> { |
| 217 | // Keep track of IME displaying because we should not make any adjustments that might |
| 218 | // cause a config change while the IME is displayed otherwise it'll loose focus. |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 219 | final int keyboardHeight = insets.getSystemWindowInsetBottom() |
| 220 | - insets.getStableInsetBottom(); |
Mady Mellor | 5d8f140 | 2019-02-21 18:23:52 -0800 | [diff] [blame] | 221 | mKeyboardVisible = keyboardHeight != 0; |
| 222 | if (!mKeyboardVisible && mNeedsNewHeight) { |
| 223 | updateHeight(); |
| 224 | } |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 225 | return view.onApplyWindowInsets(insets); |
| 226 | }); |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 227 | } |
| 228 | |
Mark Renouf | 34d04f3 | 2019-05-13 15:53:18 -0400 | [diff] [blame] | 229 | void applyThemeAttrs() { |
| 230 | TypedArray ta = getContext().obtainStyledAttributes(R.styleable.BubbleExpandedView); |
| 231 | int bgColor = ta.getColor( |
| 232 | R.styleable.BubbleExpandedView_android_colorBackgroundFloating, Color.WHITE); |
| 233 | float cornerRadius = ta.getDimension( |
| 234 | R.styleable.BubbleExpandedView_android_dialogCornerRadius, 0); |
| 235 | ta.recycle(); |
| 236 | |
| 237 | // Update triangle color. |
| 238 | mPointerDrawable.setTint(bgColor); |
| 239 | |
| 240 | // Update ActivityView cornerRadius |
| 241 | if (ScreenDecorationsUtils.supportsRoundedCornersOnWindows(mContext.getResources())) { |
| 242 | mActivityView.setCornerRadius(cornerRadius); |
| 243 | } |
| 244 | } |
| 245 | |
Mady Mellor | 5d8f140 | 2019-02-21 18:23:52 -0800 | [diff] [blame] | 246 | @Override |
| 247 | protected void onDetachedFromWindow() { |
| 248 | super.onDetachedFromWindow(); |
| 249 | mKeyboardVisible = false; |
| 250 | mNeedsNewHeight = false; |
| 251 | if (mActivityView != null) { |
| 252 | mActivityView.setForwardedInsets(Insets.of(0, 0, 0, 0)); |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | /** |
Issei Suzuki | cac2a50 | 2019-04-16 16:52:50 +0200 | [diff] [blame] | 257 | * Set visibility of contents in the expanded state. |
| 258 | * |
| 259 | * @param visibility {@code true} if the contents should be visible on the screen. |
| 260 | * |
| 261 | * Note that this contents visibility doesn't affect visibility at {@link android.view.View}, |
| 262 | * and setting {@code false} actually means rendering the contents in transparent. |
| 263 | */ |
| 264 | void setContentVisibility(boolean visibility) { |
| 265 | final float alpha = visibility ? 1f : 0f; |
| 266 | mPointerView.setAlpha(alpha); |
| 267 | if (mActivityView != null) { |
| 268 | mActivityView.setAlpha(alpha); |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | /** |
Mady Mellor | 5d8f140 | 2019-02-21 18:23:52 -0800 | [diff] [blame] | 273 | * Called by {@link BubbleStackView} when the insets for the expanded state should be updated. |
| 274 | * This should be done post-move and post-animation. |
| 275 | */ |
| 276 | void updateInsets(WindowInsets insets) { |
| 277 | if (usingActivityView()) { |
Mady Mellor | 5d8f140 | 2019-02-21 18:23:52 -0800 | [diff] [blame] | 278 | int[] windowLocation = mActivityView.getLocationOnScreen(); |
| 279 | final int windowBottom = windowLocation[1] + mActivityView.getHeight(); |
| 280 | final int keyboardHeight = insets.getSystemWindowInsetBottom() |
| 281 | - insets.getStableInsetBottom(); |
| 282 | final int insetsBottom = Math.max(0, |
Mady Mellor | a96c9ed | 2019-06-07 12:55:26 -0700 | [diff] [blame] | 283 | windowBottom + keyboardHeight - mDisplaySize.y); |
Mady Mellor | 5d8f140 | 2019-02-21 18:23:52 -0800 | [diff] [blame] | 284 | mActivityView.setForwardedInsets(Insets.of(0, 0, 0, insetsBottom)); |
| 285 | } |
| 286 | } |
| 287 | |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 288 | /** |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 289 | * Sets the notification entry used to populate this view. |
| 290 | */ |
Lyn Han | 6c40fe7 | 2019-05-08 14:06:33 -0700 | [diff] [blame] | 291 | public void setEntry(NotificationEntry entry, BubbleStackView stackView, String appName) { |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 292 | mStackView = stackView; |
| 293 | mEntry = entry; |
Lyn Han | 6c40fe7 | 2019-05-08 14:06:33 -0700 | [diff] [blame] | 294 | mAppName = appName; |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 295 | |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 296 | try { |
Issei Suzuki | a91f396 | 2019-06-07 11:48:23 +0200 | [diff] [blame] | 297 | ApplicationInfo info = mPm.getApplicationInfo( |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 298 | entry.notification.getPackageName(), |
| 299 | PackageManager.MATCH_UNINSTALLED_PACKAGES |
| 300 | | PackageManager.MATCH_DISABLED_COMPONENTS |
| 301 | | PackageManager.MATCH_DIRECT_BOOT_UNAWARE |
| 302 | | PackageManager.MATCH_DIRECT_BOOT_AWARE); |
Issei Suzuki | a91f396 | 2019-06-07 11:48:23 +0200 | [diff] [blame] | 303 | mAppIcon = mPm.getApplicationIcon(info); |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 304 | } catch (PackageManager.NameNotFoundException e) { |
Lyn Han | 6c40fe7 | 2019-05-08 14:06:33 -0700 | [diff] [blame] | 305 | // Do nothing. |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 306 | } |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 307 | if (mAppIcon == null) { |
| 308 | mAppIcon = mPm.getDefaultActivityIcon(); |
| 309 | } |
Mark Renouf | 34d04f3 | 2019-05-13 15:53:18 -0400 | [diff] [blame] | 310 | applyThemeAttrs(); |
Lyn Han | 6914912 | 2019-04-30 12:03:12 -0700 | [diff] [blame] | 311 | showSettingsIcon(); |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 312 | updateExpandedView(); |
Mady Mellor | 6d00203 | 2019-02-13 13:45:17 -0800 | [diff] [blame] | 313 | } |
| 314 | |
| 315 | /** |
| 316 | * Lets activity view know it should be shown / populated. |
| 317 | */ |
Mady Mellor | 5029fa6 | 2019-03-05 12:16:21 -0800 | [diff] [blame] | 318 | public void populateExpandedView() { |
| 319 | if (usingActivityView()) { |
| 320 | mActivityView.setCallback(mStateCallback); |
| 321 | } else { |
Issei Suzuki | a91f396 | 2019-06-07 11:48:23 +0200 | [diff] [blame] | 322 | Log.e(TAG, "Cannot populate expanded view."); |
Mady Mellor | 5029fa6 | 2019-03-05 12:16:21 -0800 | [diff] [blame] | 323 | } |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 324 | } |
| 325 | |
Mady Mellor | fe7ec03 | 2019-01-30 17:32:49 -0800 | [diff] [blame] | 326 | /** |
| 327 | * Updates the entry backing this view. This will not re-populate ActivityView, it will |
Lyn Han | 02cca81 | 2019-04-02 16:27:32 -0700 | [diff] [blame] | 328 | * only update the deep-links in the title, and the height of the view. |
Mady Mellor | fe7ec03 | 2019-01-30 17:32:49 -0800 | [diff] [blame] | 329 | */ |
| 330 | public void update(NotificationEntry entry) { |
| 331 | if (entry.key.equals(mEntry.key)) { |
| 332 | mEntry = entry; |
Lyn Han | 02cca81 | 2019-04-02 16:27:32 -0700 | [diff] [blame] | 333 | updateSettingsContentDescription(); |
Mady Mellor | fe7ec03 | 2019-01-30 17:32:49 -0800 | [diff] [blame] | 334 | updateHeight(); |
| 335 | } else { |
| 336 | Log.w(TAG, "Trying to update entry with different key, new entry: " |
| 337 | + entry.key + " old entry: " + mEntry.key); |
| 338 | } |
| 339 | } |
| 340 | |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 341 | private void updateExpandedView() { |
| 342 | mBubbleIntent = getBubbleIntent(mEntry); |
| 343 | if (mBubbleIntent != null) { |
Issei Suzuki | cac2a50 | 2019-04-16 16:52:50 +0200 | [diff] [blame] | 344 | setContentVisibility(false); |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 345 | mActivityView.setVisibility(VISIBLE); |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 346 | } |
| 347 | updateView(); |
| 348 | } |
| 349 | |
Mark Renouf | 041d726 | 2019-02-06 12:09:41 -0500 | [diff] [blame] | 350 | boolean performBackPressIfNeeded() { |
Mady Mellor | 323fb0b | 2019-03-25 12:15:22 -0700 | [diff] [blame] | 351 | if (!usingActivityView()) { |
Mark Renouf | 041d726 | 2019-02-06 12:09:41 -0500 | [diff] [blame] | 352 | return false; |
| 353 | } |
| 354 | mActivityView.performBackPress(); |
| 355 | return true; |
| 356 | } |
| 357 | |
Mady Mellor | fe7ec03 | 2019-01-30 17:32:49 -0800 | [diff] [blame] | 358 | void updateHeight() { |
| 359 | if (usingActivityView()) { |
| 360 | Notification.BubbleMetadata data = mEntry.getBubbleMetadata(); |
Mady Mellor | 7af771a | 2019-03-07 15:04:54 -0800 | [diff] [blame] | 361 | float desiredHeight; |
Mady Mellor | fe7ec03 | 2019-01-30 17:32:49 -0800 | [diff] [blame] | 362 | if (data == null) { |
| 363 | // This is a contentIntent based bubble, lets allow it to be the max height |
| 364 | // as it was forced into this mode and not prepared to be small |
Mady Mellor | a96c9ed | 2019-06-07 12:55:26 -0700 | [diff] [blame] | 365 | desiredHeight = getMaxExpandedHeight(); |
Mady Mellor | fe7ec03 | 2019-01-30 17:32:49 -0800 | [diff] [blame] | 366 | } else { |
Mady Mellor | 7af771a | 2019-03-07 15:04:54 -0800 | [diff] [blame] | 367 | boolean useRes = data.getDesiredHeightResId() != 0; |
| 368 | float desiredPx; |
| 369 | if (useRes) { |
| 370 | desiredPx = getDimenForPackageUser(data.getDesiredHeightResId(), |
| 371 | mEntry.notification.getPackageName(), |
| 372 | mEntry.notification.getUser().getIdentifier()); |
| 373 | } else { |
| 374 | desiredPx = data.getDesiredHeight() |
| 375 | * getContext().getResources().getDisplayMetrics().density; |
| 376 | } |
| 377 | desiredHeight = desiredPx > 0 ? desiredPx : mMinHeight; |
Mady Mellor | fe7ec03 | 2019-01-30 17:32:49 -0800 | [diff] [blame] | 378 | } |
Mady Mellor | a96c9ed | 2019-06-07 12:55:26 -0700 | [diff] [blame] | 379 | float height = Math.min(desiredHeight, getMaxExpandedHeight()); |
Mady Mellor | fe7ec03 | 2019-01-30 17:32:49 -0800 | [diff] [blame] | 380 | height = Math.max(height, mMinHeight); |
| 381 | LayoutParams lp = (LayoutParams) mActivityView.getLayoutParams(); |
Mady Mellor | 5d8f140 | 2019-02-21 18:23:52 -0800 | [diff] [blame] | 382 | mNeedsNewHeight = lp.height != height; |
| 383 | if (!mKeyboardVisible) { |
| 384 | // If the keyboard is visible... don't adjust the height because that will cause |
| 385 | // a configuration change and the keyboard will be lost. |
Mady Mellor | 7af771a | 2019-03-07 15:04:54 -0800 | [diff] [blame] | 386 | lp.height = (int) height; |
Mady Mellor | 5d8f140 | 2019-02-21 18:23:52 -0800 | [diff] [blame] | 387 | mActivityView.setLayoutParams(lp); |
| 388 | mNeedsNewHeight = false; |
| 389 | } |
Mady Mellor | fe7ec03 | 2019-01-30 17:32:49 -0800 | [diff] [blame] | 390 | } |
| 391 | } |
| 392 | |
Mady Mellor | a96c9ed | 2019-06-07 12:55:26 -0700 | [diff] [blame] | 393 | private int getMaxExpandedHeight() { |
| 394 | int[] windowLocation = mActivityView.getLocationOnScreen(); |
| 395 | return mDisplaySize.y - windowLocation[1] - mSettingsIconHeight; |
| 396 | } |
| 397 | |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 398 | @Override |
| 399 | public void onClick(View view) { |
| 400 | if (mEntry == null) { |
| 401 | return; |
| 402 | } |
| 403 | Notification n = mEntry.notification.getNotification(); |
| 404 | int id = view.getId(); |
Lyn Han | c26ff12 | 2019-03-29 16:46:07 -0700 | [diff] [blame] | 405 | if (id == R.id.settings_button) { |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 406 | Intent intent = getSettingsIntent(mEntry.notification.getPackageName(), |
| 407 | mEntry.notification.getUid()); |
Steven Wu | b00225b | 2019-02-08 14:27:42 -0500 | [diff] [blame] | 408 | mStackView.collapseStack(() -> { |
Mark Renouf | 7617619 | 2019-05-20 09:29:44 -0400 | [diff] [blame] | 409 | mContext.startActivityAsUser(intent, mEntry.notification.getUser()); |
Steven Wu | 45e38ae | 2019-03-25 16:16:59 -0400 | [diff] [blame] | 410 | logBubbleClickEvent(mEntry, |
Steven Wu | b00225b | 2019-02-08 14:27:42 -0500 | [diff] [blame] | 411 | StatsLog.BUBBLE_UICHANGED__ACTION__HEADER_GO_TO_SETTINGS); |
| 412 | }); |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 413 | } |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 414 | } |
| 415 | |
Lyn Han | 02cca81 | 2019-04-02 16:27:32 -0700 | [diff] [blame] | 416 | private void updateSettingsContentDescription() { |
| 417 | mSettingsIcon.setContentDescription(getResources().getString( |
| 418 | R.string.bubbles_settings_button_description, mAppName)); |
| 419 | } |
| 420 | |
Lyn Han | c26ff12 | 2019-03-29 16:46:07 -0700 | [diff] [blame] | 421 | void showSettingsIcon() { |
Lyn Han | 02cca81 | 2019-04-02 16:27:32 -0700 | [diff] [blame] | 422 | updateSettingsContentDescription(); |
Lyn Han | c26ff12 | 2019-03-29 16:46:07 -0700 | [diff] [blame] | 423 | mSettingsIcon.setVisibility(VISIBLE); |
| 424 | } |
| 425 | |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 426 | /** |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 427 | * Update appearance of the expanded view being displayed. |
| 428 | */ |
| 429 | public void updateView() { |
| 430 | if (usingActivityView() |
| 431 | && mActivityView.getVisibility() == VISIBLE |
| 432 | && mActivityView.isAttachedToWindow()) { |
| 433 | mActivityView.onLocationChanged(); |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 434 | } |
Mady Mellor | fe7ec03 | 2019-01-30 17:32:49 -0800 | [diff] [blame] | 435 | updateHeight(); |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 436 | } |
| 437 | |
| 438 | /** |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 439 | * Set the x position that the tip of the triangle should point to. |
| 440 | */ |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 441 | public void setPointerPosition(float x) { |
Lyn Han | 9a2f5cf | 2019-05-23 11:01:41 -0700 | [diff] [blame] | 442 | float halfPointerWidth = mPointerWidth / 2f; |
| 443 | float pointerLeft = x - halfPointerWidth; |
| 444 | mPointerView.setTranslationX(pointerLeft); |
Lyn Han | f74ba67 | 2019-05-20 16:08:48 -0700 | [diff] [blame] | 445 | mPointerView.setVisibility(VISIBLE); |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 446 | } |
| 447 | |
| 448 | /** |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 449 | * 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] | 450 | */ |
Mady Mellor | 94d94a7 | 2019-03-05 18:16:59 -0800 | [diff] [blame] | 451 | public void cleanUpExpandedState() { |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 452 | if (mActivityView == null) { |
Mark Renouf | 89b1a4a | 2018-12-04 14:59:45 -0500 | [diff] [blame] | 453 | return; |
| 454 | } |
Issei Suzuki | 734bc94 | 2019-06-05 13:59:52 +0200 | [diff] [blame] | 455 | switch (mActivityViewStatus) { |
| 456 | case INITIALIZED: |
| 457 | case ACTIVITY_STARTED: |
| 458 | mActivityView.release(); |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 459 | } |
Mark Renouf | 5c732b3 | 2019-06-12 15:14:54 -0400 | [diff] [blame] | 460 | if (mTaskId != -1) { |
| 461 | try { |
| 462 | ActivityTaskManager.getService().removeTask(mTaskId); |
| 463 | } catch (RemoteException e) { |
| 464 | Log.w(TAG, "Failed to remove taskId " + mTaskId); |
| 465 | } |
| 466 | mTaskId = -1; |
| 467 | } |
Mark Renouf | 28c250d | 2019-02-25 16:47:34 -0500 | [diff] [blame] | 468 | removeView(mActivityView); |
Mark Renouf | 5c732b3 | 2019-06-12 15:14:54 -0400 | [diff] [blame] | 469 | |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 470 | mActivityView = null; |
Issei Suzuki | 734bc94 | 2019-06-05 13:59:52 +0200 | [diff] [blame] | 471 | } |
| 472 | |
| 473 | /** |
| 474 | * Called when the last task is removed from a {@link android.hardware.display.VirtualDisplay} |
| 475 | * which {@link ActivityView} uses. |
| 476 | */ |
| 477 | void notifyDisplayEmpty() { |
| 478 | if (mActivityViewStatus == ActivityViewStatus.ACTIVITY_STARTED) { |
| 479 | mActivityViewStatus = ActivityViewStatus.INITIALIZED; |
| 480 | } |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 481 | } |
| 482 | |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 483 | private boolean usingActivityView() { |
Mady Mellor | 323fb0b | 2019-03-25 12:15:22 -0700 | [diff] [blame] | 484 | return mBubbleIntent != null && mActivityView != null; |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 485 | } |
| 486 | |
Mady Mellor | 390bff4 | 2019-04-05 15:09:01 -0700 | [diff] [blame] | 487 | /** |
| 488 | * @return the display id of the virtual display. |
| 489 | */ |
| 490 | public int getVirtualDisplayId() { |
| 491 | if (usingActivityView()) { |
| 492 | return mActivityView.getVirtualDisplayId(); |
| 493 | } |
| 494 | return INVALID_DISPLAY; |
| 495 | } |
| 496 | |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 497 | private Intent getSettingsIntent(String packageName, final int appUid) { |
Lyn Han | 754e77b | 2019-04-30 14:34:49 -0700 | [diff] [blame] | 498 | final Intent intent = new Intent(Settings.ACTION_APP_NOTIFICATION_BUBBLE_SETTINGS); |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 499 | intent.putExtra(Settings.EXTRA_APP_PACKAGE, packageName); |
| 500 | intent.putExtra(Settings.EXTRA_APP_UID, appUid); |
| 501 | intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK); |
| 502 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
Lyn Han | 754e77b | 2019-04-30 14:34:49 -0700 | [diff] [blame] | 503 | intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); |
Mady Mellor | 9801e85 | 2019-01-22 14:50:28 -0800 | [diff] [blame] | 504 | return intent; |
| 505 | } |
Mady Mellor | e8e0771 | 2019-01-23 12:45:33 -0800 | [diff] [blame] | 506 | |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 507 | @Nullable |
| 508 | private PendingIntent getBubbleIntent(NotificationEntry entry) { |
| 509 | Notification notif = entry.notification.getNotification(); |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 510 | Notification.BubbleMetadata data = notif.getBubbleMetadata(); |
Mady Mellor | ca0c24c | 2019-05-16 16:14:32 -0700 | [diff] [blame] | 511 | if (BubbleController.canLaunchInActivityView(mContext, entry) && data != null) { |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 512 | return data.getIntent(); |
Mady Mellor | 3dff9e6 | 2019-02-05 18:12:53 -0800 | [diff] [blame] | 513 | } |
| 514 | return null; |
| 515 | } |
| 516 | |
| 517 | /** |
Steven Wu | b00225b | 2019-02-08 14:27:42 -0500 | [diff] [blame] | 518 | * Logs bubble UI click event. |
| 519 | * |
Steven Wu | 45e38ae | 2019-03-25 16:16:59 -0400 | [diff] [blame] | 520 | * @param entry the bubble notification entry that user is interacting with. |
Steven Wu | b00225b | 2019-02-08 14:27:42 -0500 | [diff] [blame] | 521 | * @param action the user interaction enum. |
| 522 | */ |
Steven Wu | 45e38ae | 2019-03-25 16:16:59 -0400 | [diff] [blame] | 523 | private void logBubbleClickEvent(NotificationEntry entry, int action) { |
| 524 | StatusBarNotification notification = entry.notification; |
Steven Wu | b00225b | 2019-02-08 14:27:42 -0500 | [diff] [blame] | 525 | StatsLog.write(StatsLog.BUBBLE_UI_CHANGED, |
| 526 | notification.getPackageName(), |
| 527 | notification.getNotification().getChannelId(), |
| 528 | notification.getId(), |
| 529 | mStackView.getBubbleIndex(mStackView.getExpandedBubble()), |
| 530 | mStackView.getBubbleCount(), |
| 531 | action, |
| 532 | mStackView.getNormalizedXPosition(), |
Steven Wu | 45e38ae | 2019-03-25 16:16:59 -0400 | [diff] [blame] | 533 | mStackView.getNormalizedYPosition(), |
Steven Wu | 8ba8ca9 | 2019-04-11 10:47:42 -0400 | [diff] [blame] | 534 | entry.showInShadeWhenBubble(), |
| 535 | entry.isForegroundService(), |
| 536 | BubbleController.isForegroundApp(mContext, notification.getPackageName())); |
Steven Wu | b00225b | 2019-02-08 14:27:42 -0500 | [diff] [blame] | 537 | } |
Mady Mellor | 7af771a | 2019-03-07 15:04:54 -0800 | [diff] [blame] | 538 | |
| 539 | private int getDimenForPackageUser(int resId, String pkg, int userId) { |
| 540 | Resources r; |
| 541 | if (pkg != null) { |
| 542 | try { |
| 543 | if (userId == UserHandle.USER_ALL) { |
| 544 | userId = UserHandle.USER_SYSTEM; |
| 545 | } |
| 546 | r = mPm.getResourcesForApplicationAsUser(pkg, userId); |
| 547 | return r.getDimensionPixelSize(resId); |
| 548 | } catch (PackageManager.NameNotFoundException ex) { |
| 549 | // Uninstalled, don't care |
| 550 | } catch (Resources.NotFoundException e) { |
| 551 | // Invalid res id, return 0 and user our default |
| 552 | Log.e(TAG, "Couldn't find desired height res id", e); |
| 553 | } |
| 554 | } |
| 555 | return 0; |
| 556 | } |
Mady Mellor | dea7ecf | 2018-12-10 15:47:40 -0800 | [diff] [blame] | 557 | } |