Prevent DecorContext from creating DisplayContext for default display.

The previous implementation of createDisplayContext() was essentially a
noop within ResourcesManager when the default display was passed. However,
the current implementation always overrides the configuration with the provided
display's metrics so when a DecorContext with the default display is
created a new ResourcesImpl object is also created due to the difference in
configuration. This CL changes the DecorContext logic to match the
previous implemenation where the configuration is only overriden for a
non-default display thus only creating a new ResourcesImpl object for
non-default displays.

Bug: 166174272
Test: atest google/perf/app-startup/benchmark-app-hermetic/cold-dropcache-test -v
Test: atest com.android.internal.policy.DecorContextTest

Change-Id: I05920c4f7987ffcaec8b197e8636606c04b418d4
2 files changed