Loading libs/dream/lowlight/res/values/config.xml +0 −2 Original line number Diff line number Diff line Loading @@ -15,8 +15,6 @@ ~ limitations under the License. --> <resources> <!-- The dream component used when the device is low light environment. --> <string translatable="false" name="config_lowLightDreamComponent"/> <!-- The max number of milliseconds to wait for the low light transition before setting the system dream component --> <integer name="config_lowLightTransitionTimeoutMs">2000</integer> Loading libs/dream/lowlight/src/com/android/dream/lowlight/dagger/LowLightDreamComponent.kt 0 → 100644 +34 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 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.dream.lowlight.dagger import android.app.DreamManager import android.content.ComponentName import dagger.BindsInstance import dagger.Subcomponent import javax.inject.Named @Subcomponent(modules = [LowLightDreamModule::class]) interface LowLightDreamComponent { @Subcomponent.Factory interface Factory { fun create(@BindsInstance dreamManager: DreamManager, @Named(LowLightDreamModule.LOW_LIGHT_DREAM_COMPONENT) @BindsInstance lowLightDreamComponent: ComponentName? ): LowLightDreamComponent } } No newline at end of file libs/dream/lowlight/src/com/android/dream/lowlight/dagger/LowLightDreamModule.kt +0 −26 Original line number Diff line number Diff line Loading @@ -15,8 +15,6 @@ */ package com.android.dream.lowlight.dagger import android.app.DreamManager import android.content.ComponentName import android.content.Context import com.android.dream.lowlight.R import com.android.dream.lowlight.dagger.qualifiers.Application Loading @@ -35,30 +33,6 @@ import javax.inject.Named */ @Module object LowLightDreamModule { /** * Provides dream manager. */ @Provides fun providesDreamManager(context: Context): DreamManager { return requireNotNull(context.getSystemService(DreamManager::class.java)) } /** * Provides the component name of the low light dream, or null if not configured. */ @Provides @Named(LOW_LIGHT_DREAM_COMPONENT) fun providesLowLightDreamComponent(context: Context): ComponentName? { val lowLightDreamComponent = context.resources.getString( R.string.config_lowLightDreamComponent ) return if (lowLightDreamComponent.isEmpty()) { null } else { ComponentName.unflattenFromString(lowLightDreamComponent) } } @Provides @Named(LOW_LIGHT_TRANSITION_TIMEOUT_MS) fun providesLowLightTransitionTimeout(context: Context): Long { Loading packages/SystemUI/aconfig/systemui.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -1221,6 +1221,13 @@ flag { bug: "378171351" } flag { name: "low_light_clock_dream" namespace: "systemui" description: "Enables low light clock dream experience on mobile phones" bug: "378174125" } flag { name: "communal_standalone_support" namespace: "systemui" Loading packages/SystemUI/res/values/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -1103,4 +1103,8 @@ Whether the user switching can only happen by logging out and going through the system user (login screen). --> <bool name="config_userSwitchingMustGoThroughLoginScreen">false</bool> <!-- The dream component used when the device is low light environment. --> <string translatable="false" name="config_lowLightDreamComponent"/> </resources> Loading
libs/dream/lowlight/res/values/config.xml +0 −2 Original line number Diff line number Diff line Loading @@ -15,8 +15,6 @@ ~ limitations under the License. --> <resources> <!-- The dream component used when the device is low light environment. --> <string translatable="false" name="config_lowLightDreamComponent"/> <!-- The max number of milliseconds to wait for the low light transition before setting the system dream component --> <integer name="config_lowLightTransitionTimeoutMs">2000</integer> Loading
libs/dream/lowlight/src/com/android/dream/lowlight/dagger/LowLightDreamComponent.kt 0 → 100644 +34 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 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.dream.lowlight.dagger import android.app.DreamManager import android.content.ComponentName import dagger.BindsInstance import dagger.Subcomponent import javax.inject.Named @Subcomponent(modules = [LowLightDreamModule::class]) interface LowLightDreamComponent { @Subcomponent.Factory interface Factory { fun create(@BindsInstance dreamManager: DreamManager, @Named(LowLightDreamModule.LOW_LIGHT_DREAM_COMPONENT) @BindsInstance lowLightDreamComponent: ComponentName? ): LowLightDreamComponent } } No newline at end of file
libs/dream/lowlight/src/com/android/dream/lowlight/dagger/LowLightDreamModule.kt +0 −26 Original line number Diff line number Diff line Loading @@ -15,8 +15,6 @@ */ package com.android.dream.lowlight.dagger import android.app.DreamManager import android.content.ComponentName import android.content.Context import com.android.dream.lowlight.R import com.android.dream.lowlight.dagger.qualifiers.Application Loading @@ -35,30 +33,6 @@ import javax.inject.Named */ @Module object LowLightDreamModule { /** * Provides dream manager. */ @Provides fun providesDreamManager(context: Context): DreamManager { return requireNotNull(context.getSystemService(DreamManager::class.java)) } /** * Provides the component name of the low light dream, or null if not configured. */ @Provides @Named(LOW_LIGHT_DREAM_COMPONENT) fun providesLowLightDreamComponent(context: Context): ComponentName? { val lowLightDreamComponent = context.resources.getString( R.string.config_lowLightDreamComponent ) return if (lowLightDreamComponent.isEmpty()) { null } else { ComponentName.unflattenFromString(lowLightDreamComponent) } } @Provides @Named(LOW_LIGHT_TRANSITION_TIMEOUT_MS) fun providesLowLightTransitionTimeout(context: Context): Long { Loading
packages/SystemUI/aconfig/systemui.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -1221,6 +1221,13 @@ flag { bug: "378171351" } flag { name: "low_light_clock_dream" namespace: "systemui" description: "Enables low light clock dream experience on mobile phones" bug: "378174125" } flag { name: "communal_standalone_support" namespace: "systemui" Loading
packages/SystemUI/res/values/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -1103,4 +1103,8 @@ Whether the user switching can only happen by logging out and going through the system user (login screen). --> <bool name="config_userSwitchingMustGoThroughLoginScreen">false</bool> <!-- The dream component used when the device is low light environment. --> <string translatable="false" name="config_lowLightDreamComponent"/> </resources>