Daniel Sandler | c4f2a56 | 2012-05-04 11:55:46 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 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.statusbar.phone; |
| 18 | |
Adrian Roos | 0bd8a4b | 2016-03-14 16:21:44 -0700 | [diff] [blame] | 19 | import android.annotation.ColorInt; |
| 20 | import android.annotation.DrawableRes; |
| 21 | import android.annotation.LayoutRes; |
John Spurlock | 257f283 | 2013-09-21 18:41:53 -0400 | [diff] [blame] | 22 | import android.app.StatusBarManager; |
Daniel Sandler | c4f2a56 | 2012-05-04 11:55:46 -0400 | [diff] [blame] | 23 | import android.content.Context; |
Adrian Roos | 0bd8a4b | 2016-03-14 16:21:44 -0700 | [diff] [blame] | 24 | import android.content.res.Configuration; |
Adrian Roos | 2f2bd9a | 2015-06-04 18:11:14 -0700 | [diff] [blame] | 25 | import android.content.res.TypedArray; |
Daniel Sandler | 198a030 | 2012-08-17 16:04:31 -0400 | [diff] [blame] | 26 | import android.graphics.Canvas; |
| 27 | import android.graphics.Paint; |
Selim Cinek | a0fad3b | 2014-09-19 17:20:05 +0200 | [diff] [blame] | 28 | import android.graphics.PorterDuff; |
| 29 | import android.graphics.PorterDuffXfermode; |
John Spurlock | fba9120 | 2014-04-22 12:58:26 -0400 | [diff] [blame] | 30 | import android.graphics.Rect; |
Adrian Roos | 0bd8a4b | 2016-03-14 16:21:44 -0700 | [diff] [blame] | 31 | import android.graphics.drawable.Drawable; |
Jaewan Kim | 5026936 | 2016-12-23 11:22:02 +0900 | [diff] [blame] | 32 | import android.media.AudioManager; |
John Spurlock | 0b99ea9 | 2014-10-01 15:32:22 -0400 | [diff] [blame] | 33 | import android.media.session.MediaSessionLegacyHelper; |
Adrian Roos | 0bd8a4b | 2016-03-14 16:21:44 -0700 | [diff] [blame] | 34 | import android.net.Uri; |
| 35 | import android.os.Bundle; |
Selim Cinek | a0fad3b | 2014-09-19 17:20:05 +0200 | [diff] [blame] | 36 | import android.os.IBinder; |
Adrian Roos | 8008bd1 | 2017-02-22 15:02:09 +0100 | [diff] [blame] | 37 | import android.os.SystemClock; |
Daniel Sandler | c4f2a56 | 2012-05-04 11:55:46 -0400 | [diff] [blame] | 38 | import android.util.AttributeSet; |
Adrian Roos | 0bd8a4b | 2016-03-14 16:21:44 -0700 | [diff] [blame] | 39 | import android.view.ActionMode; |
Selim Cinek | 48a92a5 | 2017-05-02 20:02:30 -0700 | [diff] [blame] | 40 | import android.view.InputDevice; |
Adrian Roos | 0bd8a4b | 2016-03-14 16:21:44 -0700 | [diff] [blame] | 41 | import android.view.InputQueue; |
Daniel Sandler | c4f2a56 | 2012-05-04 11:55:46 -0400 | [diff] [blame] | 42 | import android.view.KeyEvent; |
Adrian Roos | 0bd8a4b | 2016-03-14 16:21:44 -0700 | [diff] [blame] | 43 | import android.view.LayoutInflater; |
| 44 | import android.view.Menu; |
| 45 | import android.view.MenuItem; |
Chris Wren | 5de6e94 | 2012-05-16 14:22:21 -0400 | [diff] [blame] | 46 | import android.view.MotionEvent; |
Adrian Roos | 0bd8a4b | 2016-03-14 16:21:44 -0700 | [diff] [blame] | 47 | import android.view.SurfaceHolder; |
Daniel Sandler | b4e56ed | 2012-09-12 23:07:44 -0700 | [diff] [blame] | 48 | import android.view.View; |
Adrian Roos | 0bd8a4b | 2016-03-14 16:21:44 -0700 | [diff] [blame] | 49 | import android.view.ViewGroup; |
| 50 | import android.view.ViewTreeObserver; |
| 51 | import android.view.Window; |
Selim Cinek | a0fad3b | 2014-09-19 17:20:05 +0200 | [diff] [blame] | 52 | import android.view.WindowManager; |
| 53 | import android.view.WindowManagerGlobal; |
Daniel Sandler | c4f2a56 | 2012-05-04 11:55:46 -0400 | [diff] [blame] | 54 | import android.widget.FrameLayout; |
Daniel Sandler | c4f2a56 | 2012-05-04 11:55:46 -0400 | [diff] [blame] | 55 | |
Selim Cinek | f8c4add | 2017-06-08 09:54:58 -0700 | [diff] [blame] | 56 | import com.android.internal.annotations.VisibleForTesting; |
Adrian Roos | 0bd8a4b | 2016-03-14 16:21:44 -0700 | [diff] [blame] | 57 | import com.android.internal.view.FloatingActionMode; |
| 58 | import com.android.internal.widget.FloatingToolbar; |
Chris Wren | 5de6e94 | 2012-05-16 14:22:21 -0400 | [diff] [blame] | 59 | import com.android.systemui.R; |
Blazej Magnowski | 0e2ffbd | 2015-09-10 14:37:17 -0700 | [diff] [blame] | 60 | import com.android.systemui.classifier.FalsingManager; |
Jorim Jaggi | ecbab36 | 2014-04-23 16:13:15 +0200 | [diff] [blame] | 61 | import com.android.systemui.statusbar.DragDownHelper; |
| 62 | import com.android.systemui.statusbar.StatusBarState; |
Selim Cinek | fab078b | 2014-03-27 22:45:58 +0100 | [diff] [blame] | 63 | import com.android.systemui.statusbar.stack.NotificationStackScrollLayout; |
Chris Wren | 5de6e94 | 2012-05-16 14:22:21 -0400 | [diff] [blame] | 64 | |
Daniel Sandler | c4f2a56 | 2012-05-04 11:55:46 -0400 | [diff] [blame] | 65 | |
Jorim Jaggi | ecbab36 | 2014-04-23 16:13:15 +0200 | [diff] [blame] | 66 | public class StatusBarWindowView extends FrameLayout { |
Daniel Sandler | 198a030 | 2012-08-17 16:04:31 -0400 | [diff] [blame] | 67 | public static final String TAG = "StatusBarWindowView"; |
Jason Monk | 2a6ea9c | 2017-01-26 11:14:51 -0500 | [diff] [blame] | 68 | public static final boolean DEBUG = StatusBar.DEBUG; |
Chris Wren | 5de6e94 | 2012-05-16 14:22:21 -0400 | [diff] [blame] | 69 | |
Jorim Jaggi | ecbab36 | 2014-04-23 16:13:15 +0200 | [diff] [blame] | 70 | private DragDownHelper mDragDownHelper; |
Adrian Roos | 8008bd1 | 2017-02-22 15:02:09 +0100 | [diff] [blame] | 71 | private DoubleTapHelper mDoubleTapHelper; |
Selim Cinek | b6d85eb | 2014-03-28 20:21:01 +0100 | [diff] [blame] | 72 | private NotificationStackScrollLayout mStackScrollLayout; |
Daniel Sandler | b4e56ed | 2012-09-12 23:07:44 -0700 | [diff] [blame] | 73 | private NotificationPanelView mNotificationPanel; |
Adrian Roos | 9dc3209 | 2014-09-02 23:34:10 +0200 | [diff] [blame] | 74 | private View mBrightnessMirror; |
Chris Wren | 5de6e94 | 2012-05-16 14:22:21 -0400 | [diff] [blame] | 75 | |
Adrian Roos | 2f2bd9a | 2015-06-04 18:11:14 -0700 | [diff] [blame] | 76 | private int mRightInset = 0; |
Adrian Roos | 85d202b | 2016-06-02 16:27:47 -0700 | [diff] [blame] | 77 | private int mLeftInset = 0; |
Adrian Roos | 2f2bd9a | 2015-06-04 18:11:14 -0700 | [diff] [blame] | 78 | |
Jason Monk | 2a6ea9c | 2017-01-26 11:14:51 -0500 | [diff] [blame] | 79 | private StatusBar mService; |
Selim Cinek | a0fad3b | 2014-09-19 17:20:05 +0200 | [diff] [blame] | 80 | private final Paint mTransparentSrcPaint = new Paint(); |
Blazej Magnowski | 0e2ffbd | 2015-09-10 14:37:17 -0700 | [diff] [blame] | 81 | private FalsingManager mFalsingManager; |
Daniel Sandler | c4f2a56 | 2012-05-04 11:55:46 -0400 | [diff] [blame] | 82 | |
Adrian Roos | 0bd8a4b | 2016-03-14 16:21:44 -0700 | [diff] [blame] | 83 | // Implements the floating action mode for TextView's Cut/Copy/Past menu. Normally provided by |
| 84 | // DecorView, but since this is a special window we have to roll our own. |
| 85 | private View mFloatingActionModeOriginatingView; |
| 86 | private ActionMode mFloatingActionMode; |
| 87 | private FloatingToolbar mFloatingToolbar; |
| 88 | private ViewTreeObserver.OnPreDrawListener mFloatingToolbarPreDrawListener; |
Selim Cinek | 48a92a5 | 2017-05-02 20:02:30 -0700 | [diff] [blame] | 89 | private boolean mTouchCancelled; |
| 90 | private boolean mTouchActive; |
Adrian Roos | 0bd8a4b | 2016-03-14 16:21:44 -0700 | [diff] [blame] | 91 | |
Daniel Sandler | c4f2a56 | 2012-05-04 11:55:46 -0400 | [diff] [blame] | 92 | public StatusBarWindowView(Context context, AttributeSet attrs) { |
| 93 | super(context, attrs); |
Chris Wren | 5de6e94 | 2012-05-16 14:22:21 -0400 | [diff] [blame] | 94 | setMotionEventSplittingEnabled(false); |
Selim Cinek | a0fad3b | 2014-09-19 17:20:05 +0200 | [diff] [blame] | 95 | mTransparentSrcPaint.setColor(0); |
| 96 | mTransparentSrcPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC)); |
Blazej Magnowski | 0e2ffbd | 2015-09-10 14:37:17 -0700 | [diff] [blame] | 97 | mFalsingManager = FalsingManager.getInstance(context); |
Adrian Roos | 8008bd1 | 2017-02-22 15:02:09 +0100 | [diff] [blame] | 98 | mDoubleTapHelper = new DoubleTapHelper(this, active -> {}, () -> { |
| 99 | mService.wakeUpIfDozing(SystemClock.uptimeMillis(), this); |
| 100 | return true; |
| 101 | }, null, null); |
Chris Wren | 5de6e94 | 2012-05-16 14:22:21 -0400 | [diff] [blame] | 102 | } |
| 103 | |
| 104 | @Override |
John Spurlock | fba9120 | 2014-04-22 12:58:26 -0400 | [diff] [blame] | 105 | protected boolean fitSystemWindows(Rect insets) { |
| 106 | if (getFitsSystemWindows()) { |
Adrian Roos | 85d202b | 2016-06-02 16:27:47 -0700 | [diff] [blame] | 107 | boolean paddingChanged = insets.top != getPaddingTop() |
Jorim Jaggi | 416493b | 2014-09-13 03:57:32 +0200 | [diff] [blame] | 108 | || insets.bottom != getPaddingBottom(); |
Jorim Jaggi | aa80614 | 2015-05-20 18:04:16 -0700 | [diff] [blame] | 109 | |
Adrian Roos | 2f2bd9a | 2015-06-04 18:11:14 -0700 | [diff] [blame] | 110 | // Super-special right inset handling, because scrims and backdrop need to ignore it. |
Adrian Roos | 85d202b | 2016-06-02 16:27:47 -0700 | [diff] [blame] | 111 | if (insets.right != mRightInset || insets.left != mLeftInset) { |
Adrian Roos | 2f2bd9a | 2015-06-04 18:11:14 -0700 | [diff] [blame] | 112 | mRightInset = insets.right; |
Adrian Roos | 85d202b | 2016-06-02 16:27:47 -0700 | [diff] [blame] | 113 | mLeftInset = insets.left; |
Adrian Roos | 2f2bd9a | 2015-06-04 18:11:14 -0700 | [diff] [blame] | 114 | applyMargins(); |
| 115 | } |
Adrian Roos | 85d202b | 2016-06-02 16:27:47 -0700 | [diff] [blame] | 116 | // Drop top inset, and pass through bottom inset. |
Adrian Roos | 2f2bd9a | 2015-06-04 18:11:14 -0700 | [diff] [blame] | 117 | if (paddingChanged) { |
Adrian Roos | 85d202b | 2016-06-02 16:27:47 -0700 | [diff] [blame] | 118 | setPadding(0, 0, 0, 0); |
Jorim Jaggi | 416493b | 2014-09-13 03:57:32 +0200 | [diff] [blame] | 119 | } |
Jorim Jaggi | d7daab7 | 2014-05-06 22:22:20 +0200 | [diff] [blame] | 120 | insets.left = 0; |
| 121 | insets.top = 0; |
| 122 | insets.right = 0; |
John Spurlock | fba9120 | 2014-04-22 12:58:26 -0400 | [diff] [blame] | 123 | } else { |
Adrian Roos | 85d202b | 2016-06-02 16:27:47 -0700 | [diff] [blame] | 124 | if (mRightInset != 0 || mLeftInset != 0) { |
Adrian Roos | e49e409 | 2015-06-10 18:50:18 -0700 | [diff] [blame] | 125 | mRightInset = 0; |
Adrian Roos | 85d202b | 2016-06-02 16:27:47 -0700 | [diff] [blame] | 126 | mLeftInset = 0; |
Adrian Roos | e49e409 | 2015-06-10 18:50:18 -0700 | [diff] [blame] | 127 | applyMargins(); |
| 128 | } |
Jorim Jaggi | 416493b | 2014-09-13 03:57:32 +0200 | [diff] [blame] | 129 | boolean changed = getPaddingLeft() != 0 |
| 130 | || getPaddingRight() != 0 |
| 131 | || getPaddingTop() != 0 |
| 132 | || getPaddingBottom() != 0; |
| 133 | if (changed) { |
| 134 | setPadding(0, 0, 0, 0); |
| 135 | } |
Jorim Jaggi | aa80614 | 2015-05-20 18:04:16 -0700 | [diff] [blame] | 136 | insets.top = 0; |
John Spurlock | fba9120 | 2014-04-22 12:58:26 -0400 | [diff] [blame] | 137 | } |
Jorim Jaggi | d7daab7 | 2014-05-06 22:22:20 +0200 | [diff] [blame] | 138 | return false; |
John Spurlock | fba9120 | 2014-04-22 12:58:26 -0400 | [diff] [blame] | 139 | } |
| 140 | |
Adrian Roos | 2f2bd9a | 2015-06-04 18:11:14 -0700 | [diff] [blame] | 141 | private void applyMargins() { |
| 142 | final int N = getChildCount(); |
| 143 | for (int i = 0; i < N; i++) { |
| 144 | View child = getChildAt(i); |
| 145 | if (child.getLayoutParams() instanceof LayoutParams) { |
| 146 | LayoutParams lp = (LayoutParams) child.getLayoutParams(); |
Adrian Roos | 85d202b | 2016-06-02 16:27:47 -0700 | [diff] [blame] | 147 | if (!lp.ignoreRightInset |
| 148 | && (lp.rightMargin != mRightInset || lp.leftMargin != mLeftInset)) { |
Adrian Roos | 2f2bd9a | 2015-06-04 18:11:14 -0700 | [diff] [blame] | 149 | lp.rightMargin = mRightInset; |
Adrian Roos | 85d202b | 2016-06-02 16:27:47 -0700 | [diff] [blame] | 150 | lp.leftMargin = mLeftInset; |
Adrian Roos | 2f2bd9a | 2015-06-04 18:11:14 -0700 | [diff] [blame] | 151 | child.requestLayout(); |
| 152 | } |
| 153 | } |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | @Override |
| 158 | public FrameLayout.LayoutParams generateLayoutParams(AttributeSet attrs) { |
| 159 | return new LayoutParams(getContext(), attrs); |
| 160 | } |
| 161 | |
| 162 | @Override |
| 163 | protected FrameLayout.LayoutParams generateDefaultLayoutParams() { |
| 164 | return new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); |
| 165 | } |
| 166 | |
John Spurlock | fba9120 | 2014-04-22 12:58:26 -0400 | [diff] [blame] | 167 | @Override |
Selim Cinek | 4e6b2d3 | 2015-06-25 20:15:33 -0400 | [diff] [blame] | 168 | protected void onFinishInflate() { |
| 169 | super.onFinishInflate(); |
Selim Cinek | b6d85eb | 2014-03-28 20:21:01 +0100 | [diff] [blame] | 170 | mStackScrollLayout = (NotificationStackScrollLayout) findViewById( |
| 171 | R.id.notification_stack_scroller); |
Daniel Sandler | b4e56ed | 2012-09-12 23:07:44 -0700 | [diff] [blame] | 172 | mNotificationPanel = (NotificationPanelView) findViewById(R.id.notification_panel); |
Adrian Roos | 9dc3209 | 2014-09-02 23:34:10 +0200 | [diff] [blame] | 173 | mBrightnessMirror = findViewById(R.id.brightness_mirror); |
Selim Cinek | 4e6b2d3 | 2015-06-25 20:15:33 -0400 | [diff] [blame] | 174 | } |
| 175 | |
dooyoung.hwang | e4b841e | 2016-11-16 08:59:23 +0900 | [diff] [blame] | 176 | @Override |
| 177 | public void onViewAdded(View child) { |
| 178 | super.onViewAdded(child); |
| 179 | if (child.getId() == R.id.brightness_mirror) { |
| 180 | mBrightnessMirror = child; |
| 181 | } |
| 182 | } |
| 183 | |
Jason Monk | 2a6ea9c | 2017-01-26 11:14:51 -0500 | [diff] [blame] | 184 | public void setService(StatusBar service) { |
Selim Cinek | 4e6b2d3 | 2015-06-25 20:15:33 -0400 | [diff] [blame] | 185 | mService = service; |
Selim Cinek | f8c4add | 2017-06-08 09:54:58 -0700 | [diff] [blame] | 186 | setDragDownHelper(new DragDownHelper(getContext(), this, mStackScrollLayout, mService)); |
| 187 | } |
| 188 | |
| 189 | @VisibleForTesting |
| 190 | void setDragDownHelper(DragDownHelper dragDownHelper) { |
| 191 | mDragDownHelper = dragDownHelper; |
Selim Cinek | 4e6b2d3 | 2015-06-25 20:15:33 -0400 | [diff] [blame] | 192 | } |
| 193 | |
| 194 | @Override |
| 195 | protected void onAttachedToWindow () { |
| 196 | super.onAttachedToWindow(); |
Daniel Sandler | b10d885 | 2013-05-08 15:57:06 -0400 | [diff] [blame] | 197 | |
Selim Cinek | a0fad3b | 2014-09-19 17:20:05 +0200 | [diff] [blame] | 198 | // We need to ensure that our window doesn't suffer from overdraw which would normally |
| 199 | // occur if our window is translucent. Since we are drawing the whole window anyway with |
| 200 | // the scrim, we don't need the window to be cleared in the beginning. |
Jorim Jaggi | 0e66439 | 2014-09-27 01:30:22 +0200 | [diff] [blame] | 201 | if (mService.isScrimSrcModeEnabled()) { |
| 202 | IBinder windowToken = getWindowToken(); |
| 203 | WindowManager.LayoutParams lp = (WindowManager.LayoutParams) getLayoutParams(); |
| 204 | lp.token = windowToken; |
| 205 | setLayoutParams(lp); |
| 206 | WindowManagerGlobal.getInstance().changeCanvasOpacity(windowToken, true); |
| 207 | setWillNotDraw(false); |
| 208 | } else { |
| 209 | setWillNotDraw(!DEBUG); |
| 210 | } |
Daniel Sandler | c4f2a56 | 2012-05-04 11:55:46 -0400 | [diff] [blame] | 211 | } |
| 212 | |
| 213 | @Override |
| 214 | public boolean dispatchKeyEvent(KeyEvent event) { |
Adrian Roos | 56cf73a | 2016-07-18 14:23:32 -0700 | [diff] [blame] | 215 | if (mService.interceptMediaKey(event)) { |
| 216 | return true; |
| 217 | } |
| 218 | if (super.dispatchKeyEvent(event)) { |
| 219 | return true; |
| 220 | } |
Daniel Sandler | c4f2a56 | 2012-05-04 11:55:46 -0400 | [diff] [blame] | 221 | boolean down = event.getAction() == KeyEvent.ACTION_DOWN; |
| 222 | switch (event.getKeyCode()) { |
Jorim Jaggi | 8c8bcc1 | 2014-04-16 21:36:51 +0200 | [diff] [blame] | 223 | case KeyEvent.KEYCODE_BACK: |
| 224 | if (!down) { |
| 225 | mService.onBackPressed(); |
| 226 | } |
| 227 | return true; |
| 228 | case KeyEvent.KEYCODE_MENU: |
| 229 | if (!down) { |
| 230 | return mService.onMenuPressed(); |
| 231 | } |
Jorim Jaggi | 3425076 | 2014-07-03 23:51:19 +0200 | [diff] [blame] | 232 | case KeyEvent.KEYCODE_SPACE: |
| 233 | if (!down) { |
| 234 | return mService.onSpacePressed(); |
| 235 | } |
John Spurlock | 0b99ea9 | 2014-10-01 15:32:22 -0400 | [diff] [blame] | 236 | break; |
John Spurlock | d06aa57 | 2014-09-10 10:40:49 -0400 | [diff] [blame] | 237 | case KeyEvent.KEYCODE_VOLUME_DOWN: |
| 238 | case KeyEvent.KEYCODE_VOLUME_UP: |
John Spurlock | 0b99ea9 | 2014-10-01 15:32:22 -0400 | [diff] [blame] | 239 | if (mService.isDozing()) { |
Jaewan Kim | 5026936 | 2016-12-23 11:22:02 +0900 | [diff] [blame] | 240 | MediaSessionLegacyHelper.getHelper(mContext).sendVolumeKeyEvent( |
| 241 | event, AudioManager.USE_DEFAULT_STREAM_TYPE, true); |
John Spurlock | 0b99ea9 | 2014-10-01 15:32:22 -0400 | [diff] [blame] | 242 | return true; |
John Spurlock | d06aa57 | 2014-09-10 10:40:49 -0400 | [diff] [blame] | 243 | } |
John Spurlock | 0b99ea9 | 2014-10-01 15:32:22 -0400 | [diff] [blame] | 244 | break; |
Daniel Sandler | c4f2a56 | 2012-05-04 11:55:46 -0400 | [diff] [blame] | 245 | } |
Adrian Roos | 56cf73a | 2016-07-18 14:23:32 -0700 | [diff] [blame] | 246 | return false; |
Daniel Sandler | c4f2a56 | 2012-05-04 11:55:46 -0400 | [diff] [blame] | 247 | } |
Chris Wren | 5de6e94 | 2012-05-16 14:22:21 -0400 | [diff] [blame] | 248 | |
Selim Cinek | d95ca7c | 2017-07-26 12:20:38 -0700 | [diff] [blame] | 249 | public void setTouchActive(boolean touchActive) { |
| 250 | mTouchActive = touchActive; |
Selim Cinek | d95ca7c | 2017-07-26 12:20:38 -0700 | [diff] [blame] | 251 | } |
| 252 | |
Chris Wren | 5de6e94 | 2012-05-16 14:22:21 -0400 | [diff] [blame] | 253 | @Override |
Adrian Roos | 9dc3209 | 2014-09-02 23:34:10 +0200 | [diff] [blame] | 254 | public boolean dispatchTouchEvent(MotionEvent ev) { |
Selim Cinek | 48a92a5 | 2017-05-02 20:02:30 -0700 | [diff] [blame] | 255 | boolean isDown = ev.getActionMasked() == MotionEvent.ACTION_DOWN; |
Adrian Roos | a6c03f8 | 2017-07-26 16:20:30 +0200 | [diff] [blame] | 256 | boolean isCancel = ev.getActionMasked() == MotionEvent.ACTION_CANCEL; |
| 257 | if (!isCancel && mService.shouldIgnoreTouch()) { |
| 258 | return false; |
| 259 | } |
Selim Cinek | 48a92a5 | 2017-05-02 20:02:30 -0700 | [diff] [blame] | 260 | if (isDown && mNotificationPanel.isFullyCollapsed()) { |
Jorim Jaggi | e05256e | 2016-09-08 14:58:20 -0700 | [diff] [blame] | 261 | mNotificationPanel.startExpandLatencyTracking(); |
| 262 | } |
Selim Cinek | 48a92a5 | 2017-05-02 20:02:30 -0700 | [diff] [blame] | 263 | if (isDown) { |
Selim Cinek | d95ca7c | 2017-07-26 12:20:38 -0700 | [diff] [blame] | 264 | setTouchActive(true); |
Selim Cinek | 48a92a5 | 2017-05-02 20:02:30 -0700 | [diff] [blame] | 265 | mTouchCancelled = false; |
| 266 | } else if (ev.getActionMasked() == MotionEvent.ACTION_UP |
| 267 | || ev.getActionMasked() == MotionEvent.ACTION_CANCEL) { |
Selim Cinek | d95ca7c | 2017-07-26 12:20:38 -0700 | [diff] [blame] | 268 | setTouchActive(false); |
Selim Cinek | 48a92a5 | 2017-05-02 20:02:30 -0700 | [diff] [blame] | 269 | } |
| 270 | if (mTouchCancelled) { |
| 271 | return false; |
| 272 | } |
Blazej Magnowski | 0e2ffbd | 2015-09-10 14:37:17 -0700 | [diff] [blame] | 273 | mFalsingManager.onTouchEvent(ev, getWidth(), getHeight()); |
Adrian Roos | 9dc3209 | 2014-09-02 23:34:10 +0200 | [diff] [blame] | 274 | if (mBrightnessMirror != null && mBrightnessMirror.getVisibility() == VISIBLE) { |
| 275 | // Disallow new pointers while the brightness mirror is visible. This is so that you |
| 276 | // can't touch anything other than the brightness slider while the mirror is showing |
| 277 | // and the rest of the panel is transparent. |
| 278 | if (ev.getActionMasked() == MotionEvent.ACTION_POINTER_DOWN) { |
| 279 | return false; |
| 280 | } |
| 281 | } |
Selim Cinek | 48a92a5 | 2017-05-02 20:02:30 -0700 | [diff] [blame] | 282 | if (isDown) { |
Mady Mellor | 7a9b2a6 | 2016-03-23 07:41:47 -0700 | [diff] [blame] | 283 | mStackScrollLayout.closeControlsIfOutsideTouch(ev); |
| 284 | } |
Adrian Roos | 67cca74 | 2017-04-13 16:52:51 -0700 | [diff] [blame] | 285 | if (mService.isDozing()) { |
| 286 | mService.mDozeScrimController.extendPulse(); |
| 287 | } |
Mady Mellor | 7a9b2a6 | 2016-03-23 07:41:47 -0700 | [diff] [blame] | 288 | |
Adrian Roos | 9dc3209 | 2014-09-02 23:34:10 +0200 | [diff] [blame] | 289 | return super.dispatchTouchEvent(ev); |
| 290 | } |
| 291 | |
| 292 | @Override |
Chris Wren | 5de6e94 | 2012-05-16 14:22:21 -0400 | [diff] [blame] | 293 | public boolean onInterceptTouchEvent(MotionEvent ev) { |
Selim Cinek | be2c443 | 2017-05-30 12:11:09 -0700 | [diff] [blame] | 294 | if (mService.isDozing() && !mStackScrollLayout.hasPulsingNotifications()) { |
Adrian Roos | 8008bd1 | 2017-02-22 15:02:09 +0100 | [diff] [blame] | 295 | // Capture all touch events in always-on. |
Adrian Roos | ebea7a7 | 2016-10-26 12:51:26 -0700 | [diff] [blame] | 296 | return true; |
| 297 | } |
Daniel Sandler | b4e56ed | 2012-09-12 23:07:44 -0700 | [diff] [blame] | 298 | boolean intercept = false; |
Selim Cinek | fab078b | 2014-03-27 22:45:58 +0100 | [diff] [blame] | 299 | if (mNotificationPanel.isFullyExpanded() |
Jorim Jaggi | 03c701e | 2014-04-02 12:39:51 +0200 | [diff] [blame] | 300 | && mStackScrollLayout.getVisibility() == View.VISIBLE |
Jorim Jaggi | 4222d9a | 2014-04-23 16:13:15 +0200 | [diff] [blame] | 301 | && mService.getBarState() == StatusBarState.KEYGUARD |
Adrian Roos | 500263a | 2017-01-23 14:49:54 -0800 | [diff] [blame] | 302 | && !mService.isBouncerShowing() |
| 303 | && !mService.isDozing()) { |
Jorim Jaggi | ecbab36 | 2014-04-23 16:13:15 +0200 | [diff] [blame] | 304 | intercept = mDragDownHelper.onInterceptTouchEvent(ev); |
Daniel Sandler | b4e56ed | 2012-09-12 23:07:44 -0700 | [diff] [blame] | 305 | } |
| 306 | if (!intercept) { |
| 307 | super.onInterceptTouchEvent(ev); |
| 308 | } |
Chris Wren | 5de6e94 | 2012-05-16 14:22:21 -0400 | [diff] [blame] | 309 | if (intercept) { |
Dianne Hackborn | a4b7f2f | 2012-05-21 11:28:41 -0700 | [diff] [blame] | 310 | MotionEvent cancellation = MotionEvent.obtain(ev); |
| 311 | cancellation.setAction(MotionEvent.ACTION_CANCEL); |
Selim Cinek | b6d85eb | 2014-03-28 20:21:01 +0100 | [diff] [blame] | 312 | mStackScrollLayout.onInterceptTouchEvent(cancellation); |
Selim Cinek | 31094df | 2014-08-14 19:28:15 +0200 | [diff] [blame] | 313 | mNotificationPanel.onInterceptTouchEvent(cancellation); |
Dianne Hackborn | a4b7f2f | 2012-05-21 11:28:41 -0700 | [diff] [blame] | 314 | cancellation.recycle(); |
Chris Wren | 5de6e94 | 2012-05-16 14:22:21 -0400 | [diff] [blame] | 315 | } |
| 316 | return intercept; |
| 317 | } |
| 318 | |
| 319 | @Override |
| 320 | public boolean onTouchEvent(MotionEvent ev) { |
Adrian Roos | 8008bd1 | 2017-02-22 15:02:09 +0100 | [diff] [blame] | 321 | boolean handled = false; |
| 322 | if (mService.isDozing()) { |
| 323 | mDoubleTapHelper.onTouchEvent(ev); |
| 324 | handled = true; |
| 325 | } |
Selim Cinek | f8c4add | 2017-06-08 09:54:58 -0700 | [diff] [blame] | 326 | if ((mService.getBarState() == StatusBarState.KEYGUARD && !handled) |
| 327 | || mDragDownHelper.isDraggingDown()) { |
Selim Cinek | 740c111 | 2016-12-22 16:39:54 +0100 | [diff] [blame] | 328 | // we still want to finish our drag down gesture when locking the screen |
Jorim Jaggi | ecbab36 | 2014-04-23 16:13:15 +0200 | [diff] [blame] | 329 | handled = mDragDownHelper.onTouchEvent(ev); |
Daniel Sandler | b4e56ed | 2012-09-12 23:07:44 -0700 | [diff] [blame] | 330 | } |
| 331 | if (!handled) { |
| 332 | handled = super.onTouchEvent(ev); |
| 333 | } |
John Spurlock | 257f283 | 2013-09-21 18:41:53 -0400 | [diff] [blame] | 334 | final int action = ev.getAction(); |
John Spurlock | d157ca0 | 2013-11-04 10:28:05 -0500 | [diff] [blame] | 335 | if (!handled && (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL)) { |
John Spurlock | 257f283 | 2013-09-21 18:41:53 -0400 | [diff] [blame] | 336 | mService.setInteracting(StatusBarManager.WINDOW_STATUS_BAR, false); |
| 337 | } |
Chris Wren | 5de6e94 | 2012-05-16 14:22:21 -0400 | [diff] [blame] | 338 | return handled; |
| 339 | } |
Daniel Sandler | 198a030 | 2012-08-17 16:04:31 -0400 | [diff] [blame] | 340 | |
| 341 | @Override |
| 342 | public void onDraw(Canvas canvas) { |
| 343 | super.onDraw(canvas); |
Jorim Jaggi | 0e66439 | 2014-09-27 01:30:22 +0200 | [diff] [blame] | 344 | if (mService.isScrimSrcModeEnabled()) { |
| 345 | // We need to ensure that our window is always drawn fully even when we have paddings, |
| 346 | // since we simulate it to be opaque. |
| 347 | int paddedBottom = getHeight() - getPaddingBottom(); |
| 348 | int paddedRight = getWidth() - getPaddingRight(); |
| 349 | if (getPaddingTop() != 0) { |
| 350 | canvas.drawRect(0, 0, getWidth(), getPaddingTop(), mTransparentSrcPaint); |
| 351 | } |
| 352 | if (getPaddingBottom() != 0) { |
| 353 | canvas.drawRect(0, paddedBottom, getWidth(), getHeight(), mTransparentSrcPaint); |
| 354 | } |
| 355 | if (getPaddingLeft() != 0) { |
| 356 | canvas.drawRect(0, getPaddingTop(), getPaddingLeft(), paddedBottom, |
| 357 | mTransparentSrcPaint); |
| 358 | } |
| 359 | if (getPaddingRight() != 0) { |
| 360 | canvas.drawRect(paddedRight, getPaddingTop(), getWidth(), paddedBottom, |
| 361 | mTransparentSrcPaint); |
| 362 | } |
Selim Cinek | a0fad3b | 2014-09-19 17:20:05 +0200 | [diff] [blame] | 363 | } |
Daniel Sandler | 198a030 | 2012-08-17 16:04:31 -0400 | [diff] [blame] | 364 | if (DEBUG) { |
| 365 | Paint pt = new Paint(); |
| 366 | pt.setColor(0x80FFFF00); |
| 367 | pt.setStrokeWidth(12.0f); |
| 368 | pt.setStyle(Paint.Style.STROKE); |
| 369 | canvas.drawRect(0, 0, canvas.getWidth(), canvas.getHeight(), pt); |
| 370 | } |
| 371 | } |
Daniel Sandler | ac47ff7 | 2012-10-23 10:41:44 -0400 | [diff] [blame] | 372 | |
| 373 | public void cancelExpandHelper() { |
Selim Cinek | 1408eb5 | 2014-06-02 14:45:38 +0200 | [diff] [blame] | 374 | if (mStackScrollLayout != null) { |
| 375 | mStackScrollLayout.cancelExpandHelper(); |
Daniel Sandler | 1a3bdd5 | 2012-10-23 19:21:20 -0400 | [diff] [blame] | 376 | } |
Daniel Sandler | ac47ff7 | 2012-10-23 10:41:44 -0400 | [diff] [blame] | 377 | } |
Adrian Roos | 2f2bd9a | 2015-06-04 18:11:14 -0700 | [diff] [blame] | 378 | |
Selim Cinek | 48a92a5 | 2017-05-02 20:02:30 -0700 | [diff] [blame] | 379 | public void cancelCurrentTouch() { |
| 380 | if (mTouchActive) { |
| 381 | final long now = SystemClock.uptimeMillis(); |
| 382 | MotionEvent event = MotionEvent.obtain(now, now, |
| 383 | MotionEvent.ACTION_CANCEL, 0.0f, 0.0f, 0); |
| 384 | event.setSource(InputDevice.SOURCE_TOUCHSCREEN); |
| 385 | dispatchTouchEvent(event); |
| 386 | event.recycle(); |
| 387 | mTouchCancelled = true; |
| 388 | } |
| 389 | } |
| 390 | |
Adrian Roos | 2f2bd9a | 2015-06-04 18:11:14 -0700 | [diff] [blame] | 391 | public class LayoutParams extends FrameLayout.LayoutParams { |
| 392 | |
| 393 | public boolean ignoreRightInset; |
| 394 | |
| 395 | public LayoutParams(int width, int height) { |
| 396 | super(width, height); |
| 397 | } |
| 398 | |
| 399 | public LayoutParams(Context c, AttributeSet attrs) { |
| 400 | super(c, attrs); |
| 401 | |
| 402 | TypedArray a = c.obtainStyledAttributes(attrs, R.styleable.StatusBarWindowView_Layout); |
| 403 | ignoreRightInset = a.getBoolean( |
| 404 | R.styleable.StatusBarWindowView_Layout_ignoreRightInset, false); |
| 405 | a.recycle(); |
| 406 | } |
| 407 | } |
Adrian Roos | 0bd8a4b | 2016-03-14 16:21:44 -0700 | [diff] [blame] | 408 | |
| 409 | @Override |
| 410 | public ActionMode startActionModeForChild(View originalView, ActionMode.Callback callback, |
| 411 | int type) { |
| 412 | if (type == ActionMode.TYPE_FLOATING) { |
| 413 | return startActionMode(originalView, callback, type); |
| 414 | } |
| 415 | return super.startActionModeForChild(originalView, callback, type); |
| 416 | } |
| 417 | |
| 418 | private ActionMode createFloatingActionMode( |
| 419 | View originatingView, ActionMode.Callback2 callback) { |
| 420 | if (mFloatingActionMode != null) { |
| 421 | mFloatingActionMode.finish(); |
| 422 | } |
| 423 | cleanupFloatingActionModeViews(); |
Tarandeep Singh | c9c83a9 | 2017-08-29 14:39:22 -0700 | [diff] [blame] | 424 | mFloatingToolbar = new FloatingToolbar(mFakeWindow); |
Adrian Roos | 0bd8a4b | 2016-03-14 16:21:44 -0700 | [diff] [blame] | 425 | final FloatingActionMode mode = |
Abodunrinwa Toki | 17293cc | 2017-05-22 14:16:04 +0100 | [diff] [blame] | 426 | new FloatingActionMode(mContext, callback, originatingView, mFloatingToolbar); |
Adrian Roos | 0bd8a4b | 2016-03-14 16:21:44 -0700 | [diff] [blame] | 427 | mFloatingActionModeOriginatingView = originatingView; |
| 428 | mFloatingToolbarPreDrawListener = |
| 429 | new ViewTreeObserver.OnPreDrawListener() { |
| 430 | @Override |
| 431 | public boolean onPreDraw() { |
| 432 | mode.updateViewLocationInWindow(); |
| 433 | return true; |
| 434 | } |
| 435 | }; |
| 436 | return mode; |
| 437 | } |
| 438 | |
| 439 | private void setHandledFloatingActionMode(ActionMode mode) { |
| 440 | mFloatingActionMode = mode; |
Adrian Roos | 0bd8a4b | 2016-03-14 16:21:44 -0700 | [diff] [blame] | 441 | mFloatingActionMode.invalidate(); // Will show the floating toolbar if necessary. |
| 442 | mFloatingActionModeOriginatingView.getViewTreeObserver() |
| 443 | .addOnPreDrawListener(mFloatingToolbarPreDrawListener); |
| 444 | } |
| 445 | |
| 446 | private void cleanupFloatingActionModeViews() { |
| 447 | if (mFloatingToolbar != null) { |
| 448 | mFloatingToolbar.dismiss(); |
| 449 | mFloatingToolbar = null; |
| 450 | } |
| 451 | if (mFloatingActionModeOriginatingView != null) { |
| 452 | if (mFloatingToolbarPreDrawListener != null) { |
| 453 | mFloatingActionModeOriginatingView.getViewTreeObserver() |
| 454 | .removeOnPreDrawListener(mFloatingToolbarPreDrawListener); |
| 455 | mFloatingToolbarPreDrawListener = null; |
| 456 | } |
| 457 | mFloatingActionModeOriginatingView = null; |
| 458 | } |
| 459 | } |
| 460 | |
| 461 | private ActionMode startActionMode( |
| 462 | View originatingView, ActionMode.Callback callback, int type) { |
| 463 | ActionMode.Callback2 wrappedCallback = new ActionModeCallback2Wrapper(callback); |
| 464 | ActionMode mode = createFloatingActionMode(originatingView, wrappedCallback); |
| 465 | if (mode != null && wrappedCallback.onCreateActionMode(mode, mode.getMenu())) { |
| 466 | setHandledFloatingActionMode(mode); |
| 467 | } else { |
| 468 | mode = null; |
| 469 | } |
| 470 | return mode; |
| 471 | } |
| 472 | |
| 473 | private class ActionModeCallback2Wrapper extends ActionMode.Callback2 { |
| 474 | private final ActionMode.Callback mWrapped; |
| 475 | |
| 476 | public ActionModeCallback2Wrapper(ActionMode.Callback wrapped) { |
| 477 | mWrapped = wrapped; |
| 478 | } |
| 479 | |
| 480 | public boolean onCreateActionMode(ActionMode mode, Menu menu) { |
| 481 | return mWrapped.onCreateActionMode(mode, menu); |
| 482 | } |
| 483 | |
| 484 | public boolean onPrepareActionMode(ActionMode mode, Menu menu) { |
| 485 | requestFitSystemWindows(); |
| 486 | return mWrapped.onPrepareActionMode(mode, menu); |
| 487 | } |
| 488 | |
| 489 | public boolean onActionItemClicked(ActionMode mode, MenuItem item) { |
| 490 | return mWrapped.onActionItemClicked(mode, item); |
| 491 | } |
| 492 | |
| 493 | public void onDestroyActionMode(ActionMode mode) { |
| 494 | mWrapped.onDestroyActionMode(mode); |
| 495 | if (mode == mFloatingActionMode) { |
| 496 | cleanupFloatingActionModeViews(); |
| 497 | mFloatingActionMode = null; |
| 498 | } |
| 499 | requestFitSystemWindows(); |
| 500 | } |
| 501 | |
| 502 | @Override |
| 503 | public void onGetContentRect(ActionMode mode, View view, Rect outRect) { |
| 504 | if (mWrapped instanceof ActionMode.Callback2) { |
| 505 | ((ActionMode.Callback2) mWrapped).onGetContentRect(mode, view, outRect); |
| 506 | } else { |
| 507 | super.onGetContentRect(mode, view, outRect); |
| 508 | } |
| 509 | } |
| 510 | } |
| 511 | |
| 512 | /** |
| 513 | * Minimal window to satisfy FloatingToolbar. |
| 514 | */ |
| 515 | private Window mFakeWindow = new Window(mContext) { |
| 516 | @Override |
| 517 | public void takeSurface(SurfaceHolder.Callback2 callback) { |
| 518 | } |
| 519 | |
| 520 | @Override |
| 521 | public void takeInputQueue(InputQueue.Callback callback) { |
| 522 | } |
| 523 | |
| 524 | @Override |
| 525 | public boolean isFloating() { |
| 526 | return false; |
| 527 | } |
| 528 | |
| 529 | @Override |
| 530 | public void alwaysReadCloseOnTouchAttr() { |
| 531 | } |
| 532 | |
| 533 | @Override |
| 534 | public void setContentView(@LayoutRes int layoutResID) { |
| 535 | } |
| 536 | |
| 537 | @Override |
| 538 | public void setContentView(View view) { |
| 539 | } |
| 540 | |
| 541 | @Override |
| 542 | public void setContentView(View view, ViewGroup.LayoutParams params) { |
| 543 | } |
| 544 | |
| 545 | @Override |
| 546 | public void addContentView(View view, ViewGroup.LayoutParams params) { |
| 547 | } |
| 548 | |
| 549 | @Override |
| 550 | public void clearContentView() { |
| 551 | } |
| 552 | |
| 553 | @Override |
| 554 | public View getCurrentFocus() { |
| 555 | return null; |
| 556 | } |
| 557 | |
| 558 | @Override |
| 559 | public LayoutInflater getLayoutInflater() { |
| 560 | return null; |
| 561 | } |
| 562 | |
| 563 | @Override |
| 564 | public void setTitle(CharSequence title) { |
| 565 | } |
| 566 | |
| 567 | @Override |
| 568 | public void setTitleColor(@ColorInt int textColor) { |
| 569 | } |
| 570 | |
| 571 | @Override |
| 572 | public void openPanel(int featureId, KeyEvent event) { |
| 573 | } |
| 574 | |
| 575 | @Override |
| 576 | public void closePanel(int featureId) { |
| 577 | } |
| 578 | |
| 579 | @Override |
| 580 | public void togglePanel(int featureId, KeyEvent event) { |
| 581 | } |
| 582 | |
| 583 | @Override |
| 584 | public void invalidatePanelMenu(int featureId) { |
| 585 | } |
| 586 | |
| 587 | @Override |
| 588 | public boolean performPanelShortcut(int featureId, int keyCode, KeyEvent event, int flags) { |
| 589 | return false; |
| 590 | } |
| 591 | |
| 592 | @Override |
| 593 | public boolean performPanelIdentifierAction(int featureId, int id, int flags) { |
| 594 | return false; |
| 595 | } |
| 596 | |
| 597 | @Override |
| 598 | public void closeAllPanels() { |
| 599 | } |
| 600 | |
| 601 | @Override |
| 602 | public boolean performContextMenuIdentifierAction(int id, int flags) { |
| 603 | return false; |
| 604 | } |
| 605 | |
| 606 | @Override |
| 607 | public void onConfigurationChanged(Configuration newConfig) { |
| 608 | } |
| 609 | |
| 610 | @Override |
| 611 | public void setBackgroundDrawable(Drawable drawable) { |
| 612 | } |
| 613 | |
| 614 | @Override |
| 615 | public void setFeatureDrawableResource(int featureId, @DrawableRes int resId) { |
| 616 | } |
| 617 | |
| 618 | @Override |
| 619 | public void setFeatureDrawableUri(int featureId, Uri uri) { |
| 620 | } |
| 621 | |
| 622 | @Override |
| 623 | public void setFeatureDrawable(int featureId, Drawable drawable) { |
| 624 | } |
| 625 | |
| 626 | @Override |
| 627 | public void setFeatureDrawableAlpha(int featureId, int alpha) { |
| 628 | } |
| 629 | |
| 630 | @Override |
| 631 | public void setFeatureInt(int featureId, int value) { |
| 632 | } |
| 633 | |
| 634 | @Override |
| 635 | public void takeKeyEvents(boolean get) { |
| 636 | } |
| 637 | |
| 638 | @Override |
| 639 | public boolean superDispatchKeyEvent(KeyEvent event) { |
| 640 | return false; |
| 641 | } |
| 642 | |
| 643 | @Override |
| 644 | public boolean superDispatchKeyShortcutEvent(KeyEvent event) { |
| 645 | return false; |
| 646 | } |
| 647 | |
| 648 | @Override |
| 649 | public boolean superDispatchTouchEvent(MotionEvent event) { |
| 650 | return false; |
| 651 | } |
| 652 | |
| 653 | @Override |
| 654 | public boolean superDispatchTrackballEvent(MotionEvent event) { |
| 655 | return false; |
| 656 | } |
| 657 | |
| 658 | @Override |
| 659 | public boolean superDispatchGenericMotionEvent(MotionEvent event) { |
| 660 | return false; |
| 661 | } |
| 662 | |
| 663 | @Override |
| 664 | public View getDecorView() { |
| 665 | return StatusBarWindowView.this; |
| 666 | } |
| 667 | |
| 668 | @Override |
| 669 | public View peekDecorView() { |
| 670 | return null; |
| 671 | } |
| 672 | |
| 673 | @Override |
| 674 | public Bundle saveHierarchyState() { |
| 675 | return null; |
| 676 | } |
| 677 | |
| 678 | @Override |
| 679 | public void restoreHierarchyState(Bundle savedInstanceState) { |
| 680 | } |
| 681 | |
| 682 | @Override |
| 683 | protected void onActive() { |
| 684 | } |
| 685 | |
| 686 | @Override |
| 687 | public void setChildDrawable(int featureId, Drawable drawable) { |
| 688 | } |
| 689 | |
| 690 | @Override |
| 691 | public void setChildInt(int featureId, int value) { |
| 692 | } |
| 693 | |
| 694 | @Override |
| 695 | public boolean isShortcutKey(int keyCode, KeyEvent event) { |
| 696 | return false; |
| 697 | } |
| 698 | |
| 699 | @Override |
| 700 | public void setVolumeControlStream(int streamType) { |
| 701 | } |
| 702 | |
| 703 | @Override |
| 704 | public int getVolumeControlStream() { |
| 705 | return 0; |
| 706 | } |
| 707 | |
| 708 | @Override |
| 709 | public int getStatusBarColor() { |
| 710 | return 0; |
| 711 | } |
| 712 | |
| 713 | @Override |
| 714 | public void setStatusBarColor(@ColorInt int color) { |
| 715 | } |
| 716 | |
| 717 | @Override |
| 718 | public int getNavigationBarColor() { |
| 719 | return 0; |
| 720 | } |
| 721 | |
| 722 | @Override |
| 723 | public void setNavigationBarColor(@ColorInt int color) { |
| 724 | } |
| 725 | |
| 726 | @Override |
| 727 | public void setDecorCaptionShade(int decorCaptionShade) { |
| 728 | } |
| 729 | |
| 730 | @Override |
| 731 | public void setResizingCaptionDrawable(Drawable drawable) { |
| 732 | } |
| 733 | |
| 734 | @Override |
Andrii Kulian | 933076d | 2016-03-29 17:04:42 -0700 | [diff] [blame] | 735 | public void onMultiWindowModeChanged() { |
Adrian Roos | 0bd8a4b | 2016-03-14 16:21:44 -0700 | [diff] [blame] | 736 | } |
| 737 | |
| 738 | @Override |
Winson Chung | 4d8681f | 2017-05-23 16:22:08 -0700 | [diff] [blame] | 739 | public void onPictureInPictureModeChanged(boolean isInPictureInPictureMode) { |
| 740 | } |
| 741 | |
| 742 | @Override |
Adrian Roos | 0bd8a4b | 2016-03-14 16:21:44 -0700 | [diff] [blame] | 743 | public void reportActivityRelaunched() { |
| 744 | } |
| 745 | }; |
| 746 | |
Daniel Sandler | c4f2a56 | 2012-05-04 11:55:46 -0400 | [diff] [blame] | 747 | } |
| 748 | |