Postpone setting background when window is set.
The DecorView background is the same as the window background.
If a background is set before the DecorView's window is set,
setWindowBackground will throw an NPE.
This happens when the default theme has android:view set with a
non-null value, so the background is set within the super constructor
(in View.java) before the PhoneWindow is set in the constructor of
DecorView.
Fixes: 137764086
Test: regression test DecoreViewTest.setBackgroundWithNoWindow()
Change-Id: I3b3c31cfe50ffa7284a1b37ca4b2f864be77c838
3 files changed