Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4689d929 authored by Andreas Agvard's avatar Andreas Agvard
Browse files

Stub implementation for handling setUiHints calls to configure new assistant invocation effect.

Bug: 405328848
Flag: com.android.systemui.shared.enable_lpp_assist_invocation_effect
Test: Manual sanity check to see that values make their way through.

Change-Id: I7fce306ac8c48b846df275dd3844b23ff20cb664
parent af05fa7c
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -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
@@ -28,4 +29,9 @@ interface SqueezeEffectRepositoryModule {
    fun squeezeEffectRepository(
        squeezeEffectRepositoryImpl: SqueezeEffectRepositoryImpl
    ): SqueezeEffectRepository

    @Binds
    fun invocationEffectSetUiHintsHandler(
        squeezeEffectRepositoryImpl: SqueezeEffectRepositoryImpl
    ): InvocationEffectSetUiHintsHandler
}
+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
}
+4 −1
Original line number Diff line number Diff line
@@ -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
@@ -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 {
@@ -115,6 +116,8 @@ constructor(
        return drawableResource
    }

    override fun tryHandleSetUiHints(hints: Bundle) = false

    companion object {
        private const val TAG = "SqueezeEffectRepository"
    }