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

Commit 0e2230c8 authored by Dave Mankoff's avatar Dave Mankoff
Browse files

1/3 Begin removine SuperStatusBarViewFactory.

Use the StatusBarComponent in its place.

Bug: 190746471
Test: atest SystemUITests && manual
Change-Id: Idc7c347d19309dbbab8c134370d31479ddf5eb86
parent 8e97f220
Loading
Loading
Loading
Loading
+0 −34
Original line number Diff line number Diff line
@@ -23,8 +23,6 @@ import android.view.ViewGroup;
import com.android.systemui.R;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.statusbar.notification.row.dagger.NotificationShelfComponent;
import com.android.systemui.statusbar.phone.NotificationPanelView;
import com.android.systemui.statusbar.phone.NotificationShadeWindowView;
import com.android.systemui.statusbar.phone.StatusBarWindowView;
import com.android.systemui.util.InjectionInflationController;

@@ -41,7 +39,6 @@ public class SuperStatusBarViewFactory {
    private final InjectionInflationController mInjectionInflationController;
    private final NotificationShelfComponent.Builder mNotificationShelfComponentBuilder;

    private NotificationShadeWindowView mNotificationShadeWindowView;
    private StatusBarWindowView mStatusBarWindowView;
    private NotificationShelfController mNotificationShelfController;

@@ -54,28 +51,6 @@ public class SuperStatusBarViewFactory {
        mNotificationShelfComponentBuilder = notificationShelfComponentBuilder;
    }

    /**
     * Gets the inflated {@link NotificationShadeWindowView} from
     * {@link R.layout#super_notification_shade}.
     * Returns a cached instance, if it has already been inflated.
     */
    public NotificationShadeWindowView getNotificationShadeWindowView() {
        if (mNotificationShadeWindowView != null) {
            return mNotificationShadeWindowView;
        }

        mNotificationShadeWindowView = (NotificationShadeWindowView)
                mInjectionInflationController.injectable(
                LayoutInflater.from(mContext)).inflate(R.layout.super_notification_shade,
                /* root= */ null);
        if (mNotificationShadeWindowView == null) {
            throw new IllegalStateException(
                    "R.layout.super_notification_shade could not be properly inflated");
        }

        return mNotificationShadeWindowView;
    }

    /**
     * Gets the inflated {@link StatusBarWindowView} from {@link R.layout#super_status_bar}.
     * Returns a cached instance, if it has already been inflated.
@@ -127,13 +102,4 @@ public class SuperStatusBarViewFactory {

        return mNotificationShelfController;
    }

    public NotificationPanelView getNotificationPanelView() {
        NotificationShadeWindowView notificationShadeWindowView = getNotificationShadeWindowView();
        if (notificationShadeWindowView == null) {
            return null;
        }

        return mNotificationShadeWindowView.findViewById(R.id.notification_panel);
    }
}
+6 −8
Original line number Diff line number Diff line
@@ -228,11 +228,11 @@ import com.android.systemui.statusbar.policy.UserInfoControllerImpl;
import com.android.systemui.statusbar.policy.UserSwitcherController;
import com.android.systemui.tuner.TunerService;
import com.android.systemui.unfold.UnfoldLightRevealOverlayAnimation;
import com.android.systemui.unfold.config.UnfoldTransitionConfig;
import com.android.systemui.util.concurrency.DelayableExecutor;
import com.android.systemui.util.concurrency.MessageRouter;
import com.android.systemui.volume.VolumeComponent;
import com.android.systemui.wmshell.BubblesManager;
import com.android.systemui.unfold.config.UnfoldTransitionConfig;
import com.android.wm.shell.bubbles.Bubbles;
import com.android.wm.shell.legacysplitscreen.LegacySplitScreen;
import com.android.wm.shell.startingsurface.SplashscreenContentDrawer;
@@ -248,7 +248,6 @@ import java.util.Optional;
import java.util.concurrent.Executor;

import javax.inject.Named;
import javax.inject.Provider;

import dagger.Lazy;

@@ -491,7 +490,7 @@ public class StatusBar extends SystemUI implements
    protected NotificationShadeWindowViewController mNotificationShadeWindowViewController;
    private final DozeParameters mDozeParameters;
    private final Lazy<BiometricUnlockController> mBiometricUnlockControllerLazy;
    private final Provider<StatusBarComponent.Builder> mStatusBarComponentBuilder;
    private final StatusBarComponent.Factory mStatusBarComponentFactory;
    private final PluginManager mPluginManager;
    private final Optional<LegacySplitScreen> mSplitScreenOptional;
    private final StatusBarNotificationActivityStarter.Builder
@@ -744,7 +743,7 @@ public class StatusBar extends SystemUI implements
            DozeScrimController dozeScrimController,
            VolumeComponent volumeComponent,
            CommandQueue commandQueue,
            Provider<StatusBarComponent.Builder> statusBarComponentBuilder,
            StatusBarComponent.Factory statusBarComponentFactory,
            PluginManager pluginManager,
            Optional<LegacySplitScreen> splitScreenOptional,
            LightsOutNotifController lightsOutNotifController,
@@ -841,7 +840,7 @@ public class StatusBar extends SystemUI implements
        mNotificationShadeDepthControllerLazy = notificationShadeDepthControllerLazy;
        mVolumeComponent = volumeComponent;
        mCommandQueue = commandQueue;
        mStatusBarComponentBuilder = statusBarComponentBuilder;
        mStatusBarComponentFactory = statusBarComponentFactory;
        mPluginManager = pluginManager;
        mSplitScreenOptional = splitScreenOptional;
        mStatusBarNotificationActivityStarterBuilder = statusBarNotificationActivityStarterBuilder;
@@ -1533,9 +1532,8 @@ public class StatusBar extends SystemUI implements
    }

    private void inflateStatusBarWindow() {
        mNotificationShadeWindowView = mSuperStatusBarViewFactory.getNotificationShadeWindowView();
        StatusBarComponent statusBarComponent = mStatusBarComponentBuilder.get()
                .statusBarWindowView(mNotificationShadeWindowView).build();
        StatusBarComponent statusBarComponent = mStatusBarComponentFactory.create();
        mNotificationShadeWindowView = statusBarComponent.getNotificationShadeWindowView();
        mNotificationShadeWindowViewController = statusBarComponent
                .getNotificationShadeWindowViewController();
        mNotificationShadeWindowController.setNotificationShadeView(mNotificationShadeWindowView);
+10 −6
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ import java.lang.annotation.Retention;

import javax.inject.Scope;

import dagger.BindsInstance;
import dagger.Subcomponent;

/**
@@ -46,11 +45,9 @@ public interface StatusBarComponent {
    /**
     * Builder for {@link StatusBarComponent}.
     */
    @Subcomponent.Builder
    interface Builder {
        @BindsInstance Builder statusBarWindowView(
                NotificationShadeWindowView notificationShadeWindowView);
        StatusBarComponent build();
    @Subcomponent.Factory
    interface Factory {
        StatusBarComponent create();
    }

    /**
@@ -61,6 +58,13 @@ public interface StatusBarComponent {
    @Scope
    @interface StatusBarScope {}

    /**
     * Creates a {@link NotificationShadeWindowView}/
     * @return
     */
    @StatusBarScope
    NotificationShadeWindowView getNotificationShadeWindowView();

    /**
     * Creates a NotificationShadeWindowViewController.
     */
+3 −4
Original line number Diff line number Diff line
@@ -104,11 +104,11 @@ import com.android.systemui.statusbar.policy.UserInfoControllerImpl;
import com.android.systemui.statusbar.policy.UserSwitcherController;
import com.android.systemui.tuner.TunerService;
import com.android.systemui.unfold.UnfoldLightRevealOverlayAnimation;
import com.android.systemui.unfold.config.UnfoldTransitionConfig;
import com.android.systemui.util.concurrency.DelayableExecutor;
import com.android.systemui.util.concurrency.MessageRouter;
import com.android.systemui.volume.VolumeComponent;
import com.android.systemui.wmshell.BubblesManager;
import com.android.systemui.unfold.config.UnfoldTransitionConfig;
import com.android.wm.shell.bubbles.Bubbles;
import com.android.wm.shell.legacysplitscreen.LegacySplitScreen;
import com.android.wm.shell.startingsurface.StartingSurface;
@@ -117,7 +117,6 @@ import java.util.Optional;
import java.util.concurrent.Executor;

import javax.inject.Named;
import javax.inject.Provider;

import dagger.Lazy;
import dagger.Module;
@@ -187,7 +186,7 @@ public interface StatusBarPhoneModule {
            DozeScrimController dozeScrimController,
            VolumeComponent volumeComponent,
            CommandQueue commandQueue,
            Provider<StatusBarComponent.Builder> statusBarComponentBuilder,
            StatusBarComponent.Factory statusBarComponentFactory,
            PluginManager pluginManager,
            Optional<LegacySplitScreen> splitScreenOptional,
            LightsOutNotifController lightsOutNotifController,
@@ -281,7 +280,7 @@ public interface StatusBarPhoneModule {
                dozeScrimController,
                volumeComponent,
                commandQueue,
                statusBarComponentBuilder,
                statusBarComponentFactory,
                pluginManager,
                splitScreenOptional,
                lightsOutNotifController,
+21 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
package com.android.systemui.statusbar.phone.dagger;

import android.annotation.Nullable;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;

import com.android.keyguard.LockIconView;
@@ -26,6 +28,7 @@ import com.android.systemui.biometrics.AuthRippleView;
import com.android.systemui.statusbar.phone.NotificationPanelView;
import com.android.systemui.statusbar.phone.NotificationShadeWindowView;
import com.android.systemui.statusbar.phone.TapAgainView;
import com.android.systemui.util.InjectionInflationController;

import javax.inject.Named;

@@ -37,6 +40,24 @@ public abstract class StatusBarViewModule {

    public static final String SPLIT_SHADE_HEADER = "split_shade_header";

    /** */
    @Provides
    @StatusBarComponent.StatusBarScope
    public static NotificationShadeWindowView providesNotificationShadeWindowView(
            InjectionInflationController injectionInflationController,
            Context context) {
        NotificationShadeWindowView notificationShadeWindowView = (NotificationShadeWindowView)
                injectionInflationController.injectable(
                        LayoutInflater.from(context)).inflate(R.layout.super_notification_shade,
                        /* root= */ null);
        if (notificationShadeWindowView == null) {
            throw new IllegalStateException(
                    "R.layout.super_notification_shade could not be properly inflated");
        }

        return notificationShadeWindowView;
    }

    /** */
    @Provides
    @StatusBarComponent.StatusBarScope
Loading