Make smali compilations deterministic

The smali compilation in run-tests are non-deterministic.
However, we don't observe that much, as most tests are
dex-merged by D8 which normalize it back to deterministic.

The non-determinism is only observed for few tests where
well-intended short-cut bypasses the dex merger.  Let's
remove that short-cut to get deterministic build output.

Also pass the proper test's API level to the dex merger.
This avoids bumping dex file version to maximum as side
effect of the no-op merge.  It also avoids excessive log
spam as the previous input was invalid.  And it avoids
bumping the dex file version to max for tests that need
merge, which gives us more version variety for tests.

Bug: 147814778
Test: test.py --host
Change-Id: I4af262aef3305a90d8cb8d14d87f7c52b9dd734a
4 files changed