Fix inflation using themed LayoutInflater

We currently use a flaky heuristic for detecting
whether we should inherit a parents context when
inflating a child. This fails when the root
parent the layout is being inflated in to, is
not attached.

This CL introduces a new heuristic which handles
this case.

Test: included and passes on all API levels.
BUG: 33799622
Change-Id: I71cdc9ba0a6450e6b4c3e371b83621ecb2aed7e5
3 files changed