Loading packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayService.java +7 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -70,6 +72,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; Loading Loading @@ -134,7 +137,8 @@ public class DreamOverlayService extends android.service.dreams.DreamOverlayServ UiEventLogger uiEventLogger, @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; Loading @@ -144,6 +148,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 = Loading Loading @@ -251,7 +256,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); Loading packages/SystemUI/src/com/android/systemui/dreams/dagger/DreamModule.java +10 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -63,6 +64,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 Loading Loading @@ -136,4 +139,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); } } packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayServiceTest.java +3 −1 Original line number Diff line number Diff line Loading @@ -70,6 +70,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); Loading Loading @@ -149,7 +150,8 @@ public class DreamOverlayServiceTest extends SysuiTestCase { mKeyguardUpdateMonitor, mUiEventLogger, LOW_LIGHT_COMPONENT, mDreamOverlayCallbackController); mDreamOverlayCallbackController, WINDOW_NAME); } public IDreamOverlayClient getClient() throws RemoteException { Loading Loading
packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayService.java +7 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -70,6 +72,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; Loading Loading @@ -134,7 +137,8 @@ public class DreamOverlayService extends android.service.dreams.DreamOverlayServ UiEventLogger uiEventLogger, @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; Loading @@ -144,6 +148,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 = Loading Loading @@ -251,7 +256,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); Loading
packages/SystemUI/src/com/android/systemui/dreams/dagger/DreamModule.java +10 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -63,6 +64,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 Loading Loading @@ -136,4 +139,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); } }
packages/SystemUI/tests/src/com/android/systemui/dreams/DreamOverlayServiceTest.java +3 −1 Original line number Diff line number Diff line Loading @@ -70,6 +70,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); Loading Loading @@ -149,7 +150,8 @@ public class DreamOverlayServiceTest extends SysuiTestCase { mKeyguardUpdateMonitor, mUiEventLogger, LOW_LIGHT_COMPONENT, mDreamOverlayCallbackController); mDreamOverlayCallbackController, WINDOW_NAME); } public IDreamOverlayClient getClient() throws RemoteException { Loading