From c20c32784f927e9198ed2d13e8999a98bd87bdec Mon Sep 17 00:00:00 2001 From: mrenouf Date: Fri, 1 Mar 2024 08:23:31 -0500 Subject: Adds @JavaInterop, a @RequiresOptIn for marking Java interop code "This is a a property, function or class specifically supporting Java interoperability. Usage from Kotlin should be limited to interactions with Java" Bug: 309960444 Test: This is just an annotation. Change-Id: Ia2f21bd5d4359ba22e1292ebebbef77707706ac9 --- .../intentresolver/v2/annotation/JavaInterop.kt | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 java/src/com/android/intentresolver/v2/annotation/JavaInterop.kt (limited to 'java/src/com') diff --git a/java/src/com/android/intentresolver/v2/annotation/JavaInterop.kt b/java/src/com/android/intentresolver/v2/annotation/JavaInterop.kt new file mode 100644 index 00000000..15c5018a --- /dev/null +++ b/java/src/com/android/intentresolver/v2/annotation/JavaInterop.kt @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2024 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.intentresolver.v2.annotation + +/** + * Apply to code which exists specifically to easy integration with existing Java and Java APIs. + * + * The goal is to prevent usage from Kotlin when a more idiomatic alternative is available. + */ +@RequiresOptIn("This is a a property, function or class specifically supporting Java " + + "interoperability. Usage from Kotlin should be limited to interactions with Java.") +annotation class JavaInterop -- cgit v1.2.3-59-g8ed1b