Merge "Revert "Set parent for WindowProcessController"" into qt-dev

This commit is contained in:
TreeHugger Robot
2019-05-20 13:58:25 +00:00
committed by Android (Google) Code Review
3 changed files with 2 additions and 27 deletions

View File

@@ -439,10 +439,7 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio
@Override
protected ConfigurationContainer getParent() {
// Returning RootActivityContainer as the parent, so that this process controller always
// has full configuration and overrides (e.g. from display) are always added on top of
// global config.
return mAtm.mRootActivityContainer;
return null;
}
@HotPath(caller = HotPath.PROCESS_CHANGE)

View File

@@ -3104,7 +3104,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
if (DEBUG_RESIZE || DEBUG_ORIENTATION) Slog.v(TAG, "Reporting new frame to " + this
+ ": " + mWindowFrames.mCompatFrame);
final MergedConfiguration mergedConfiguration =
new MergedConfiguration(getProcessGlobalConfiguration(),
new MergedConfiguration(mWmService.mRoot.getConfiguration(),
getMergedOverrideConfiguration());
setLastReportedMergedConfiguration(mergedConfiguration);

View File

@@ -26,9 +26,7 @@ import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import android.content.pm.ApplicationInfo;
import android.content.res.Configuration;
import android.platform.test.annotations.Presubmit;
import android.view.DisplayInfo;
import org.junit.Test;
@@ -80,26 +78,6 @@ public class WindowProcessControllerTests extends ActivityTestsBase {
assertEquals(INVALID_DISPLAY, wpc.getDisplayId());
}
@Test
public void testConfigurationForSecondaryScreen() {
final WindowProcessController wpc = new WindowProcessController(
mService, mock(ApplicationInfo.class), null, 0, -1, null, null);
//By default, the process should not listen to any display.
assertEquals(INVALID_DISPLAY, wpc.getDisplayId());
// Register to a new display as a listener.
final DisplayInfo info = new DisplayInfo();
info.logicalWidth = 100;
info.logicalHeight = 100;
TestActivityDisplay display = addNewActivityDisplayAt(info, WindowContainer.POSITION_TOP);
wpc.registerDisplayConfigurationListenerLocked(display);
assertEquals(display.mDisplayId, wpc.getDisplayId());
final Configuration expectedConfig = mService.mRootActivityContainer.getConfiguration();
expectedConfig.updateFrom(display.getConfiguration());
assertEquals(expectedConfig, wpc.getConfiguration());
}
private TestActivityDisplay createTestActivityDisplayInContainer() {
final TestActivityDisplay testActivityDisplay = createNewActivityDisplay();
mRootActivityContainer.addChild(testActivityDisplay, POSITION_TOP);