From 8676673ca121058a7a4f8a67a2fa4d3235bfb6d2 Mon Sep 17 00:00:00 2001 From: Jeff Gaston Date: Tue, 22 Oct 2019 16:30:38 -0400 Subject: [PATCH] Replacing @Nullable/@NonNull with @RecentlyNullable/@RecentlyNonNull in non-android APIs because this causes callers of those APIs to only receive warnings from kotlinc rather than errors. Bug: 141748642 Test: m api-stubs-docs && \ cd out/target/common && mv docs docs-new && unzip docs-new/api-stubs-docs-stubs.srcjar -d docs-new/api-stubs-docs-stubs.srcjar_unzipped && cd - && \ cd frameworks/base && git checkout HEAD^ && cd - && m api-stubs-docs && \ cd out/target/common && mv docs docs-old && unzip docs-old/api-stubs-docs-stubs.srcjar -d docs-old/api-stubs-docs-stubs.srcjar_unzipped && \ diff -x "*.html" -r docs-old/ docs-new | grep -v "^diff" | sed 's/^/' | grep '^>' | sed 's|androidx.annotation.Recently|android.annotation.|g' | sort | uniq -c | grep "^ *1 " # And notice that there aren't any copies of "androidx.annotation.Recently" without a matching instance of "android.annotation." or vice versa Test: m api-stubs-docs && out/target/common/docs && unzip api-stubs-docs-stubs.srcjar -d unzipped && cd unzipped && \ grep -r "@.*NonNull" java | grep -v Recently && \ grep -r "@.*Nullable" java | grep -v Recently Change-Id: I156f1788880958cf3d1f030da829e76cefd6072e --- Android.bp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Android.bp b/Android.bp index 3b6eaa7a3afeb..3a6cee86e93a1 100644 --- a/Android.bp +++ b/Android.bp @@ -922,7 +922,8 @@ metalava_framework_docs_args = "--manifest $(location core/res/AndroidManifest.x "--hide RequiresPermission " + "--hide MissingPermission --hide BroadcastBehavior " + "--hide HiddenSuperclass --hide DeprecationMismatch --hide UnavailableSymbol " + - "--hide SdkConstant --hide HiddenTypeParameter --hide Todo --hide Typo " + "--hide SdkConstant --hide HiddenTypeParameter --hide Todo --hide Typo " + + "--force-convert-to-warning-nullability-annotations +*:-android.*:+android.icu.*:-dalvik.*" // http://b/129765390 Rewrite links to "platform" or "technotes" folders // which are siblings (and thus outside of) {@docRoot}.