ParanoidSystemUI: Introduce custom VolumeDialogComponent
Change-Id: I6504bcfad3920a26faf06cf75c6f5c066cfb79cd
This commit is contained in:
parent
aa7ac23466
commit
29a0d290ff
|
@ -72,11 +72,11 @@ import com.android.systemui.statusbar.policy.IndividualSensorPrivacyController;
|
|||
import com.android.systemui.statusbar.policy.IndividualSensorPrivacyControllerImpl;
|
||||
import com.android.systemui.statusbar.policy.SensorPrivacyController;
|
||||
import com.android.systemui.statusbar.policy.SensorPrivacyControllerImpl;
|
||||
import com.android.systemui.volume.dagger.VolumeModule;
|
||||
|
||||
import javax.inject.Named;
|
||||
|
||||
import co.aospa.systemui.qs.tileimpl.ParanoidQSFactoryImpl;
|
||||
import co.aospa.systemui.volume.dagger.ParanoidVolumeModule;
|
||||
import dagger.Binds;
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
@ -91,7 +91,7 @@ import dagger.Provides;
|
|||
QSModule.class,
|
||||
ReferenceScreenshotModule.class,
|
||||
StartCentralSurfacesModule.class,
|
||||
VolumeModule.class
|
||||
ParanoidVolumeModule.class
|
||||
})
|
||||
public abstract class ParanoidSystemUIModule {
|
||||
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* Copyright (C) 2022 Paranoid Android
|
||||
*
|
||||
* 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 co.aospa.systemui.volume;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.android.systemui.dagger.SysUISingleton;
|
||||
import com.android.systemui.demomode.DemoModeController;
|
||||
import com.android.systemui.keyguard.KeyguardViewMediator;
|
||||
import com.android.systemui.plugins.ActivityStarter;
|
||||
import com.android.systemui.plugins.PluginDependencyProvider;
|
||||
import com.android.systemui.plugins.VolumeDialog;
|
||||
import com.android.systemui.statusbar.policy.ExtensionController;
|
||||
import com.android.systemui.tuner.TunerService;
|
||||
import com.android.systemui.volume.VolumeDialogComponent;
|
||||
import com.android.systemui.volume.VolumeDialogControllerImpl;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@SysUISingleton
|
||||
public class ParanoidVolumeDialogComponent extends VolumeDialogComponent {
|
||||
|
||||
@Inject
|
||||
public ParanoidVolumeDialogComponent(Context context,
|
||||
KeyguardViewMediator keyguardViewMediator,
|
||||
ActivityStarter activityStarter,
|
||||
VolumeDialogControllerImpl volumeDialogController,
|
||||
DemoModeController demoModeController,
|
||||
PluginDependencyProvider pluginDependencyProvider,
|
||||
ExtensionController extensionController,
|
||||
TunerService tunerService,
|
||||
VolumeDialog volumeDialog) {
|
||||
super(context, keyguardViewMediator, activityStarter, volumeDialogController,
|
||||
demoModeController, pluginDependencyProvider, extensionController, tunerService,
|
||||
volumeDialog);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
* Copyright (C) 2022 Paranoid Android
|
||||
*
|
||||
* 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 co.aospa.systemui.volume.dagger;
|
||||
|
||||
import android.content.Context;
|
||||
import android.media.AudioManager;
|
||||
|
||||
import com.android.internal.jank.InteractionJankMonitor;
|
||||
import com.android.systemui.media.dialog.MediaOutputDialogFactory;
|
||||
import com.android.systemui.plugins.ActivityStarter;
|
||||
import com.android.systemui.plugins.VolumeDialog;
|
||||
import com.android.systemui.plugins.VolumeDialogController;
|
||||
import com.android.systemui.statusbar.policy.AccessibilityManagerWrapper;
|
||||
import com.android.systemui.statusbar.policy.ConfigurationController;
|
||||
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
|
||||
import com.android.systemui.volume.VolumeComponent;
|
||||
import com.android.systemui.volume.VolumeDialogImpl;
|
||||
import com.android.systemui.volume.VolumePanelFactory;
|
||||
import com.android.systemui.volume.dagger.VolumeModule;
|
||||
|
||||
import co.aospa.systemui.volume.ParanoidVolumeDialogComponent;
|
||||
import dagger.Binds;
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
/**
|
||||
* Dagger Module for code in the volume package.
|
||||
* Fork of {@link VolumeModule}
|
||||
*/
|
||||
@Module
|
||||
public interface ParanoidVolumeModule {
|
||||
/** */
|
||||
@Binds
|
||||
VolumeComponent provideVolumeComponent(ParanoidVolumeDialogComponent volumeDialogComponent);
|
||||
|
||||
/** */
|
||||
@Provides
|
||||
static VolumeDialog provideVolumeDialog(
|
||||
Context context,
|
||||
VolumeDialogController volumeDialogController,
|
||||
AccessibilityManagerWrapper accessibilityManagerWrapper,
|
||||
DeviceProvisionedController deviceProvisionedController,
|
||||
ConfigurationController configurationController,
|
||||
MediaOutputDialogFactory mediaOutputDialogFactory,
|
||||
VolumePanelFactory volumePanelFactory,
|
||||
ActivityStarter activityStarter,
|
||||
InteractionJankMonitor interactionJankMonitor) {
|
||||
VolumeDialogImpl impl = new VolumeDialogImpl(
|
||||
context,
|
||||
volumeDialogController,
|
||||
accessibilityManagerWrapper,
|
||||
deviceProvisionedController,
|
||||
configurationController,
|
||||
mediaOutputDialogFactory,
|
||||
volumePanelFactory,
|
||||
activityStarter,
|
||||
interactionJankMonitor);
|
||||
impl.setStreamImportant(AudioManager.STREAM_SYSTEM, false);
|
||||
impl.setAutomute(true);
|
||||
impl.setSilentMode(false);
|
||||
return impl;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue