Skip to content

Commit

Permalink
SystemUIGoogle: Fix BatteryControllerImplGoogle injection
Browse files Browse the repository at this point in the history
Change-Id: I4bc2b02f2928cb231413fb60aecf3ef58b9fcb96
  • Loading branch information
jhenrique09 authored and basamaryan committed Aug 10, 2023
1 parent 5dcd8c4 commit 91dc9b5
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 1 deletion.
Expand Up @@ -102,6 +102,7 @@
import com.google.android.systemui.statusbar.KeyguardIndicationControllerGoogle;
import com.google.android.systemui.statusbar.policy.BatteryControllerImplGoogle;
import com.google.android.systemui.elmyra.ServiceConfigurationGoogle;
import com.google.android.systemui.statusbar.policy.dagger.SystemUIGooglePolicyModule;

import com.android.systemui.statusbar.connectivity.BluetoothModule;
import com.android.systemui.qs.tiles.CustomQSModule;
Expand Down Expand Up @@ -132,7 +133,7 @@
StatusBarEventsModule.class,
CustomQSModule.class,
BluetoothModule.class,
AospPolicyModule.class,
SystemUIGooglePolicyModule.class,
RotationLockModule.class
})
public abstract class SystemUIGoogleModule {
Expand Down
@@ -0,0 +1,68 @@
/*
* Copyright (C) 2023 The PixelExperience Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.android.systemui.statusbar.policy.dagger;

import android.content.Context;
import android.os.Handler;
import android.os.PowerManager;

import com.android.systemui.broadcast.BroadcastDispatcher;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.Background;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.demomode.DemoModeController;
import com.android.systemui.dump.DumpManager;
import com.android.systemui.power.EnhancedEstimates;
import com.android.systemui.settings.UserContentResolverProvider;
import com.android.systemui.statusbar.policy.BatteryController;

import com.google.android.systemui.statusbar.policy.BatteryControllerImplGoogle;
import com.google.android.systemui.reversecharging.ReverseChargingController;

import dagger.Module;
import dagger.Provides;

@Module
public class SystemUIGooglePolicyModule {
@Provides
@SysUISingleton
static BatteryController provideBatteryController(
Context context,
EnhancedEstimates enhancedEstimates,
PowerManager powerManager,
BroadcastDispatcher broadcastDispatcher,
DemoModeController demoModeController,
DumpManager dumpManager,
@Main Handler mainHandler,
@Background Handler bgHandler,
UserContentResolverProvider userContentResolverProvider,
ReverseChargingController reverseChargingController) {
BatteryController bC = new BatteryControllerImplGoogle(
context,
enhancedEstimates,
powerManager,
broadcastDispatcher,
demoModeController,
dumpManager,
mainHandler,
bgHandler,
userContentResolverProvider,
reverseChargingController);
bC.init();
return bC;
}
}

0 comments on commit 91dc9b5

Please sign in to comment.