summaryrefslogtreecommitdiff
path: root/nci/jni
diff options
context:
space:
mode:
authorTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2024-04-26 01:46:23 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2024-04-26 01:46:23 +0000
commitbd88e0e9303a3ecb0fcf4dc91b476e3cde618ed6 (patch)
treedcd17b50556cbdedbcf3f21bce1b52418a0661ed /nci/jni
parent259012c8e6f25e88e898f82bb7ca912f23204258 (diff)
parent0e53a49c0e0797820f7d88338b4b29d513c2ea69 (diff)
downloadNfc-bd88e0e9303a3ecb0fcf4dc91b476e3cde618ed6.tar.gz
Merge "Code cleanup: removed NativeP2pDevice file and dependencies" into main
Diffstat (limited to 'nci/jni')
-rw-r--r--nci/jni/JavaClassConstants.h1
-rw-r--r--nci/jni/NativeNfcManager.cpp8
-rw-r--r--nci/jni/NativeP2pDevice.cpp82
-rw-r--r--nci/jni/NfcJniUtil.h2
4 files changed, 0 insertions, 93 deletions
diff --git a/nci/jni/JavaClassConstants.h b/nci/jni/JavaClassConstants.h
index b619e743..e3d9de49 100644
--- a/nci/jni/JavaClassConstants.h
+++ b/nci/jni/JavaClassConstants.h
@@ -29,7 +29,6 @@ extern jmethodID gCachedNfcManagerNotifyHostEmuDeactivated;
extern jmethodID gCachedNfcManagerNotifyEeUpdated;
-extern const char* gNativeP2pDeviceClassName;
extern const char* gNativeNfcTagClassName;
extern const char* gNativeNfcManagerClassName;
} // namespace android
diff --git a/nci/jni/NativeNfcManager.cpp b/nci/jni/NativeNfcManager.cpp
index c5478d8e..c8b7e59b 100644
--- a/nci/jni/NativeNfcManager.cpp
+++ b/nci/jni/NativeNfcManager.cpp
@@ -98,8 +98,6 @@ jmethodID gCachedNfcManagerNotifyHwErrorReported;
jmethodID gCachedNfcManagerNotifyPollingLoopFrame;
jmethodID gCachedNfcManagerNotifyVendorSpecificEvent;
jmethodID gCachedNfcManagerNotifyCommandTimeout;
-const char* gNativeP2pDeviceClassName =
- "com/android/nfc/dhimpl/NativeP2pDevice";
const char* gNativeNfcTagClassName = "com/android/nfc/dhimpl/NativeNfcTag";
const char* gNativeNfcManagerClassName =
"com/android/nfc/dhimpl/NativeNfcManager";
@@ -618,12 +616,6 @@ static jboolean nfcManager_initNativeStruc(JNIEnv* e, jobject o) {
return JNI_FALSE;
}
- if (nfc_jni_cache_object(e, gNativeP2pDeviceClassName,
- &(nat->cached_P2pDevice)) == -1) {
- LOG(ERROR) << StringPrintf("%s: fail cache NativeP2pDevice", __func__);
- return JNI_FALSE;
- }
-
LOG(DEBUG) << StringPrintf("%s: exit", __func__);
return JNI_TRUE;
}
diff --git a/nci/jni/NativeP2pDevice.cpp b/nci/jni/NativeP2pDevice.cpp
deleted file mode 100644
index efb82526..00000000
--- a/nci/jni/NativeP2pDevice.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2012 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.
- */
-
-#include <android-base/logging.h>
-#include <android-base/stringprintf.h>
-#include <log/log.h>
-#include <nativehelper/JNIHelp.h>
-
-#include "JavaClassConstants.h"
-#include "NfcJniUtil.h"
-
-using android::base::StringPrintf;
-
-namespace android {
-
-static jboolean nativeP2pDeviceDoConnect(JNIEnv*, jobject) {
- LOG(DEBUG) << StringPrintf("%s", __func__);
- return JNI_TRUE;
-}
-
-static jboolean nativeP2pDeviceDoDisconnect(JNIEnv*, jobject) {
- LOG(DEBUG) << StringPrintf("%s", __func__);
- return JNI_TRUE;
-}
-
-static jbyteArray nativeP2pDeviceDoTransceive(JNIEnv*, jobject, jbyteArray) {
- LOG(DEBUG) << StringPrintf("%s", __func__);
- return NULL;
-}
-
-static jbyteArray nativeP2pDeviceDoReceive(JNIEnv*, jobject) {
- LOG(DEBUG) << StringPrintf("%s", __func__);
- return NULL;
-}
-
-static jboolean nativeP2pDeviceDoSend(JNIEnv*, jobject, jbyteArray) {
- LOG(DEBUG) << StringPrintf("%s", __func__);
- return JNI_TRUE;
-}
-
-/*****************************************************************************
-**
-** Description: JNI functions
-**
-*****************************************************************************/
-static JNINativeMethod gMethods[] = {
- {"doConnect", "()Z", (void*)nativeP2pDeviceDoConnect},
- {"doDisconnect", "()Z", (void*)nativeP2pDeviceDoDisconnect},
- {"doTransceive", "([B)[B", (void*)nativeP2pDeviceDoTransceive},
- {"doReceive", "()[B", (void*)nativeP2pDeviceDoReceive},
- {"doSend", "([B)Z", (void*)nativeP2pDeviceDoSend},
-};
-
-/*******************************************************************************
-**
-** Function: register_com_android_nfc_NativeP2pDevice
-**
-** Description: Regisgter JNI functions with Java Virtual Machine.
-** e: Environment of JVM.
-**
-** Returns: Status of registration.
-**
-*******************************************************************************/
-int register_com_android_nfc_NativeP2pDevice(JNIEnv* e) {
- return jniRegisterNativeMethods(e, gNativeP2pDeviceClassName, gMethods,
- NELEM(gMethods));
-}
-
-} // namespace android
diff --git a/nci/jni/NfcJniUtil.h b/nci/jni/NfcJniUtil.h
index 6e09c7fc..b1bedfa8 100644
--- a/nci/jni/NfcJniUtil.h
+++ b/nci/jni/NfcJniUtil.h
@@ -105,7 +105,6 @@ struct nfc_jni_native_data {
/* Cached objects */
jobject cached_NfcTag;
- jobject cached_P2pDevice;
/* Secure Element selected */
int seId;
@@ -143,5 +142,4 @@ int nfc_jni_get_nfc_socket_handle(JNIEnv* e, jobject o);
struct nfc_jni_native_data* nfc_jni_get_nat(JNIEnv* e, jobject o);
int register_com_android_nfc_NativeNfcManager(JNIEnv* e);
int register_com_android_nfc_NativeNfcTag(JNIEnv* e);
-int register_com_android_nfc_NativeP2pDevice(JNIEnv* e);
} // namespace android