Loading core/java/android/window/WindowContext.java +4 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,10 @@ public class WindowContext extends ContextWrapper implements WindowProvider, Flags.FLAG_REPARENT_TO_DEFAULT_WITH_DISPLAY_REMOVAL + " is not enabled"); } Reference.reachabilityFence(this); if (android.view.accessibility.Flags.forceInvertColor()) { // Use the theme of the application as the default theme for this window context. base.setTheme(getApplicationInfo().theme); } } /** Loading core/tests/coretests/src/android/window/WindowContextTest.java +10 −0 Original line number Diff line number Diff line Loading @@ -208,6 +208,16 @@ public class WindowContextTest { }); } @EnableFlags(android.view.accessibility.Flags.FLAG_FORCE_INVERT_COLOR) @Test public void testCreateWindowContext_applicationTheme() { final WindowContext windowContext = createWindowContext(); final int applicationTheme = mInstrumentation.getTargetContext().getApplicationInfo().theme; assertThat(windowContext.getThemeResId()).isEqualTo(applicationTheme); } /** * Verifies the behavior when window context attaches an {@link Activity} by override * {@link WindowManager.LayoutParams#token}. Loading Loading
core/java/android/window/WindowContext.java +4 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,10 @@ public class WindowContext extends ContextWrapper implements WindowProvider, Flags.FLAG_REPARENT_TO_DEFAULT_WITH_DISPLAY_REMOVAL + " is not enabled"); } Reference.reachabilityFence(this); if (android.view.accessibility.Flags.forceInvertColor()) { // Use the theme of the application as the default theme for this window context. base.setTheme(getApplicationInfo().theme); } } /** Loading
core/tests/coretests/src/android/window/WindowContextTest.java +10 −0 Original line number Diff line number Diff line Loading @@ -208,6 +208,16 @@ public class WindowContextTest { }); } @EnableFlags(android.view.accessibility.Flags.FLAG_FORCE_INVERT_COLOR) @Test public void testCreateWindowContext_applicationTheme() { final WindowContext windowContext = createWindowContext(); final int applicationTheme = mInstrumentation.getTargetContext().getApplicationInfo().theme; assertThat(windowContext.getThemeResId()).isEqualTo(applicationTheme); } /** * Verifies the behavior when window context attaches an {@link Activity} by override * {@link WindowManager.LayoutParams#token}. Loading