Make SizeCompatTests support compat annotation by default
By default the unit test uses "com.foo" as the package name of
test ActivityRecord. But because ApplicationInfo#isChangeEnabled
requires a valid package name to get compat flag value, the test
record should use a real package name if it is interested in the
compat override.
Previously it was done by using getActivityBuilderOnSameTask to
create another ActivityRecord with specified package name.
Now because the default record already has the valid package name,
it no longer needs to create additional record. So this also
reduces the execution time of each 28 tests by ~500ms.
OVERRIDE_ENABLE_INSETS_DECOUPLED_CONFIGURATION are added to some
tests now, because they relied on the behavior of invalid package.
That means the behavior of the tests in the test class can be more
explicit and consistent, e.g. make sure the annotation take effect
for all test methods in SizeCompatTests.
Bug: 159102753
Bug: 357141415
Flag: EXEMPT simplify unit test
Test: atest SizeCompatTests
Change-Id: Icd7b374f2bd096b56d91dea3ecd8efedefa93c9b
1 file changed