Loading packages/SystemUI/src/com/android/systemui/qs/QSTileHost.java +3 −1 Original line number Diff line number Diff line Loading @@ -161,7 +161,9 @@ public class QSTileHost implements QSHost, Tunable, PluginListener<QSFactory>, P // finishes before creating any tiles. tunerService.addTunable(this, TILES_SETTING); // AutoTileManager can modify mTiles so make sure mTiles has already been initialized. if (!mFeatureFlags.isEnabled(Flags.QS_PIPELINE_AUTO_ADD)) { mAutoTiles = autoTiles.get(); } }); } Loading packages/SystemUI/src/com/android/systemui/qs/pipeline/dagger/BaseAutoAddableModule.kt 0 → 100644 +73 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source 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.android.systemui.qs.pipeline.dagger import android.content.res.Resources import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.qs.pipeline.domain.autoaddable.AutoAddableSetting import com.android.systemui.qs.pipeline.domain.autoaddable.AutoAddableSettingList import com.android.systemui.qs.pipeline.domain.autoaddable.CastAutoAddable import com.android.systemui.qs.pipeline.domain.autoaddable.DataSaverAutoAddable import com.android.systemui.qs.pipeline.domain.autoaddable.DeviceControlsAutoAddable import com.android.systemui.qs.pipeline.domain.autoaddable.HotspotAutoAddable import com.android.systemui.qs.pipeline.domain.autoaddable.NightDisplayAutoAddable import com.android.systemui.qs.pipeline.domain.autoaddable.ReduceBrightColorsAutoAddable import com.android.systemui.qs.pipeline.domain.autoaddable.WalletAutoAddable import com.android.systemui.qs.pipeline.domain.autoaddable.WorkTileAutoAddable import com.android.systemui.qs.pipeline.domain.model.AutoAddable import dagger.Binds import dagger.Module import dagger.Provides import dagger.multibindings.ElementsIntoSet import dagger.multibindings.IntoSet @Module interface BaseAutoAddableModule { companion object { @Provides @ElementsIntoSet fun providesAutoAddableSetting( @Main resources: Resources, autoAddableSettingFactory: AutoAddableSetting.Factory ): Set<AutoAddable> { return AutoAddableSettingList.parseSettingsResource( resources, autoAddableSettingFactory ) .toSet() } } @Binds @IntoSet fun bindCastAutoAddable(impl: CastAutoAddable): AutoAddable @Binds @IntoSet fun bindDataSaverAutoAddable(impl: DataSaverAutoAddable): AutoAddable @Binds @IntoSet fun bindDeviceControlsAutoAddable(impl: DeviceControlsAutoAddable): AutoAddable @Binds @IntoSet fun bindHotspotAutoAddable(impl: HotspotAutoAddable): AutoAddable @Binds @IntoSet fun bindNightDisplayAutoAddable(impl: NightDisplayAutoAddable): AutoAddable @Binds @IntoSet fun bindReduceBrightColorsAutoAddable(impl: ReduceBrightColorsAutoAddable): AutoAddable @Binds @IntoSet fun bindWalletAutoAddable(impl: WalletAutoAddable): AutoAddable @Binds @IntoSet fun bindWorkModeAutoAddable(impl: WorkTileAutoAddable): AutoAddable } packages/SystemUI/src/com/android/systemui/qs/pipeline/dagger/QSAutoAddLog.kt 0 → 100644 +22 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source 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.android.systemui.qs.pipeline.dagger import javax.inject.Qualifier /** A [LogBuffer] for the QS pipeline to track auto-added tiles */ @Qualifier @MustBeDocumented @Retention(AnnotationRetention.RUNTIME) annotation class QSAutoAddLog packages/SystemUI/src/com/android/systemui/qs/pipeline/dagger/QSAutoAddModule.kt +28 −1 Original line number Diff line number Diff line Loading @@ -16,13 +16,40 @@ package com.android.systemui.qs.pipeline.dagger import com.android.systemui.dagger.SysUISingleton import com.android.systemui.log.LogBuffer import com.android.systemui.log.LogBufferFactory import com.android.systemui.qs.pipeline.data.repository.AutoAddRepository import com.android.systemui.qs.pipeline.data.repository.AutoAddSettingRepository import com.android.systemui.qs.pipeline.domain.model.AutoAddable import com.android.systemui.qs.pipeline.shared.logging.QSPipelineLogger import dagger.Binds import dagger.Module import dagger.Provides import dagger.multibindings.Multibinds @Module @Module( includes = [ BaseAutoAddableModule::class, ] ) abstract class QSAutoAddModule { @Binds abstract fun bindAutoAddRepository(impl: AutoAddSettingRepository): AutoAddRepository @Multibinds abstract fun providesAutoAddableSet(): Set<AutoAddable> companion object { /** * Provides a logging buffer for all logs related to the new Quick Settings pipeline to log * auto added tiles. */ @Provides @SysUISingleton @QSAutoAddLog fun provideQSAutoAddLogBuffer(factory: LogBufferFactory): LogBuffer { return factory.create(QSPipelineLogger.AUTO_ADD_TAG, maxSize = 100, systrace = false) } } } packages/SystemUI/src/com/android/systemui/qs/pipeline/dagger/QSPipelineModule.kt +3 −3 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ import com.android.systemui.qs.pipeline.data.repository.TileSpecRepository import com.android.systemui.qs.pipeline.data.repository.TileSpecSettingsRepository import com.android.systemui.qs.pipeline.domain.interactor.CurrentTilesInteractor import com.android.systemui.qs.pipeline.domain.interactor.CurrentTilesInteractorImpl import com.android.systemui.qs.pipeline.prototyping.PrototypeCoreStartable import com.android.systemui.qs.pipeline.domain.startable.QSPipelineCoreStartable import com.android.systemui.qs.pipeline.shared.logging.QSPipelineLogger import dagger.Binds import dagger.Module Loading @@ -53,8 +53,8 @@ abstract class QSPipelineModule { @Binds @IntoMap @ClassKey(PrototypeCoreStartable::class) abstract fun providePrototypeCoreStartable(startable: PrototypeCoreStartable): CoreStartable @ClassKey(QSPipelineCoreStartable::class) abstract fun provideCoreStartable(startable: QSPipelineCoreStartable): CoreStartable companion object { /** Loading Loading
packages/SystemUI/src/com/android/systemui/qs/QSTileHost.java +3 −1 Original line number Diff line number Diff line Loading @@ -161,7 +161,9 @@ public class QSTileHost implements QSHost, Tunable, PluginListener<QSFactory>, P // finishes before creating any tiles. tunerService.addTunable(this, TILES_SETTING); // AutoTileManager can modify mTiles so make sure mTiles has already been initialized. if (!mFeatureFlags.isEnabled(Flags.QS_PIPELINE_AUTO_ADD)) { mAutoTiles = autoTiles.get(); } }); } Loading
packages/SystemUI/src/com/android/systemui/qs/pipeline/dagger/BaseAutoAddableModule.kt 0 → 100644 +73 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source 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.android.systemui.qs.pipeline.dagger import android.content.res.Resources import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.qs.pipeline.domain.autoaddable.AutoAddableSetting import com.android.systemui.qs.pipeline.domain.autoaddable.AutoAddableSettingList import com.android.systemui.qs.pipeline.domain.autoaddable.CastAutoAddable import com.android.systemui.qs.pipeline.domain.autoaddable.DataSaverAutoAddable import com.android.systemui.qs.pipeline.domain.autoaddable.DeviceControlsAutoAddable import com.android.systemui.qs.pipeline.domain.autoaddable.HotspotAutoAddable import com.android.systemui.qs.pipeline.domain.autoaddable.NightDisplayAutoAddable import com.android.systemui.qs.pipeline.domain.autoaddable.ReduceBrightColorsAutoAddable import com.android.systemui.qs.pipeline.domain.autoaddable.WalletAutoAddable import com.android.systemui.qs.pipeline.domain.autoaddable.WorkTileAutoAddable import com.android.systemui.qs.pipeline.domain.model.AutoAddable import dagger.Binds import dagger.Module import dagger.Provides import dagger.multibindings.ElementsIntoSet import dagger.multibindings.IntoSet @Module interface BaseAutoAddableModule { companion object { @Provides @ElementsIntoSet fun providesAutoAddableSetting( @Main resources: Resources, autoAddableSettingFactory: AutoAddableSetting.Factory ): Set<AutoAddable> { return AutoAddableSettingList.parseSettingsResource( resources, autoAddableSettingFactory ) .toSet() } } @Binds @IntoSet fun bindCastAutoAddable(impl: CastAutoAddable): AutoAddable @Binds @IntoSet fun bindDataSaverAutoAddable(impl: DataSaverAutoAddable): AutoAddable @Binds @IntoSet fun bindDeviceControlsAutoAddable(impl: DeviceControlsAutoAddable): AutoAddable @Binds @IntoSet fun bindHotspotAutoAddable(impl: HotspotAutoAddable): AutoAddable @Binds @IntoSet fun bindNightDisplayAutoAddable(impl: NightDisplayAutoAddable): AutoAddable @Binds @IntoSet fun bindReduceBrightColorsAutoAddable(impl: ReduceBrightColorsAutoAddable): AutoAddable @Binds @IntoSet fun bindWalletAutoAddable(impl: WalletAutoAddable): AutoAddable @Binds @IntoSet fun bindWorkModeAutoAddable(impl: WorkTileAutoAddable): AutoAddable }
packages/SystemUI/src/com/android/systemui/qs/pipeline/dagger/QSAutoAddLog.kt 0 → 100644 +22 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source 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.android.systemui.qs.pipeline.dagger import javax.inject.Qualifier /** A [LogBuffer] for the QS pipeline to track auto-added tiles */ @Qualifier @MustBeDocumented @Retention(AnnotationRetention.RUNTIME) annotation class QSAutoAddLog
packages/SystemUI/src/com/android/systemui/qs/pipeline/dagger/QSAutoAddModule.kt +28 −1 Original line number Diff line number Diff line Loading @@ -16,13 +16,40 @@ package com.android.systemui.qs.pipeline.dagger import com.android.systemui.dagger.SysUISingleton import com.android.systemui.log.LogBuffer import com.android.systemui.log.LogBufferFactory import com.android.systemui.qs.pipeline.data.repository.AutoAddRepository import com.android.systemui.qs.pipeline.data.repository.AutoAddSettingRepository import com.android.systemui.qs.pipeline.domain.model.AutoAddable import com.android.systemui.qs.pipeline.shared.logging.QSPipelineLogger import dagger.Binds import dagger.Module import dagger.Provides import dagger.multibindings.Multibinds @Module @Module( includes = [ BaseAutoAddableModule::class, ] ) abstract class QSAutoAddModule { @Binds abstract fun bindAutoAddRepository(impl: AutoAddSettingRepository): AutoAddRepository @Multibinds abstract fun providesAutoAddableSet(): Set<AutoAddable> companion object { /** * Provides a logging buffer for all logs related to the new Quick Settings pipeline to log * auto added tiles. */ @Provides @SysUISingleton @QSAutoAddLog fun provideQSAutoAddLogBuffer(factory: LogBufferFactory): LogBuffer { return factory.create(QSPipelineLogger.AUTO_ADD_TAG, maxSize = 100, systrace = false) } } }
packages/SystemUI/src/com/android/systemui/qs/pipeline/dagger/QSPipelineModule.kt +3 −3 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ import com.android.systemui.qs.pipeline.data.repository.TileSpecRepository import com.android.systemui.qs.pipeline.data.repository.TileSpecSettingsRepository import com.android.systemui.qs.pipeline.domain.interactor.CurrentTilesInteractor import com.android.systemui.qs.pipeline.domain.interactor.CurrentTilesInteractorImpl import com.android.systemui.qs.pipeline.prototyping.PrototypeCoreStartable import com.android.systemui.qs.pipeline.domain.startable.QSPipelineCoreStartable import com.android.systemui.qs.pipeline.shared.logging.QSPipelineLogger import dagger.Binds import dagger.Module Loading @@ -53,8 +53,8 @@ abstract class QSPipelineModule { @Binds @IntoMap @ClassKey(PrototypeCoreStartable::class) abstract fun providePrototypeCoreStartable(startable: PrototypeCoreStartable): CoreStartable @ClassKey(QSPipelineCoreStartable::class) abstract fun provideCoreStartable(startable: QSPipelineCoreStartable): CoreStartable companion object { /** Loading