From 3ff56d044b5412979ff163158b1aa9b77a216431 Mon Sep 17 00:00:00 2001 From: Magnus Jedvert Date: Mon, 25 Sep 2017 14:40:30 +0200 Subject: [PATCH] Android: Add CalledByNative annotation interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This annotation will be used to annotate Java classes that are referenced from native code. Bug: webrtc:8278 Change-Id: Icf020927d377ba04304ddbf92639e6ef174de22c Reviewed-on: https://webrtc-review.googlesource.com/3300 Reviewed-by: Sami Kalliomäki Commit-Queue: Magnus Jedvert Cr-Commit-Position: refs/heads/master@{#19951} --- sdk/android/BUILD.gn | 1 + .../src/java/org/webrtc/CalledByNative.java | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 sdk/android/src/java/org/webrtc/CalledByNative.java diff --git a/sdk/android/BUILD.gn b/sdk/android/BUILD.gn index 21359ccd9a..c30f0478d8 100644 --- a/sdk/android/BUILD.gn +++ b/sdk/android/BUILD.gn @@ -434,6 +434,7 @@ android_library("libjingle_peerconnection_java") { "src/java/org/webrtc/AndroidVideoTrackSourceObserver.java", "src/java/org/webrtc/BaseBitrateAdjuster.java", "src/java/org/webrtc/BitrateAdjuster.java", + "src/java/org/webrtc/CalledByNative.java", "src/java/org/webrtc/Camera1Session.java", "src/java/org/webrtc/Camera2Session.java", "src/java/org/webrtc/CameraCapturer.java", diff --git a/sdk/android/src/java/org/webrtc/CalledByNative.java b/sdk/android/src/java/org/webrtc/CalledByNative.java new file mode 100644 index 0000000000..7e08328e27 --- /dev/null +++ b/sdk/android/src/java/org/webrtc/CalledByNative.java @@ -0,0 +1,24 @@ +/* + * Copyright 2017 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +package org.webrtc; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * @CalledByNative is used by the JNI generator to create the necessary JNI + * bindings and expose this method to native code. + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.CLASS) +@interface CalledByNative {}