1 /*
2  * Copyright (C) 2023 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.controls.ui
18 
19 import android.service.dreams.IDreamManager
20 import com.android.systemui.broadcast.BroadcastDispatcher
21 import com.android.systemui.controls.settings.ControlsSettingsDialogManager
22 import com.android.systemui.flags.FeatureFlags
23 import com.android.systemui.statusbar.policy.KeyguardStateController
24 
25 // IMPORTANT: onDestroy may be called outside of bounds of the test. That means that the mocks
26 // may have been nulled before onDestroy happens.
27 class TestableControlsActivity(
28     uiController: ControlsUiController,
29     broadcastDispatcher: BroadcastDispatcher,
30     dreamManager: IDreamManager,
31     featureFlags: FeatureFlags,
32     controlsSettingsDialogManager: ControlsSettingsDialogManager,
33     keyguardStateController: KeyguardStateController
34 ) :
35     ControlsActivity(
36         uiController,
37         broadcastDispatcher,
38         dreamManager,
39         featureFlags,
40         controlsSettingsDialogManager,
41         keyguardStateController
42     ) {
unregisterReceivernull43     override fun unregisterReceiver() {
44         // Do nothing. This will be called in `onDestroy`
45     }
46 }
47