EmailTests: Use language level consistent with SDK version.
Before this CL, EmailTests was built using SDK version 14 but the default
LOCAL_JAVA_LANGUAGE_VERSION (currently 1.8). This breaks compilation on
recent OpenJDK tool chain versions: When targeting versions >= 1.7, those
generate synthetic calls to java.util.Objects.requireNonNull(), but that
API is only available from Android API level 19 onwards.
This CL fixes this issue by explicitly setting
LOCAL_JAVA_LANGUAGE_VERSION := 1.6
rather than tracking the current default.
Changing the LOCAL_SDK_VERSION to 19 would also have worked for the
particular issue of Objects.requireNonNull(), but the language version
and SDK used to built would then still have been inconsistent which
could have led to other issues in future.
If EmailTests ever needs to use later language features or APIs, the
SDK version and language version can be changed to higher versions then.
In the last year, packages/apps/Email has only seen one (security fix)
CL. Also, 31 out of the 158 tests in EmailTests currently fail via:
adb shell am instrument -w \
Test: make Email EmailTests
1 file changed