Adrian Roos | ef7a402 | 2017-01-19 14:48:35 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 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 | |
Julia Reynolds | 3020315 | 2017-05-26 13:36:31 -0400 | [diff] [blame^] | 19 | import static android.app.NotificationManager.IMPORTANCE_HIGH; |
| 20 | |
| 21 | import static junit.framework.Assert.assertFalse; |
| 22 | import static junit.framework.Assert.assertTrue; |
| 23 | |
Adrian Roos | ef7a402 | 2017-01-19 14:48:35 -0800 | [diff] [blame] | 24 | import static org.mockito.Matchers.any; |
| 25 | import static org.mockito.Matchers.anyBoolean; |
Julia Reynolds | 3020315 | 2017-05-26 13:36:31 -0400 | [diff] [blame^] | 26 | import static org.mockito.Matchers.anyString; |
Adrian Roos | ef7a402 | 2017-01-19 14:48:35 -0800 | [diff] [blame] | 27 | import static org.mockito.Mockito.doAnswer; |
| 28 | import static org.mockito.Mockito.mock; |
| 29 | import static org.mockito.Mockito.when; |
| 30 | |
Julia Reynolds | 3020315 | 2017-05-26 13:36:31 -0400 | [diff] [blame^] | 31 | import android.app.Notification; |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 32 | import android.metrics.LogMaker; |
Julia Reynolds | 3020315 | 2017-05-26 13:36:31 -0400 | [diff] [blame^] | 33 | import android.os.Handler; |
| 34 | import android.os.HandlerThread; |
| 35 | import android.os.IPowerManager; |
| 36 | import android.os.Looper; |
| 37 | import android.os.PowerManager; |
| 38 | import android.os.UserHandle; |
| 39 | import android.service.notification.StatusBarNotification; |
Adrian Roos | ef7a402 | 2017-01-19 14:48:35 -0800 | [diff] [blame] | 40 | import android.support.test.filters.SmallTest; |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 41 | import android.support.test.metricshelper.MetricsAsserts; |
Adrian Roos | ef7a402 | 2017-01-19 14:48:35 -0800 | [diff] [blame] | 42 | import android.support.test.runner.AndroidJUnit4; |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 43 | import android.util.DisplayMetrics; |
Adrian Roos | ef7a402 | 2017-01-19 14:48:35 -0800 | [diff] [blame] | 44 | |
Chris Wren | ef31990 | 2017-03-07 17:58:31 -0500 | [diff] [blame] | 45 | import com.android.internal.logging.MetricsLogger; |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 46 | import com.android.internal.logging.nano.MetricsProto.MetricsEvent; |
Chris Wren | ef31990 | 2017-03-07 17:58:31 -0500 | [diff] [blame] | 47 | import com.android.internal.logging.testing.FakeMetricsLogger; |
Adrian Roos | ef7a402 | 2017-01-19 14:48:35 -0800 | [diff] [blame] | 48 | import com.android.keyguard.KeyguardHostView.OnDismissAction; |
| 49 | import com.android.systemui.SysuiTestCase; |
Julia Reynolds | 3020315 | 2017-05-26 13:36:31 -0400 | [diff] [blame^] | 50 | import com.android.systemui.recents.misc.SystemServicesProxy; |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 51 | import com.android.systemui.statusbar.ActivatableNotificationView; |
| 52 | import com.android.systemui.statusbar.KeyguardIndicationController; |
| 53 | import com.android.systemui.statusbar.NotificationData; |
Julia Reynolds | 3020315 | 2017-05-26 13:36:31 -0400 | [diff] [blame^] | 54 | import com.android.systemui.statusbar.policy.HeadsUpManager; |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 55 | import com.android.systemui.statusbar.stack.NotificationStackScrollLayout; |
Adrian Roos | ef7a402 | 2017-01-19 14:48:35 -0800 | [diff] [blame] | 56 | |
| 57 | import org.junit.Before; |
| 58 | import org.junit.Test; |
| 59 | import org.junit.runner.RunWith; |
| 60 | |
Adrian Roos | 02de498 | 2017-02-11 09:35:54 +0100 | [diff] [blame] | 61 | @SmallTest |
| 62 | @RunWith(AndroidJUnit4.class) |
Jason Monk | 2a6ea9c | 2017-01-26 11:14:51 -0500 | [diff] [blame] | 63 | public class StatusBarTest extends SysuiTestCase { |
Adrian Roos | ef7a402 | 2017-01-19 14:48:35 -0800 | [diff] [blame] | 64 | |
| 65 | StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 66 | UnlockMethodCache mUnlockMethodCache; |
| 67 | KeyguardIndicationController mKeyguardIndicationController; |
| 68 | NotificationStackScrollLayout mStackScroller; |
Jason Monk | 2a6ea9c | 2017-01-26 11:14:51 -0500 | [diff] [blame] | 69 | StatusBar mStatusBar; |
Chris Wren | ef31990 | 2017-03-07 17:58:31 -0500 | [diff] [blame] | 70 | FakeMetricsLogger mMetricsLogger; |
Julia Reynolds | 3020315 | 2017-05-26 13:36:31 -0400 | [diff] [blame^] | 71 | HeadsUpManager mHeadsUpManager; |
| 72 | NotificationData mNotificationData; |
| 73 | PowerManager mPowerManager; |
| 74 | SystemServicesProxy mSystemServicesProxy; |
Adrian Roos | ef7a402 | 2017-01-19 14:48:35 -0800 | [diff] [blame] | 75 | |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 76 | private DisplayMetrics mDisplayMetrics = new DisplayMetrics(); |
| 77 | |
Adrian Roos | 02de498 | 2017-02-11 09:35:54 +0100 | [diff] [blame] | 78 | @Before |
Julia Reynolds | 3020315 | 2017-05-26 13:36:31 -0400 | [diff] [blame^] | 79 | public void setup() throws Exception { |
Adrian Roos | ef7a402 | 2017-01-19 14:48:35 -0800 | [diff] [blame] | 80 | mStatusBarKeyguardViewManager = mock(StatusBarKeyguardViewManager.class); |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 81 | mUnlockMethodCache = mock(UnlockMethodCache.class); |
| 82 | mKeyguardIndicationController = mock(KeyguardIndicationController.class); |
| 83 | mStackScroller = mock(NotificationStackScrollLayout.class); |
Chris Wren | ef31990 | 2017-03-07 17:58:31 -0500 | [diff] [blame] | 84 | mMetricsLogger = new FakeMetricsLogger(); |
Julia Reynolds | 3020315 | 2017-05-26 13:36:31 -0400 | [diff] [blame^] | 85 | mHeadsUpManager = mock(HeadsUpManager.class); |
| 86 | mNotificationData = mock(NotificationData.class); |
| 87 | mSystemServicesProxy = mock(SystemServicesProxy.class); |
| 88 | IPowerManager powerManagerService = mock(IPowerManager.class); |
| 89 | HandlerThread handlerThread = new HandlerThread("TestThread"); |
| 90 | handlerThread.start(); |
| 91 | mPowerManager = new PowerManager(mContext, powerManagerService, |
| 92 | new Handler(handlerThread.getLooper())); |
| 93 | when(powerManagerService.isInteractive()).thenReturn(true); |
| 94 | |
Jason Monk | 8c09ac7 | 2017-03-16 11:53:40 -0400 | [diff] [blame] | 95 | mDependency.injectTestDependency(MetricsLogger.class, mMetricsLogger); |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 96 | mStatusBar = new TestableStatusBar(mStatusBarKeyguardViewManager, mUnlockMethodCache, |
Julia Reynolds | 3020315 | 2017-05-26 13:36:31 -0400 | [diff] [blame^] | 97 | mKeyguardIndicationController, mStackScroller, mHeadsUpManager, |
| 98 | mNotificationData, mPowerManager, mSystemServicesProxy); |
Adrian Roos | ef7a402 | 2017-01-19 14:48:35 -0800 | [diff] [blame] | 99 | |
| 100 | doAnswer(invocation -> { |
| 101 | OnDismissAction onDismissAction = (OnDismissAction) invocation.getArguments()[0]; |
| 102 | onDismissAction.onDismiss(); |
| 103 | return null; |
| 104 | }).when(mStatusBarKeyguardViewManager).dismissWithAction(any(), any(), anyBoolean()); |
| 105 | |
| 106 | doAnswer(invocation -> { |
| 107 | Runnable runnable = (Runnable) invocation.getArguments()[0]; |
| 108 | runnable.run(); |
| 109 | return null; |
| 110 | }).when(mStatusBarKeyguardViewManager).addAfterKeyguardGoneRunnable(any()); |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 111 | |
| 112 | when(mStackScroller.getActivatedChild()).thenReturn(null); |
Adrian Roos | ef7a402 | 2017-01-19 14:48:35 -0800 | [diff] [blame] | 113 | } |
| 114 | |
Adrian Roos | 02de498 | 2017-02-11 09:35:54 +0100 | [diff] [blame] | 115 | @Test |
Adrian Roos | ef7a402 | 2017-01-19 14:48:35 -0800 | [diff] [blame] | 116 | public void executeRunnableDismissingKeyguard_nullRunnable_showingAndOccluded() { |
| 117 | when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(true); |
| 118 | when(mStatusBarKeyguardViewManager.isOccluded()).thenReturn(true); |
| 119 | |
Jason Monk | 2a6ea9c | 2017-01-26 11:14:51 -0500 | [diff] [blame] | 120 | mStatusBar.executeRunnableDismissingKeyguard(null, null, false, false, false); |
Adrian Roos | ef7a402 | 2017-01-19 14:48:35 -0800 | [diff] [blame] | 121 | } |
| 122 | |
Adrian Roos | 02de498 | 2017-02-11 09:35:54 +0100 | [diff] [blame] | 123 | @Test |
Adrian Roos | ef7a402 | 2017-01-19 14:48:35 -0800 | [diff] [blame] | 124 | public void executeRunnableDismissingKeyguard_nullRunnable_showing() { |
| 125 | when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(true); |
| 126 | when(mStatusBarKeyguardViewManager.isOccluded()).thenReturn(false); |
| 127 | |
Jason Monk | 2a6ea9c | 2017-01-26 11:14:51 -0500 | [diff] [blame] | 128 | mStatusBar.executeRunnableDismissingKeyguard(null, null, false, false, false); |
Adrian Roos | ef7a402 | 2017-01-19 14:48:35 -0800 | [diff] [blame] | 129 | } |
| 130 | |
Adrian Roos | 02de498 | 2017-02-11 09:35:54 +0100 | [diff] [blame] | 131 | @Test |
Adrian Roos | ef7a402 | 2017-01-19 14:48:35 -0800 | [diff] [blame] | 132 | public void executeRunnableDismissingKeyguard_nullRunnable_notShowing() { |
| 133 | when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(false); |
| 134 | when(mStatusBarKeyguardViewManager.isOccluded()).thenReturn(false); |
| 135 | |
Jason Monk | 2a6ea9c | 2017-01-26 11:14:51 -0500 | [diff] [blame] | 136 | mStatusBar.executeRunnableDismissingKeyguard(null, null, false, false, false); |
Adrian Roos | ef7a402 | 2017-01-19 14:48:35 -0800 | [diff] [blame] | 137 | } |
| 138 | |
Adrian Roos | 02de498 | 2017-02-11 09:35:54 +0100 | [diff] [blame] | 139 | @Test |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 140 | public void lockscreenStateMetrics_notShowing() { |
| 141 | // uninteresting state, except that fingerprint must be non-zero |
| 142 | when(mStatusBarKeyguardViewManager.isOccluded()).thenReturn(false); |
| 143 | when(mUnlockMethodCache.canSkipBouncer()).thenReturn(true); |
| 144 | // interesting state |
| 145 | when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(false); |
| 146 | when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false); |
| 147 | when(mUnlockMethodCache.isMethodSecure()).thenReturn(false); |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 148 | mStatusBar.onKeyguardViewManagerStatesUpdated(); |
| 149 | |
Chris Wren | ef31990 | 2017-03-07 17:58:31 -0500 | [diff] [blame] | 150 | MetricsAsserts.assertHasLog("missing hidden insecure lockscreen log", |
| 151 | mMetricsLogger.getLogs(), |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 152 | new LogMaker(MetricsEvent.LOCKSCREEN) |
| 153 | .setType(MetricsEvent.TYPE_CLOSE) |
| 154 | .setSubtype(0)); |
| 155 | } |
| 156 | |
Adrian Roos | 02de498 | 2017-02-11 09:35:54 +0100 | [diff] [blame] | 157 | @Test |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 158 | public void lockscreenStateMetrics_notShowing_secure() { |
| 159 | // uninteresting state, except that fingerprint must be non-zero |
| 160 | when(mStatusBarKeyguardViewManager.isOccluded()).thenReturn(false); |
| 161 | when(mUnlockMethodCache.canSkipBouncer()).thenReturn(true); |
| 162 | // interesting state |
| 163 | when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(false); |
| 164 | when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false); |
| 165 | when(mUnlockMethodCache.isMethodSecure()).thenReturn(true); |
| 166 | |
| 167 | mStatusBar.onKeyguardViewManagerStatesUpdated(); |
| 168 | |
Chris Wren | ef31990 | 2017-03-07 17:58:31 -0500 | [diff] [blame] | 169 | MetricsAsserts.assertHasLog("missing hidden secure lockscreen log", |
| 170 | mMetricsLogger.getLogs(), |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 171 | new LogMaker(MetricsEvent.LOCKSCREEN) |
| 172 | .setType(MetricsEvent.TYPE_CLOSE) |
| 173 | .setSubtype(1)); |
| 174 | } |
| 175 | |
Adrian Roos | 02de498 | 2017-02-11 09:35:54 +0100 | [diff] [blame] | 176 | @Test |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 177 | public void lockscreenStateMetrics_isShowing() { |
| 178 | // uninteresting state, except that fingerprint must be non-zero |
| 179 | when(mStatusBarKeyguardViewManager.isOccluded()).thenReturn(false); |
| 180 | when(mUnlockMethodCache.canSkipBouncer()).thenReturn(true); |
| 181 | // interesting state |
| 182 | when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(true); |
| 183 | when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false); |
| 184 | when(mUnlockMethodCache.isMethodSecure()).thenReturn(false); |
| 185 | |
| 186 | mStatusBar.onKeyguardViewManagerStatesUpdated(); |
| 187 | |
Chris Wren | ef31990 | 2017-03-07 17:58:31 -0500 | [diff] [blame] | 188 | MetricsAsserts.assertHasLog("missing insecure lockscreen showing", |
| 189 | mMetricsLogger.getLogs(), |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 190 | new LogMaker(MetricsEvent.LOCKSCREEN) |
| 191 | .setType(MetricsEvent.TYPE_OPEN) |
| 192 | .setSubtype(0)); |
| 193 | } |
| 194 | |
Adrian Roos | 02de498 | 2017-02-11 09:35:54 +0100 | [diff] [blame] | 195 | @Test |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 196 | public void lockscreenStateMetrics_isShowing_secure() { |
| 197 | // uninteresting state, except that fingerprint must be non-zero |
| 198 | when(mStatusBarKeyguardViewManager.isOccluded()).thenReturn(false); |
| 199 | when(mUnlockMethodCache.canSkipBouncer()).thenReturn(true); |
| 200 | // interesting state |
| 201 | when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(true); |
| 202 | when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false); |
| 203 | when(mUnlockMethodCache.isMethodSecure()).thenReturn(true); |
| 204 | |
| 205 | mStatusBar.onKeyguardViewManagerStatesUpdated(); |
| 206 | |
Chris Wren | ef31990 | 2017-03-07 17:58:31 -0500 | [diff] [blame] | 207 | MetricsAsserts.assertHasLog("missing secure lockscreen showing log", |
| 208 | mMetricsLogger.getLogs(), |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 209 | new LogMaker(MetricsEvent.LOCKSCREEN) |
| 210 | .setType(MetricsEvent.TYPE_OPEN) |
| 211 | .setSubtype(1)); |
| 212 | } |
| 213 | |
Adrian Roos | 02de498 | 2017-02-11 09:35:54 +0100 | [diff] [blame] | 214 | @Test |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 215 | public void lockscreenStateMetrics_isShowingBouncer() { |
| 216 | // uninteresting state, except that fingerprint must be non-zero |
| 217 | when(mStatusBarKeyguardViewManager.isOccluded()).thenReturn(false); |
| 218 | when(mUnlockMethodCache.canSkipBouncer()).thenReturn(true); |
| 219 | // interesting state |
| 220 | when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(true); |
| 221 | when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(true); |
| 222 | when(mUnlockMethodCache.isMethodSecure()).thenReturn(true); |
| 223 | |
| 224 | mStatusBar.onKeyguardViewManagerStatesUpdated(); |
| 225 | |
Chris Wren | ef31990 | 2017-03-07 17:58:31 -0500 | [diff] [blame] | 226 | MetricsAsserts.assertHasLog("missing bouncer log", |
| 227 | mMetricsLogger.getLogs(), |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 228 | new LogMaker(MetricsEvent.BOUNCER) |
| 229 | .setType(MetricsEvent.TYPE_OPEN) |
| 230 | .setSubtype(1)); |
| 231 | } |
| 232 | |
Adrian Roos | 02de498 | 2017-02-11 09:35:54 +0100 | [diff] [blame] | 233 | @Test |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 234 | public void onActivatedMetrics() { |
| 235 | ActivatableNotificationView view = mock(ActivatableNotificationView.class); |
| 236 | mStatusBar.onActivated(view); |
| 237 | |
Chris Wren | ef31990 | 2017-03-07 17:58:31 -0500 | [diff] [blame] | 238 | MetricsAsserts.assertHasLog("missing lockscreen note tap log", |
| 239 | mMetricsLogger.getLogs(), |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 240 | new LogMaker(MetricsEvent.ACTION_LS_NOTE) |
| 241 | .setType(MetricsEvent.TYPE_ACTION)); |
| 242 | } |
| 243 | |
Julia Reynolds | 3020315 | 2017-05-26 13:36:31 -0400 | [diff] [blame^] | 244 | @Test |
| 245 | public void testShouldPeek_nonSuppressedGroupSummary() { |
| 246 | when(mPowerManager.isScreenOn()).thenReturn(true); |
| 247 | when(mHeadsUpManager.isSnoozed(anyString())).thenReturn(false); |
| 248 | when(mNotificationData.shouldSuppressScreenOn(any())).thenReturn(false); |
| 249 | when(mNotificationData.shouldFilterOut(any())).thenReturn(false); |
| 250 | when(mSystemServicesProxy.isDreaming()).thenReturn(false); |
| 251 | when(mNotificationData.getImportance(any())).thenReturn(IMPORTANCE_HIGH); |
| 252 | |
| 253 | Notification n = new Notification.Builder(getContext(), "a") |
| 254 | .setGroup("a") |
| 255 | .setGroupSummary(true) |
| 256 | .setGroupAlertBehavior(Notification.GROUP_ALERT_SUMMARY) |
| 257 | .build(); |
| 258 | StatusBarNotification sbn = new StatusBarNotification("a", "a", 0, "a", 0, 0, n, |
| 259 | UserHandle.of(0), null, 0); |
| 260 | NotificationData.Entry entry = new NotificationData.Entry(sbn); |
| 261 | |
| 262 | assertTrue(mStatusBar.shouldPeek(entry, sbn)); |
| 263 | } |
| 264 | |
| 265 | @Test |
| 266 | public void testShouldPeek_suppressedGroupSummary() { |
| 267 | when(mPowerManager.isScreenOn()).thenReturn(true); |
| 268 | when(mHeadsUpManager.isSnoozed(anyString())).thenReturn(false); |
| 269 | when(mNotificationData.shouldSuppressScreenOn(any())).thenReturn(false); |
| 270 | when(mNotificationData.shouldFilterOut(any())).thenReturn(false); |
| 271 | when(mSystemServicesProxy.isDreaming()).thenReturn(false); |
| 272 | when(mNotificationData.getImportance(any())).thenReturn(IMPORTANCE_HIGH); |
| 273 | |
| 274 | Notification n = new Notification.Builder(getContext(), "a") |
| 275 | .setGroup("a") |
| 276 | .setGroupSummary(true) |
| 277 | .setGroupAlertBehavior(Notification.GROUP_ALERT_CHILDREN) |
| 278 | .build(); |
| 279 | StatusBarNotification sbn = new StatusBarNotification("a", "a", 0, "a", 0, 0, n, |
| 280 | UserHandle.of(0), null, 0); |
| 281 | NotificationData.Entry entry = new NotificationData.Entry(sbn); |
| 282 | |
| 283 | assertFalse(mStatusBar.shouldPeek(entry, sbn)); |
| 284 | } |
| 285 | |
Jason Monk | 2a6ea9c | 2017-01-26 11:14:51 -0500 | [diff] [blame] | 286 | static class TestableStatusBar extends StatusBar { |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 287 | public TestableStatusBar(StatusBarKeyguardViewManager man, |
| 288 | UnlockMethodCache unlock, KeyguardIndicationController key, |
Julia Reynolds | 3020315 | 2017-05-26 13:36:31 -0400 | [diff] [blame^] | 289 | NotificationStackScrollLayout stack, HeadsUpManager hum, NotificationData nd, |
| 290 | PowerManager pm, SystemServicesProxy ssp) { |
Adrian Roos | ef7a402 | 2017-01-19 14:48:35 -0800 | [diff] [blame] | 291 | mStatusBarKeyguardViewManager = man; |
Chris Wren | 27a52fa | 2017-02-01 14:21:43 -0500 | [diff] [blame] | 292 | mUnlockMethodCache = unlock; |
| 293 | mKeyguardIndicationController = key; |
| 294 | mStackScroller = stack; |
Julia Reynolds | 3020315 | 2017-05-26 13:36:31 -0400 | [diff] [blame^] | 295 | mHeadsUpManager = hum; |
| 296 | mNotificationData = nd; |
| 297 | mUseHeadsUp = true; |
| 298 | mPowerManager = pm; |
| 299 | mSystemServicesProxy = ssp; |
Adrian Roos | ef7a402 | 2017-01-19 14:48:35 -0800 | [diff] [blame] | 300 | } |
| 301 | |
| 302 | @Override |
Jason Monk | 2a6ea9c | 2017-01-26 11:14:51 -0500 | [diff] [blame] | 303 | protected H createHandler() { |
Adrian Roos | ef7a402 | 2017-01-19 14:48:35 -0800 | [diff] [blame] | 304 | return null; |
| 305 | } |
| 306 | } |
Adrian Roos | 02de498 | 2017-02-11 09:35:54 +0100 | [diff] [blame] | 307 | } |