Loading packages/SystemUI/src/com/android/systemui/topwindoweffects/dagger/SqueezeEffectRepositoryModule.kt +8 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.topwindoweffects.dagger import com.android.systemui.topwindoweffects.data.repository.InvocationEffectSetUiHintsHandler import com.android.systemui.topwindoweffects.data.repository.SqueezeEffectRepository import com.android.systemui.topwindoweffects.data.repository.SqueezeEffectRepositoryImpl import dagger.Binds Loading @@ -28,4 +29,9 @@ interface SqueezeEffectRepositoryModule { fun squeezeEffectRepository( squeezeEffectRepositoryImpl: SqueezeEffectRepositoryImpl ): SqueezeEffectRepository @Binds fun invocationEffectSetUiHintsHandler( squeezeEffectRepositoryImpl: SqueezeEffectRepositoryImpl ): InvocationEffectSetUiHintsHandler } packages/SystemUI/src/com/android/systemui/topwindoweffects/data/repository/InvocationEffectSetUiHintsHandler.kt 0 → 100644 +28 −0 Original line number Diff line number Diff line /* * Copyright (C) 2025 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.topwindoweffects.data.repository import android.os.Bundle interface InvocationEffectSetUiHintsHandler { /** * Handles setUiHints actions specific to the invocation effect. * * @return true if the setUiHints action was handled, false otherwise. */ fun tryHandleSetUiHints(hints: Bundle): Boolean } packages/SystemUI/src/com/android/systemui/topwindoweffects/data/repository/SqueezeEffectRepositoryImpl.kt +4 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.systemui.topwindoweffects.data.repository import android.content.Context import android.database.ContentObserver import android.os.Bundle import android.os.Handler import android.provider.Settings.Global.POWER_BUTTON_LONG_PRESS import android.util.DisplayUtils Loading Loading @@ -47,7 +48,7 @@ constructor( @Background private val bgHandler: Handler?, @Background private val bgCoroutineContext: CoroutineContext, private val globalSettings: GlobalSettings, ) : SqueezeEffectRepository { ) : SqueezeEffectRepository, InvocationEffectSetUiHintsHandler { override val isSqueezeEffectEnabled: Flow<Boolean> = conflatedCallbackFlow { Loading Loading @@ -115,6 +116,8 @@ constructor( return drawableResource } override fun tryHandleSetUiHints(hints: Bundle) = false companion object { private const val TAG = "SqueezeEffectRepository" } Loading Loading
packages/SystemUI/src/com/android/systemui/topwindoweffects/dagger/SqueezeEffectRepositoryModule.kt +8 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.topwindoweffects.dagger import com.android.systemui.topwindoweffects.data.repository.InvocationEffectSetUiHintsHandler import com.android.systemui.topwindoweffects.data.repository.SqueezeEffectRepository import com.android.systemui.topwindoweffects.data.repository.SqueezeEffectRepositoryImpl import dagger.Binds Loading @@ -28,4 +29,9 @@ interface SqueezeEffectRepositoryModule { fun squeezeEffectRepository( squeezeEffectRepositoryImpl: SqueezeEffectRepositoryImpl ): SqueezeEffectRepository @Binds fun invocationEffectSetUiHintsHandler( squeezeEffectRepositoryImpl: SqueezeEffectRepositoryImpl ): InvocationEffectSetUiHintsHandler }
packages/SystemUI/src/com/android/systemui/topwindoweffects/data/repository/InvocationEffectSetUiHintsHandler.kt 0 → 100644 +28 −0 Original line number Diff line number Diff line /* * Copyright (C) 2025 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.topwindoweffects.data.repository import android.os.Bundle interface InvocationEffectSetUiHintsHandler { /** * Handles setUiHints actions specific to the invocation effect. * * @return true if the setUiHints action was handled, false otherwise. */ fun tryHandleSetUiHints(hints: Bundle): Boolean }
packages/SystemUI/src/com/android/systemui/topwindoweffects/data/repository/SqueezeEffectRepositoryImpl.kt +4 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.systemui.topwindoweffects.data.repository import android.content.Context import android.database.ContentObserver import android.os.Bundle import android.os.Handler import android.provider.Settings.Global.POWER_BUTTON_LONG_PRESS import android.util.DisplayUtils Loading Loading @@ -47,7 +48,7 @@ constructor( @Background private val bgHandler: Handler?, @Background private val bgCoroutineContext: CoroutineContext, private val globalSettings: GlobalSettings, ) : SqueezeEffectRepository { ) : SqueezeEffectRepository, InvocationEffectSetUiHintsHandler { override val isSqueezeEffectEnabled: Flow<Boolean> = conflatedCallbackFlow { Loading Loading @@ -115,6 +116,8 @@ constructor( return drawableResource } override fun tryHandleSetUiHints(hints: Bundle) = false companion object { private const val TAG = "SqueezeEffectRepository" } Loading