Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [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.keyguard; |
| 18 | |
Lucas Dupin | 1f7374a | 2018-02-26 18:08:33 -0800 | [diff] [blame] | 19 | import static org.mockito.ArgumentMatchers.any; |
| 20 | import static org.mockito.ArgumentMatchers.anyString; |
| 21 | import static org.mockito.ArgumentMatchers.eq; |
Lucas Dupin | 7e171e2 | 2018-12-20 11:29:35 -0800 | [diff] [blame] | 22 | import static org.mockito.Mockito.mock; |
Lucas Dupin | 8b77a3b | 2018-05-01 13:23:03 -0700 | [diff] [blame] | 23 | import static org.mockito.Mockito.never; |
Lucas Dupin | 3d560e4 | 2019-01-07 13:52:44 -0800 | [diff] [blame] | 24 | import static org.mockito.Mockito.reset; |
Lucas Dupin | 8b77a3b | 2018-05-01 13:23:03 -0700 | [diff] [blame] | 25 | import static org.mockito.Mockito.spy; |
Lucas Dupin | 1f7374a | 2018-02-26 18:08:33 -0800 | [diff] [blame] | 26 | import static org.mockito.Mockito.verify; |
Lucas Dupin | c954824 | 2019-04-11 10:59:13 -0700 | [diff] [blame] | 27 | import static org.mockito.Mockito.when; |
Lucas Dupin | 1f7374a | 2018-02-26 18:08:33 -0800 | [diff] [blame] | 28 | |
| 29 | import android.app.AlarmManager; |
| 30 | import android.content.ContentResolver; |
Lucas Dupin | 6a03a9f | 2018-12-20 17:13:52 -0800 | [diff] [blame] | 31 | import android.media.MediaMetadata; |
Lucas Dupin | 6b40d5e | 2019-05-15 19:47:11 -0700 | [diff] [blame] | 32 | import android.media.session.PlaybackState; |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 33 | import android.net.Uri; |
Lucas Dupin | 8b77a3b | 2018-05-01 13:23:03 -0700 | [diff] [blame] | 34 | import android.provider.Settings; |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 35 | import android.testing.AndroidTestingRunner; |
| 36 | import android.testing.TestableLooper; |
| 37 | import android.testing.TestableLooper.RunWithLooper; |
Lucas Dupin | 627ad37 | 2018-11-27 10:28:25 +0100 | [diff] [blame] | 38 | |
| 39 | import androidx.slice.Slice; |
| 40 | import androidx.slice.SliceItem; |
| 41 | import androidx.slice.SliceProvider; |
| 42 | import androidx.slice.SliceSpecs; |
| 43 | import androidx.slice.builders.ListBuilder; |
| 44 | import androidx.slice.core.SliceQuery; |
Brett Chabot | 84151d9 | 2019-02-27 15:37:59 -0800 | [diff] [blame] | 45 | import androidx.test.filters.SmallTest; |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 46 | |
Lucas Dupin | 7e171e2 | 2018-12-20 11:29:35 -0800 | [diff] [blame] | 47 | import com.android.keyguard.KeyguardUpdateMonitor; |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 48 | import com.android.systemui.SysuiTestCase; |
Beverly | 8fdb533 | 2019-02-04 14:29:49 -0500 | [diff] [blame] | 49 | import com.android.systemui.plugins.statusbar.StatusBarStateController; |
Lucas Dupin | 6a03a9f | 2018-12-20 17:13:52 -0800 | [diff] [blame] | 50 | import com.android.systemui.statusbar.NotificationMediaManager; |
Robert Snoeberger | dc8fee7 | 2019-07-19 16:35:35 -0400 | [diff] [blame] | 51 | import com.android.systemui.statusbar.StatusBarState; |
Selim Cinek | e3c6e46 | 2019-06-24 19:37:06 -0700 | [diff] [blame] | 52 | import com.android.systemui.statusbar.phone.DozeParameters; |
Lucas Dupin | 2d34523 | 2019-06-20 14:07:57 -0700 | [diff] [blame] | 53 | import com.android.systemui.statusbar.phone.KeyguardBypassController; |
| 54 | import com.android.systemui.statusbar.policy.ZenModeController; |
| 55 | import com.android.systemui.util.wakelock.SettableWakeLock; |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 56 | |
Dave Mankoff | e229469 | 2019-08-14 11:53:13 -0400 | [diff] [blame] | 57 | import org.junit.After; |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 58 | import org.junit.Assert; |
| 59 | import org.junit.Before; |
| 60 | import org.junit.Test; |
| 61 | import org.junit.runner.RunWith; |
Lucas Dupin | 1f7374a | 2018-02-26 18:08:33 -0800 | [diff] [blame] | 62 | import org.mockito.Mock; |
| 63 | import org.mockito.MockitoAnnotations; |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 64 | |
Jason Monk | 459fee3 | 2018-01-09 20:37:27 -0500 | [diff] [blame] | 65 | import java.util.Arrays; |
Jeff Gaston | c2100af | 2018-04-04 01:54:52 -0400 | [diff] [blame] | 66 | import java.util.HashSet; |
Lucas Dupin | 8b77a3b | 2018-05-01 13:23:03 -0700 | [diff] [blame] | 67 | import java.util.concurrent.TimeUnit; |
Jason Monk | 459fee3 | 2018-01-09 20:37:27 -0500 | [diff] [blame] | 68 | |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 69 | @SmallTest |
| 70 | @RunWith(AndroidTestingRunner.class) |
Jason Monk | a716bac | 2018-12-05 15:48:21 -0500 | [diff] [blame] | 71 | @RunWithLooper |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 72 | public class KeyguardSliceProviderTest extends SysuiTestCase { |
| 73 | |
Lucas Dupin | 1f7374a | 2018-02-26 18:08:33 -0800 | [diff] [blame] | 74 | @Mock |
| 75 | private ContentResolver mContentResolver; |
| 76 | @Mock |
| 77 | private AlarmManager mAlarmManager; |
Lucas Dupin | 6a03a9f | 2018-12-20 17:13:52 -0800 | [diff] [blame] | 78 | @Mock |
| 79 | private NotificationMediaManager mNotificationMediaManager; |
Lucas Dupin | 3d560e4 | 2019-01-07 13:52:44 -0800 | [diff] [blame] | 80 | @Mock |
| 81 | private StatusBarStateController mStatusBarStateController; |
Lucas Dupin | 2d34523 | 2019-06-20 14:07:57 -0700 | [diff] [blame] | 82 | @Mock |
| 83 | private KeyguardBypassController mKeyguardBypassController; |
| 84 | @Mock |
| 85 | private ZenModeController mZenModeController; |
| 86 | @Mock |
| 87 | private SettableWakeLock mMediaWakeLock; |
| 88 | @Mock |
Selim Cinek | e3c6e46 | 2019-06-24 19:37:06 -0700 | [diff] [blame] | 89 | private DozeParameters mDozeParameters; |
Dave Mankoff | e229469 | 2019-08-14 11:53:13 -0400 | [diff] [blame] | 90 | private KeyguardUpdateMonitor mKeyguardUpdateMonitor; |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 91 | private TestableKeyguardSliceProvider mProvider; |
Lucas Dupin | 8b77a3b | 2018-05-01 13:23:03 -0700 | [diff] [blame] | 92 | private boolean mIsZenMode; |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 93 | |
| 94 | @Before |
| 95 | public void setup() { |
Lucas Dupin | 1f7374a | 2018-02-26 18:08:33 -0800 | [diff] [blame] | 96 | MockitoAnnotations.initMocks(this); |
Dave Mankoff | e229469 | 2019-08-14 11:53:13 -0400 | [diff] [blame] | 97 | mKeyguardUpdateMonitor = mDependency.injectMockDependency(KeyguardUpdateMonitor.class); |
Lucas Dupin | 8b77a3b | 2018-05-01 13:23:03 -0700 | [diff] [blame] | 98 | mIsZenMode = false; |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 99 | mProvider = new TestableKeyguardSliceProvider(); |
| 100 | mProvider.attachInfo(getContext(), null); |
Lucas Dupin | 940e490 | 2019-06-03 15:43:20 -0700 | [diff] [blame] | 101 | mProvider.initDependencies(mNotificationMediaManager, mStatusBarStateController, |
Selim Cinek | e3c6e46 | 2019-06-24 19:37:06 -0700 | [diff] [blame] | 102 | mKeyguardBypassController, mDozeParameters); |
Jeff Gaston | c2100af | 2018-04-04 01:54:52 -0400 | [diff] [blame] | 103 | SliceProvider.setSpecs(new HashSet<>(Arrays.asList(SliceSpecs.LIST))); |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 104 | } |
| 105 | |
Dave Mankoff | e229469 | 2019-08-14 11:53:13 -0400 | [diff] [blame] | 106 | @After |
| 107 | public void tearDown() { |
| 108 | mProvider.onDestroy(); |
| 109 | } |
| 110 | |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 111 | @Test |
| 112 | public void registersClockUpdate() { |
| 113 | Assert.assertTrue("registerClockUpdate should have been called during initialization.", |
| 114 | mProvider.isRegistered()); |
| 115 | } |
| 116 | |
| 117 | @Test |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 118 | public void returnsValidSlice() { |
Lucas Dupin | 1f7374a | 2018-02-26 18:08:33 -0800 | [diff] [blame] | 119 | Slice slice = mProvider.onBindSlice(mProvider.getUri()); |
Lucas Dupin | 6bd8601 | 2017-12-05 17:58:57 -0800 | [diff] [blame] | 120 | SliceItem text = SliceQuery.find(slice, android.app.slice.SliceItem.FORMAT_TEXT, |
| 121 | android.app.slice.Slice.HINT_TITLE, |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 122 | null /* nonHints */); |
| 123 | Assert.assertNotNull("Slice must provide a title.", text); |
| 124 | } |
| 125 | |
| 126 | @Test |
Lucas Dupin | 940e490 | 2019-06-03 15:43:20 -0700 | [diff] [blame] | 127 | public void onBindSlice_readsMedia_withoutBypass() { |
Lucas Dupin | 6a03a9f | 2018-12-20 17:13:52 -0800 | [diff] [blame] | 128 | MediaMetadata metadata = mock(MediaMetadata.class); |
Lucas Dupin | c954824 | 2019-04-11 10:59:13 -0700 | [diff] [blame] | 129 | when(metadata.getText(any())).thenReturn("metadata"); |
Lucas Dupin | 3d560e4 | 2019-01-07 13:52:44 -0800 | [diff] [blame] | 130 | mProvider.onDozingChanged(true); |
Lucas Dupin | 6b40d5e | 2019-05-15 19:47:11 -0700 | [diff] [blame] | 131 | mProvider.onMetadataOrStateChanged(metadata, PlaybackState.STATE_PLAYING); |
Lucas Dupin | 6a03a9f | 2018-12-20 17:13:52 -0800 | [diff] [blame] | 132 | mProvider.onBindSlice(mProvider.getUri()); |
| 133 | verify(metadata).getText(eq(MediaMetadata.METADATA_KEY_TITLE)); |
| 134 | verify(metadata).getText(eq(MediaMetadata.METADATA_KEY_ARTIST)); |
| 135 | verify(mNotificationMediaManager).getMediaIcon(); |
| 136 | } |
| 137 | |
| 138 | @Test |
Lucas Dupin | 940e490 | 2019-06-03 15:43:20 -0700 | [diff] [blame] | 139 | public void onBindSlice_readsMedia_withBypass_notDozing() { |
| 140 | MediaMetadata metadata = mock(MediaMetadata.class); |
| 141 | when(metadata.getText(any())).thenReturn("metadata"); |
| 142 | when(mKeyguardBypassController.getBypassEnabled()).thenReturn(true); |
Selim Cinek | e3c6e46 | 2019-06-24 19:37:06 -0700 | [diff] [blame] | 143 | when(mDozeParameters.getAlwaysOn()).thenReturn(true); |
Lucas Dupin | 940e490 | 2019-06-03 15:43:20 -0700 | [diff] [blame] | 144 | mProvider.onMetadataOrStateChanged(metadata, PlaybackState.STATE_PLAYING); |
| 145 | mProvider.onBindSlice(mProvider.getUri()); |
| 146 | verify(metadata).getText(eq(MediaMetadata.METADATA_KEY_TITLE)); |
| 147 | verify(metadata).getText(eq(MediaMetadata.METADATA_KEY_ARTIST)); |
| 148 | verify(mNotificationMediaManager).getMediaIcon(); |
| 149 | } |
| 150 | |
| 151 | @Test |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 152 | public void cleansDateFormat() { |
Lucas Dupin | 7e171e2 | 2018-12-20 11:29:35 -0800 | [diff] [blame] | 153 | mProvider.mKeyguardUpdateMonitorCallback.onTimeZoneChanged(null); |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 154 | TestableLooper.get(this).processAllMessages(); |
| 155 | Assert.assertEquals("Date format should have been cleaned.", 1 /* expected */, |
| 156 | mProvider.mCleanDateFormatInvokations); |
| 157 | } |
| 158 | |
| 159 | @Test |
| 160 | public void updatesClock() { |
Lucas Dupin | 7e171e2 | 2018-12-20 11:29:35 -0800 | [diff] [blame] | 161 | mProvider.mKeyguardUpdateMonitorCallback.onTimeChanged(); |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 162 | TestableLooper.get(this).processAllMessages(); |
Lucas Dupin | 1f7374a | 2018-02-26 18:08:33 -0800 | [diff] [blame] | 163 | verify(mContentResolver).notifyChange(eq(mProvider.getUri()), eq(null)); |
| 164 | } |
| 165 | |
| 166 | @Test |
| 167 | public void schedulesAlarm12hBefore() { |
| 168 | long in16Hours = System.currentTimeMillis() + TimeUnit.HOURS.toHours(16); |
| 169 | AlarmManager.AlarmClockInfo alarmClockInfo = new AlarmManager.AlarmClockInfo(in16Hours, null); |
| 170 | mProvider.onNextAlarmChanged(alarmClockInfo); |
| 171 | |
| 172 | long twelveHours = TimeUnit.HOURS.toMillis(KeyguardSliceProvider.ALARM_VISIBILITY_HOURS); |
| 173 | long triggerAt = in16Hours - twelveHours; |
| 174 | verify(mAlarmManager).setExact(eq(AlarmManager.RTC), eq(triggerAt), anyString(), any(), |
| 175 | any()); |
| 176 | } |
| 177 | |
| 178 | @Test |
| 179 | public void updatingNextAlarmInvalidatesSlice() { |
| 180 | long in16Hours = System.currentTimeMillis() + TimeUnit.HOURS.toHours(8); |
| 181 | AlarmManager.AlarmClockInfo alarmClockInfo = new AlarmManager.AlarmClockInfo(in16Hours, null); |
| 182 | mProvider.onNextAlarmChanged(alarmClockInfo); |
| 183 | |
| 184 | verify(mContentResolver).notifyChange(eq(mProvider.getUri()), eq(null)); |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 185 | } |
| 186 | |
Lucas Dupin | 8b77a3b | 2018-05-01 13:23:03 -0700 | [diff] [blame] | 187 | @Test |
| 188 | public void onZenChanged_updatesSlice() { |
| 189 | mProvider.onZenChanged(Settings.Global.ZEN_MODE_ALARMS); |
| 190 | verify(mContentResolver).notifyChange(eq(mProvider.getUri()), eq(null)); |
| 191 | } |
| 192 | |
| 193 | @Test |
| 194 | public void addZenMode_addedToSlice() { |
Jason Monk | 1045e0b | 2018-08-06 09:42:10 -0400 | [diff] [blame] | 195 | ListBuilder listBuilder = spy(new ListBuilder(getContext(), mProvider.getUri(), |
| 196 | ListBuilder.INFINITY)); |
Lucas Dupin | 6a03a9f | 2018-12-20 17:13:52 -0800 | [diff] [blame] | 197 | mProvider.addZenModeLocked(listBuilder); |
Lucas Dupin | 8b77a3b | 2018-05-01 13:23:03 -0700 | [diff] [blame] | 198 | verify(listBuilder, never()).addRow(any(ListBuilder.RowBuilder.class)); |
| 199 | |
| 200 | mIsZenMode = true; |
Lucas Dupin | 6a03a9f | 2018-12-20 17:13:52 -0800 | [diff] [blame] | 201 | mProvider.addZenModeLocked(listBuilder); |
Lucas Dupin | 8b77a3b | 2018-05-01 13:23:03 -0700 | [diff] [blame] | 202 | verify(listBuilder).addRow(any(ListBuilder.RowBuilder.class)); |
| 203 | } |
| 204 | |
Lucas Dupin | 6a03a9f | 2018-12-20 17:13:52 -0800 | [diff] [blame] | 205 | @Test |
| 206 | public void onMetadataChanged_updatesSlice() { |
Robert Snoeberger | dc8fee7 | 2019-07-19 16:35:35 -0400 | [diff] [blame] | 207 | mProvider.onStateChanged(StatusBarState.KEYGUARD); |
Lucas Dupin | 3d560e4 | 2019-01-07 13:52:44 -0800 | [diff] [blame] | 208 | mProvider.onDozingChanged(true); |
Lucas Dupin | 76527ee | 2019-02-20 10:46:23 -0800 | [diff] [blame] | 209 | reset(mContentResolver); |
Lucas Dupin | 6b40d5e | 2019-05-15 19:47:11 -0700 | [diff] [blame] | 210 | mProvider.onMetadataOrStateChanged(mock(MediaMetadata.class), PlaybackState.STATE_PLAYING); |
Lucas Dupin | 6a03a9f | 2018-12-20 17:13:52 -0800 | [diff] [blame] | 211 | verify(mContentResolver).notifyChange(eq(mProvider.getUri()), eq(null)); |
Lucas Dupin | 3d560e4 | 2019-01-07 13:52:44 -0800 | [diff] [blame] | 212 | |
| 213 | // Hides after waking up |
| 214 | reset(mContentResolver); |
| 215 | mProvider.onDozingChanged(false); |
| 216 | verify(mContentResolver).notifyChange(eq(mProvider.getUri()), eq(null)); |
Lucas Dupin | 3d560e4 | 2019-01-07 13:52:44 -0800 | [diff] [blame] | 217 | } |
| 218 | |
| 219 | @Test |
| 220 | public void onDozingChanged_updatesSliceIfMedia() { |
Robert Snoeberger | dc8fee7 | 2019-07-19 16:35:35 -0400 | [diff] [blame] | 221 | mProvider.onStateChanged(StatusBarState.KEYGUARD); |
Lucas Dupin | 6b40d5e | 2019-05-15 19:47:11 -0700 | [diff] [blame] | 222 | mProvider.onMetadataOrStateChanged(mock(MediaMetadata.class), PlaybackState.STATE_PLAYING); |
Lucas Dupin | 76527ee | 2019-02-20 10:46:23 -0800 | [diff] [blame] | 223 | reset(mContentResolver); |
| 224 | // Show media when dozing |
Lucas Dupin | 3d560e4 | 2019-01-07 13:52:44 -0800 | [diff] [blame] | 225 | mProvider.onDozingChanged(true); |
| 226 | verify(mContentResolver).notifyChange(eq(mProvider.getUri()), eq(null)); |
| 227 | |
| 228 | // Do not notify again if nothing changed |
| 229 | reset(mContentResolver); |
| 230 | mProvider.onDozingChanged(true); |
| 231 | verify(mContentResolver, never()).notifyChange(eq(mProvider.getUri()), eq(null)); |
Lucas Dupin | 6a03a9f | 2018-12-20 17:13:52 -0800 | [diff] [blame] | 232 | } |
| 233 | |
Lucas Dupin | 2d34523 | 2019-06-20 14:07:57 -0700 | [diff] [blame] | 234 | @Test |
| 235 | public void onDestroy_noCrash() { |
| 236 | mProvider.onDestroy(); |
| 237 | } |
| 238 | |
| 239 | @Test |
| 240 | public void onDestroy_unregisterListeners() { |
| 241 | mProvider.registerClockUpdate(); |
| 242 | mProvider.onDestroy(); |
| 243 | verify(mMediaWakeLock).setAcquired(eq(false)); |
| 244 | verify(mAlarmManager).cancel(any(AlarmManager.OnAlarmListener.class)); |
| 245 | verify(mKeyguardUpdateMonitor).removeCallback(any()); |
| 246 | } |
| 247 | |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 248 | private class TestableKeyguardSliceProvider extends KeyguardSliceProvider { |
| 249 | int mCleanDateFormatInvokations; |
Lucas Dupin | 1f7374a | 2018-02-26 18:08:33 -0800 | [diff] [blame] | 250 | private int mCounter; |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 251 | |
Lucas Dupin | 1f7374a | 2018-02-26 18:08:33 -0800 | [diff] [blame] | 252 | Uri getUri() { |
| 253 | return mSliceUri; |
| 254 | } |
| 255 | |
| 256 | @Override |
| 257 | public boolean onCreateSliceProvider() { |
| 258 | super.onCreateSliceProvider(); |
| 259 | mAlarmManager = KeyguardSliceProviderTest.this.mAlarmManager; |
| 260 | mContentResolver = KeyguardSliceProviderTest.this.mContentResolver; |
Lucas Dupin | 2d34523 | 2019-06-20 14:07:57 -0700 | [diff] [blame] | 261 | mZenModeController = KeyguardSliceProviderTest.this.mZenModeController; |
| 262 | mMediaWakeLock = KeyguardSliceProviderTest.this.mMediaWakeLock; |
Lucas Dupin | 1f7374a | 2018-02-26 18:08:33 -0800 | [diff] [blame] | 263 | return true; |
| 264 | } |
| 265 | |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 266 | @Override |
Lucas Dupin | 627ad37 | 2018-11-27 10:28:25 +0100 | [diff] [blame] | 267 | protected boolean isDndOn() { |
Lucas Dupin | 8b77a3b | 2018-05-01 13:23:03 -0700 | [diff] [blame] | 268 | return mIsZenMode; |
| 269 | } |
| 270 | |
| 271 | @Override |
Lucas Dupin | 6a03a9f | 2018-12-20 17:13:52 -0800 | [diff] [blame] | 272 | void cleanDateFormatLocked() { |
| 273 | super.cleanDateFormatLocked(); |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 274 | mCleanDateFormatInvokations++; |
| 275 | } |
| 276 | |
| 277 | @Override |
Lucas Dupin | 6a03a9f | 2018-12-20 17:13:52 -0800 | [diff] [blame] | 278 | protected String getFormattedDateLocked() { |
| 279 | return super.getFormattedDateLocked() + mCounter++; |
| 280 | } |
Lucas Dupin | 957e50c | 2017-10-10 11:23:27 -0700 | [diff] [blame] | 281 | } |
| 282 | |
| 283 | } |