Add @CovariantReturnType annotation to @CorePlatformApi.

The annotation tells the build toolchain to generate a synthetic
method overload that returns a different type, which is useful
to evolve an API to change its return type to become a more
specific sub-type. Note that a CTS test is needed to verify that
each expected overload is present at runtime.

Also, note that this CL also adds the nested annotation
@CovariantReturnTypes and its values() function to the
@CorePlatformApi because it is required by @Repeated.

For an existing example, see http://r.android.com/884453 (commit
d708f23a17ac382fde8ddda029430cf88821621f).

Test: Treehugger
Fixes: 139739718

Change-Id: I056074b0c3e741696636182ce70ebbe088aefc9e
2 files changed