Backport test coverage from aosp/1547496.

This test coverage is necessary to fix an upcoming bug in R.
Backport it from the change that added it. The non-test portion
of that change is not necessary in R because it fixes a
bug that was introduced in S.

Bug: 172870110
Test: accompanying unit test shows lots of bugs removed
Change-Id: If7eb8857474d8b4f774f5fa5db2a3112e85c9cae
Merged-In: Ibf376a6fa4b34d1c96f8506fa8abbb7595a8c272
1 file changed
tree: 5e42f36aa2813c94ac8198cf1b59820b8c23716a
  1. core/
  2. services/
  3. tests/