Re-adopt shell permissions before calling clearOverridesForTest.

This is done because some tests might drop shell permissions during
mTestStatement.evaluate() and therefore platformCompat#clearOverridesForTest would fail without re-adopting the shell permissions.

In addition we now drop shell permissions before calling
mTestStatement.evaluate() so that the test would only have the
permission it enables.

Test: Existing tests pass.
Fix: 182178917
Change-Id: I93566906430d3aadaac256026bf300d7811538f1
1 file changed