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

Commit 84590ea2 authored by Abhijoy Saha's avatar Abhijoy Saha Committed by kwaky
Browse files

Use abstractions to allow FullscreenUserSwitcher take advantage of SystemUIOverlayWindow.

This change includes the following:
* Rename SystemUIPrimaryWindow to SystemUIOverlayWindow
* Create Mediator and View controller abstractions that allows
developers to easily take advantage of SystemUIOverlayWindow that is
managed by a single SystemUI Object: SystemUIOverlayWindowManager.
* Convert FullscreenUserSwitcher to take advantage of the newly added
abstractions.

Bug: 147826738
Test: Manual
Change-Id: I19825da81f8d1b1259a2ba115e0238a9ffa69e37
Merged-In: I19825da81f8d1b1259a2ba115e0238a9ffa69e37
parent e6750fd5
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
-->
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/fullscreen_user_switcher"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">
@@ -24,22 +25,26 @@
        android:id="@+id/container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentTop="true"
        android:orientation="vertical">

        <include
        <!-- TODO(b/150302361): Status bar is commented out since a top inset is being added which causes it to be displayed below the top of the screen. -->
        <!--        <include
                    layout="@layout/car_status_bar_header"
                    android:layout_alignParentTop="true"
            android:theme="@android:style/Theme"/>
                    android:theme="@android:style/Theme"/>-->


        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <com.android.systemui.statusbar.car.UserGridRecyclerView
            <com.android.systemui.car.userswitcher.UserGridRecyclerView
                android:id="@+id/user_grid"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_marginTop="@dimen/car_user_switcher_margin_top"/>
                android:layout_gravity="center_vertical"/>
            <!-- TODO(b/150302361): Re-add marginTop once status bar has been added back. -->
            <!--                android:layout_marginTop="@dimen/car_user_switcher_margin_top"/>-->
        </FrameLayout>

    </LinearLayout>
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@
        android:layout_width="match_parent"
        android:layout_height="@dimen/car_user_switcher_container_height">

        <com.android.systemui.statusbar.car.UserGridRecyclerView
        <com.android.systemui.car.userswitcher.UserGridRecyclerView
            android:id="@+id/user_grid"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>
+6 −0
Original line number Diff line number Diff line
@@ -58,6 +58,11 @@
        to a constant alpha percent value using the initial alpha. -->
    <integer name="config_finalNotificationBackgroundAlpha">100</integer>

    <!-- Car System UI's OverlayViewsMediator-->
    <string-array name="config_carSystemUIOverlayViewsMediators" translatable="false">
        <item>com.android.systemui.car.userswitcher.FullscreenUserSwitcherViewMediator</item>
    </string-array>

    <!-- SystemUI Services: The classes of the stuff to start. -->
    <string-array name="config_systemUIServiceComponents" translatable="false">
        <item>com.android.systemui.util.NotificationChannels</item>
@@ -85,5 +90,6 @@
        <item>com.android.systemui.navigationbar.car.CarNavigationBar</item>
        <item>com.android.systemui.toast.ToastUI</item>
        <item>com.android.systemui.voicerecognition.car.ConnectedDeviceVoiceRecognitionNotifier</item>
        <item>com.android.systemui.window.SystemUIOverlayWindowManager</item>
    </string-array>
</resources>
+9 −1
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@ import com.android.systemui.toast.ToastUI;
import com.android.systemui.util.leak.GarbageMonitor;
import com.android.systemui.voicerecognition.car.ConnectedDeviceVoiceRecognitionNotifier;
import com.android.systemui.volume.VolumeUI;
import com.android.systemui.window.OverlayWindowModule;
import com.android.systemui.window.SystemUIOverlayWindowManager;

import dagger.Binds;
import dagger.Module;
@@ -47,7 +49,7 @@ import dagger.multibindings.IntoMap;

/** Binder for car specific {@link SystemUI} modules. */
@Module(includes = {RecentsModule.class, CarStatusBarModule.class, NotificationsModule.class,
        BubbleModule.class, KeyguardModule.class})
        BubbleModule.class, KeyguardModule.class, OverlayWindowModule.class})
public abstract class CarSystemUIBinder {
    /** Inject into AuthController. */
    @Binds
@@ -182,4 +184,10 @@ public abstract class CarSystemUIBinder {
    @ClassKey(ConnectedDeviceVoiceRecognitionNotifier.class)
    public abstract SystemUI bindConnectedDeviceVoiceRecognitionNotifier(
            ConnectedDeviceVoiceRecognitionNotifier sysui);

    /** Inject into SystemUIOverlayWindowManager. */
    @Binds
    @IntoMap
    @ClassKey(SystemUIOverlayWindowManager.class)
    public abstract SystemUI bindSystemUIPrimaryWindowManager(SystemUIOverlayWindowManager sysui);
}
Loading