Loading core/java/android/app/ContextImpl.java +2 −7 Original line number Diff line number Diff line Loading @@ -3466,13 +3466,8 @@ class ContextImpl extends Context { // Step 2. Create a SystemUiContext to wrap the ContextImpl, which enables to listen to // its config updates. final Context systemUiContext; if (com.android.window.flags.Flags.trackSystemUiContextBeforeWms()) { systemUiContext = new SystemUiContext(context); final SystemUiContext systemUiContext = new SystemUiContext(context); context.setOuterContext(systemUiContext); } else { systemUiContext = context; } token.attachContext(systemUiContext); // Step 3. Associate the SystemUiContext with the display specified with ID. Loading core/java/android/window/SystemUiContext.java +0 −6 Original line number Diff line number Diff line Loading @@ -23,8 +23,6 @@ import android.content.Context; import android.content.ContextWrapper; import android.content.res.Configuration; import com.android.window.flags.Flags; /** * System Context to be used for UI. This Context has resources that can be themed. * Loading @@ -39,10 +37,6 @@ public class SystemUiContext extends ContextWrapper implements ConfigurationDisp public SystemUiContext(Context base) { super(base); if (!Flags.trackSystemUiContextBeforeWms()) { throw new UnsupportedOperationException("SystemUiContext can only be used after" + " flag is enabled."); } } @Override Loading core/java/android/window/WindowTokenClientController.java +1 −4 Original line number Diff line number Diff line Loading @@ -37,7 +37,6 @@ import android.view.WindowManagerGlobal; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; import com.android.window.flags.Flags; /** * Singleton controller to manage the attached {@link WindowTokenClient}s, and to dispatch Loading Loading @@ -141,9 +140,7 @@ public class WindowTokenClientController { // is initialized later, the SystemUiContext will start reporting from // DisplayContent#registerSystemUiContext, and WindowTokenClientController can report // the Configuration to the correct client. if (Flags.trackSystemUiContextBeforeWms()) { recordWindowContextToken(client); } return false; } final WindowContextInfo info; Loading core/java/android/window/flags/windowing_sdk.aconfig +0 −11 Original line number Diff line number Diff line Loading @@ -96,17 +96,6 @@ flag { bug: "356277166" } flag { namespace: "windowing_sdk" name: "track_system_ui_context_before_wms" description: "Keep track of SystemUiContext before WMS is initialized" bug: "384428048" is_fixed_read_only: true metadata { purpose: PURPOSE_BUGFIX } } flag { namespace: "car_framework" name: "safe_region_letterboxing" Loading core/tests/coretests/src/android/content/ContextTest.java +3 −29 Original line number Diff line number Diff line Loading @@ -43,11 +43,8 @@ import android.graphics.PixelFormat; import android.hardware.display.DisplayManager; import android.hardware.display.VirtualDisplay; import android.media.ImageReader; import android.os.Looper; import android.os.UserHandle; import android.platform.test.annotations.DisableFlags; import android.platform.test.annotations.DisabledOnRavenwood; import android.platform.test.annotations.EnableFlags; import android.platform.test.annotations.Presubmit; import android.platform.test.flag.junit.SetFlagsRule; import android.platform.test.ravenwood.RavenwoodRule; Loading @@ -61,7 +58,6 @@ import androidx.test.filters.SmallTest; import androidx.test.platform.app.InstrumentationRegistry; import com.android.internal.util.GcUtils; import com.android.window.flags.Flags; import org.junit.Rule; import org.junit.Test; Loading Loading @@ -305,29 +301,7 @@ public class ContextTest { @Test @DisabledOnRavenwood(blockedBy = Context.class) @DisableFlags(Flags.FLAG_TRACK_SYSTEM_UI_CONTEXT_BEFORE_WMS) public void testSysUiContextRegisterComponentCallbacks_disableFlag() { Looper.prepare(); // Use createSystemActivityThreadForTesting to initialize // systemUiContext#getApplicationContext. final Context systemUiContext = ActivityThread.createSystemActivityThreadForTesting() .getSystemUiContext(); final TestComponentCallbacks2 callbacks = new TestComponentCallbacks2(); systemUiContext.registerComponentCallbacks(callbacks); final WindowTokenClient windowTokenClient = (WindowTokenClient) systemUiContext.getWindowContextToken(); windowTokenClient.onConfigurationChanged(Configuration.EMPTY, DEFAULT_DISPLAY); assertWithMessage("ComponentCallbacks should delegate to the app Context " + "if the flag is disabled.").that(callbacks.mConfiguration).isNull(); } @Test @DisabledOnRavenwood(blockedBy = Context.class) @EnableFlags(Flags.FLAG_TRACK_SYSTEM_UI_CONTEXT_BEFORE_WMS) public void testSysUiContextRegisterComponentCallbacks_enableFlag() { public void testSysUiContextRegisterComponentCallbacks() { final Context systemUiContext = ActivityThread.currentActivityThread() .createSystemUiContextForTesting(DEFAULT_DISPLAY); final TestComponentCallbacks2 callbacks = new TestComponentCallbacks2(); Loading @@ -339,8 +313,8 @@ public class ContextTest { (WindowTokenClient) systemUiContext.getWindowContextToken(); windowTokenClient.onConfigurationChanged(config, DEFAULT_DISPLAY); assertWithMessage("ComponentCallbacks should delegate to SystemUiContext " + "if the flag is enabled.").that(callbacks.mConfiguration).isEqualTo(config); assertWithMessage("ComponentCallbacks should delegate to SystemUiContext.") .that(callbacks.mConfiguration).isEqualTo(config); } @Test Loading Loading
core/java/android/app/ContextImpl.java +2 −7 Original line number Diff line number Diff line Loading @@ -3466,13 +3466,8 @@ class ContextImpl extends Context { // Step 2. Create a SystemUiContext to wrap the ContextImpl, which enables to listen to // its config updates. final Context systemUiContext; if (com.android.window.flags.Flags.trackSystemUiContextBeforeWms()) { systemUiContext = new SystemUiContext(context); final SystemUiContext systemUiContext = new SystemUiContext(context); context.setOuterContext(systemUiContext); } else { systemUiContext = context; } token.attachContext(systemUiContext); // Step 3. Associate the SystemUiContext with the display specified with ID. Loading
core/java/android/window/SystemUiContext.java +0 −6 Original line number Diff line number Diff line Loading @@ -23,8 +23,6 @@ import android.content.Context; import android.content.ContextWrapper; import android.content.res.Configuration; import com.android.window.flags.Flags; /** * System Context to be used for UI. This Context has resources that can be themed. * Loading @@ -39,10 +37,6 @@ public class SystemUiContext extends ContextWrapper implements ConfigurationDisp public SystemUiContext(Context base) { super(base); if (!Flags.trackSystemUiContextBeforeWms()) { throw new UnsupportedOperationException("SystemUiContext can only be used after" + " flag is enabled."); } } @Override Loading
core/java/android/window/WindowTokenClientController.java +1 −4 Original line number Diff line number Diff line Loading @@ -37,7 +37,6 @@ import android.view.WindowManagerGlobal; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; import com.android.window.flags.Flags; /** * Singleton controller to manage the attached {@link WindowTokenClient}s, and to dispatch Loading Loading @@ -141,9 +140,7 @@ public class WindowTokenClientController { // is initialized later, the SystemUiContext will start reporting from // DisplayContent#registerSystemUiContext, and WindowTokenClientController can report // the Configuration to the correct client. if (Flags.trackSystemUiContextBeforeWms()) { recordWindowContextToken(client); } return false; } final WindowContextInfo info; Loading
core/java/android/window/flags/windowing_sdk.aconfig +0 −11 Original line number Diff line number Diff line Loading @@ -96,17 +96,6 @@ flag { bug: "356277166" } flag { namespace: "windowing_sdk" name: "track_system_ui_context_before_wms" description: "Keep track of SystemUiContext before WMS is initialized" bug: "384428048" is_fixed_read_only: true metadata { purpose: PURPOSE_BUGFIX } } flag { namespace: "car_framework" name: "safe_region_letterboxing" Loading
core/tests/coretests/src/android/content/ContextTest.java +3 −29 Original line number Diff line number Diff line Loading @@ -43,11 +43,8 @@ import android.graphics.PixelFormat; import android.hardware.display.DisplayManager; import android.hardware.display.VirtualDisplay; import android.media.ImageReader; import android.os.Looper; import android.os.UserHandle; import android.platform.test.annotations.DisableFlags; import android.platform.test.annotations.DisabledOnRavenwood; import android.platform.test.annotations.EnableFlags; import android.platform.test.annotations.Presubmit; import android.platform.test.flag.junit.SetFlagsRule; import android.platform.test.ravenwood.RavenwoodRule; Loading @@ -61,7 +58,6 @@ import androidx.test.filters.SmallTest; import androidx.test.platform.app.InstrumentationRegistry; import com.android.internal.util.GcUtils; import com.android.window.flags.Flags; import org.junit.Rule; import org.junit.Test; Loading Loading @@ -305,29 +301,7 @@ public class ContextTest { @Test @DisabledOnRavenwood(blockedBy = Context.class) @DisableFlags(Flags.FLAG_TRACK_SYSTEM_UI_CONTEXT_BEFORE_WMS) public void testSysUiContextRegisterComponentCallbacks_disableFlag() { Looper.prepare(); // Use createSystemActivityThreadForTesting to initialize // systemUiContext#getApplicationContext. final Context systemUiContext = ActivityThread.createSystemActivityThreadForTesting() .getSystemUiContext(); final TestComponentCallbacks2 callbacks = new TestComponentCallbacks2(); systemUiContext.registerComponentCallbacks(callbacks); final WindowTokenClient windowTokenClient = (WindowTokenClient) systemUiContext.getWindowContextToken(); windowTokenClient.onConfigurationChanged(Configuration.EMPTY, DEFAULT_DISPLAY); assertWithMessage("ComponentCallbacks should delegate to the app Context " + "if the flag is disabled.").that(callbacks.mConfiguration).isNull(); } @Test @DisabledOnRavenwood(blockedBy = Context.class) @EnableFlags(Flags.FLAG_TRACK_SYSTEM_UI_CONTEXT_BEFORE_WMS) public void testSysUiContextRegisterComponentCallbacks_enableFlag() { public void testSysUiContextRegisterComponentCallbacks() { final Context systemUiContext = ActivityThread.currentActivityThread() .createSystemUiContextForTesting(DEFAULT_DISPLAY); final TestComponentCallbacks2 callbacks = new TestComponentCallbacks2(); Loading @@ -339,8 +313,8 @@ public class ContextTest { (WindowTokenClient) systemUiContext.getWindowContextToken(); windowTokenClient.onConfigurationChanged(config, DEFAULT_DISPLAY); assertWithMessage("ComponentCallbacks should delegate to SystemUiContext " + "if the flag is enabled.").that(callbacks.mConfiguration).isEqualTo(config); assertWithMessage("ComponentCallbacks should delegate to SystemUiContext.") .that(callbacks.mConfiguration).isEqualTo(config); } @Test Loading