1 /* 2 * Copyright (C) 2022 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.policy; 18 19 import android.content.Context; 20 import android.os.Handler; 21 import android.os.PowerManager; 22 23 import com.android.systemui.broadcast.BroadcastDispatcher; 24 import com.android.systemui.dagger.SysUISingleton; 25 import com.android.systemui.dagger.qualifiers.Background; 26 import com.android.systemui.dagger.qualifiers.Main; 27 import com.android.systemui.demomode.DemoModeController; 28 import com.android.systemui.dump.DumpManager; 29 import com.android.systemui.power.EnhancedEstimates; 30 31 import dagger.Module; 32 import dagger.Provides; 33 34 /** 35 * com.android.systemui.statusbar.policy related providers that others may want to override. 36 */ 37 @Module 38 public class AospPolicyModule { 39 @Provides 40 @SysUISingleton provideBatteryController( Context context, EnhancedEstimates enhancedEstimates, PowerManager powerManager, BroadcastDispatcher broadcastDispatcher, DemoModeController demoModeController, DumpManager dumpManager, BatteryControllerLogger logger, @Main Handler mainHandler, @Background Handler bgHandler)41 static BatteryController provideBatteryController( 42 Context context, 43 EnhancedEstimates enhancedEstimates, 44 PowerManager powerManager, 45 BroadcastDispatcher broadcastDispatcher, 46 DemoModeController demoModeController, 47 DumpManager dumpManager, 48 BatteryControllerLogger logger, 49 @Main Handler mainHandler, 50 @Background Handler bgHandler) { 51 BatteryController bC = new BatteryControllerImpl( 52 context, 53 enhancedEstimates, 54 powerManager, 55 broadcastDispatcher, 56 demoModeController, 57 dumpManager, 58 logger, 59 mainHandler, 60 bgHandler); 61 bC.init(); 62 return bC; 63 } 64 } 65