Refactor a couple of places to ensure ResourceNamedTypeRef is valid when
used.

DD: go/custom-resource-types-in-aapt2

Bug: b/215108200
Test: existing
Change-Id: I7d16ca83f1f22d62f32792a24d3e0ebb88c2679c
2 files changed