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

Commit 6542129a authored by Nicolo' Mazzucato's avatar Nicolo' Mazzucato
Browse files

Revert^2 "Fix work profile reinflations when shade window moves between displays"

This reverts commit 848759d0.

Reason for revert: Re-submitting cl with fix. Now we're not changing the window type of the statusbar itself anymore. We should, but for now let's just address the notification inflation issue

Bug: 414788860
Change-Id: I70ff3c5471eccd4e77caa8136052a506f2a807b4
parent 48a43b96
Loading
Loading
Loading
Loading
+22 −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.statusbar.dagger

import javax.inject.Qualifier

/** Qualifier that annotates instances related to the default display statusbar. */
@Qualifier @Retention(AnnotationRetention.RUNTIME) annotation class StatusBarMain
+18 −0
Original line number Diff line number Diff line
@@ -17,11 +17,15 @@
package com.android.systemui.statusbar.dagger

import android.content.Context
import android.view.Display
import android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR
import com.android.systemui.CameraProtectionLoader
import com.android.systemui.CoreStartable
import com.android.systemui.SysUICutoutProvider
import com.android.systemui.SysUICutoutProviderImpl
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.display.data.repository.DisplayWindowPropertiesRepositoryImpl
import com.android.systemui.log.LogBuffer
import com.android.systemui.log.LogBufferFactory
import com.android.systemui.statusbar.chips.sharetoapp.ui.viewmodel.ShareToAppChipViewModel
@@ -203,5 +207,19 @@ interface StatusBarModule {
        ): StatusBarContentInsetsViewModel {
            return StatusBarContentInsetsViewModel(insetsProvider)
        }

        @Provides
        @StatusBarMain
        fun provideDefaultStatusBarContext(
            repoLazy: Lazy<DisplayWindowPropertiesRepositoryImpl>,
            @Main appContext: Context,
        ): Context {
            return if (StatusBarConnectedDisplays.isEnabled) {
                return repoLazy.get().get(Display.DEFAULT_DISPLAY, TYPE_STATUS_BAR)?.context
                    ?: appContext
            } else {
                appContext
            }
        }
    }
}
+3 −2
Original line number Diff line number Diff line
@@ -18,18 +18,19 @@ package com.android.systemui.statusbar.notification.icon

import android.app.Notification
import android.content.Context
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.statusbar.StatusBarIconView
import com.android.systemui.statusbar.dagger.StatusBarMain
import com.android.systemui.statusbar.notification.collection.BundleEntry
import com.android.systemui.statusbar.notification.collection.NotificationEntry
import com.android.systemui.statusbar.notification.contentDescForNotification
import javax.inject.Inject

/** Testable wrapper around Context. */
class IconBuilder @Inject constructor(@Main private val context: Context) {
class IconBuilder @Inject constructor(@StatusBarMain private val context: Context) {
    @JvmOverloads
    fun createIconView(
        entry: NotificationEntry,
        // TODO b/362720336: remove all usages of this without a provided context.
        context: Context = this.context,
    ): StatusBarIconView {
        return StatusBarIconView(