Set dream overlay window title to System UI.
This changelist updates the window title for the dream overlay to match the System UI app label. Test: manual with TalkBack Fixes: 267837462 Change-Id: I319a3fdb3bad0f852501c20a588cc10c2621c55e
This commit is contained in:
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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 =
|
||||
@@ -244,7 +249,7 @@ public class DreamOverlayService extends android.service.dreams.DreamOverlayServ
|
||||
private void 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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -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
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,6 +69,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);
|
||||
|
||||
@@ -148,7 +149,8 @@ public class DreamOverlayServiceTest extends SysuiTestCase {
|
||||
mKeyguardUpdateMonitor,
|
||||
mUiEventLogger,
|
||||
LOW_LIGHT_COMPONENT,
|
||||
mDreamOverlayCallbackController);
|
||||
mDreamOverlayCallbackController,
|
||||
WINDOW_NAME);
|
||||
}
|
||||
|
||||
public IDreamOverlayClient getClient() throws RemoteException {
|
||||
|
||||
Reference in New Issue
Block a user