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

Commit 40cf937a authored by Bryce Lee's avatar Bryce Lee Committed by Automerger Merge Worker
Browse files

Merge "Set dream overlay window title to System UI." into tm-qpr-dev am: 31773d21 am: e0eaadb0

parents 7d3692d1 e0eaadb0
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.systemui.dreams;

import static com.android.systemui.dreams.dagger.DreamModule.DREAM_OVERLAY_WINDOW_TITLE;

import android.content.ComponentName;
import android.content.Context;
import android.graphics.drawable.ColorDrawable;
@@ -76,6 +78,7 @@ public class DreamOverlayService extends android.service.dreams.DreamOverlayServ
    private final ComponentName mLowLightDreamComponent;
    private final UiEventLogger mUiEventLogger;
    private final WindowManager mWindowManager;
    private final String mWindowTitle;

    // A reference to the {@link Window} used to hold the dream overlay.
    private Window mWindow;
@@ -151,7 +154,8 @@ public class DreamOverlayService extends android.service.dreams.DreamOverlayServ
            TouchInsetManager touchInsetManager,
            @Nullable @Named(LowLightDreamModule.LOW_LIGHT_DREAM_COMPONENT)
                    ComponentName lowLightDreamComponent,
            DreamOverlayCallbackController dreamOverlayCallbackController) {
            DreamOverlayCallbackController dreamOverlayCallbackController,
            @Named(DREAM_OVERLAY_WINDOW_TITLE) String windowTitle) {
        mContext = context;
        mExecutor = executor;
        mWindowManager = windowManager;
@@ -161,6 +165,7 @@ public class DreamOverlayService extends android.service.dreams.DreamOverlayServ
        mStateController = stateController;
        mUiEventLogger = uiEventLogger;
        mDreamOverlayCallbackController = dreamOverlayCallbackController;
        mWindowTitle = windowTitle;

        final ViewModelStore viewModelStore = new ViewModelStore();
        final Complication.Host host =
@@ -277,7 +282,7 @@ public class DreamOverlayService extends android.service.dreams.DreamOverlayServ
    private boolean addOverlayWindowLocked(WindowManager.LayoutParams layoutParams) {
        mWindow = new PhoneWindow(mContext);
        // Default to SystemUI name for TalkBack.
        mWindow.setTitle("");
        mWindow.setTitle(mWindowTitle);
        mWindow.setAttributes(layoutParams);
        mWindow.setWindowManager(null, layoutParams.token, "DreamOverlay", true);

+10 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.content.res.Resources;

import com.android.dream.lowlight.dagger.LowLightDreamModule;
import com.android.settingslib.dream.DreamBackend;
import com.android.systemui.R;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.dreams.DreamOverlayNotificationCountProvider;
@@ -66,6 +67,8 @@ public interface DreamModule {
    String DREAM_SUPPORTED = "dream_supported";
    String DREAM_PRETEXT_CONDITIONS = "dream_pretext_conditions";
    String DREAM_PRETEXT_MONITOR = "dream_prtext_monitor";
    String DREAM_OVERLAY_WINDOW_TITLE = "dream_overlay_window_title";


    /**
     * Provides the dream component
@@ -139,4 +142,11 @@ public interface DreamModule {
            @Named(DREAM_PRETEXT_CONDITIONS) Set<Condition> pretextConditions) {
        return new Monitor(executor, pretextConditions);
    }

    /** */
    @Provides
    @Named(DREAM_OVERLAY_WINDOW_TITLE)
    static String providesDreamOverlayWindowTitle(@Main Resources resources) {
        return resources.getString(R.string.app_label);
    }
}
+3 −1
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ public class DreamOverlayServiceTest extends SysuiTestCase {
    private static final ComponentName LOW_LIGHT_COMPONENT = new ComponentName("package",
            "lowlight");
    private static final String DREAM_COMPONENT = "package/dream";
    private static final String WINDOW_NAME = "test";
    private final FakeSystemClock mFakeSystemClock = new FakeSystemClock();
    private final FakeExecutor mMainExecutor = new FakeExecutor(mFakeSystemClock);

@@ -190,7 +191,8 @@ public class DreamOverlayServiceTest extends SysuiTestCase {
                mUiEventLogger,
                mTouchInsetManager,
                LOW_LIGHT_COMPONENT,
                mDreamOverlayCallbackController);
                mDreamOverlayCallbackController,
                WINDOW_NAME);
    }

    public IDreamOverlayClient getClient() throws RemoteException {