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

Commit e751a8c9 authored by Kai Li's avatar Kai Li Committed by Android (Google) Code Review
Browse files

Merge "Create initial code structure for the Underlay feature." into main

parents 2978481c ee895cc2
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -2193,3 +2193,11 @@ flag {
    description: "Use AAD proximity sensor if flag is enabled and sensor is present"
    bug: "402534470"
}

flag {
    name: "enable_underlay"
    namespace: "ailabs"
    description: "Enable the underlay additional layer"
    bug: "403422950"
}
+9 −0
Original line number Diff line number Diff line
# pixel team
dupin@google.com
klikli@google.com
chriscui@google.com

# System UI
nijamkin@google.com
pixel@google.com
+45 −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.underlay

import android.util.Log
import com.android.systemui.CoreStartable
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.underlay.shared.flag.UnderlayFlag
import javax.inject.Inject

/**
 * Core startable for the underlay.
 *
 * This is responsible for starting the underlay and its dependencies.
 */
@SysUISingleton
class UnderlayCoreStartable @Inject constructor() : CoreStartable {

    override fun start() {
        if (!UnderlayFlag.isEnabled) {
            Log.d(TAG, "Underlay flag is disabled, not starting.")
            return
        }

        Log.d(TAG, "start!")
    }

    private companion object {
        const val TAG = "UnderlayCoreStartable"
    }
}
+32 −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.underlay

import com.android.systemui.CoreStartable
import dagger.Binds
import dagger.Module
import dagger.multibindings.ClassKey
import dagger.multibindings.IntoMap

@Module
interface UnderlayModule {

    @Binds
    @IntoMap
    @ClassKey(UnderlayCoreStartable::class)
    fun bindUnderlayCoreStartable(startable: UnderlayCoreStartable): CoreStartable
}
+29 −0
Original line number Diff line number Diff line
/*
 * Copyright 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.
 */

@file:Suppress("NOTHING_TO_INLINE")

package com.android.systemui.underlay.shared.flag

import com.android.systemui.Flags.enableUnderlay

/** Helper for reading or using the underlay flag state. */
object UnderlayFlag {

    @JvmStatic
    inline val isEnabled
        get() = enableUnderlay()
}