summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandra Ducati-Manas <alexandra.ducati-manas@st.com>2024-04-18 17:31:20 +0200
committerGeorge Chang <georgekgchang@google.com>2024-04-26 01:06:18 +0000
commit0e53a49c0e0797820f7d88338b4b29d513c2ea69 (patch)
tree1f16ac1751cf308b09604bdb7c7228f9e2e91c83
parent59d4377e8ccc1cc5c5e60d97d99679ea09fe18d0 (diff)
downloadNfc-0e53a49c0e0797820f7d88338b4b29d513c2ea69.tar.gz
Code cleanup: removed NativeP2pDevice file and dependencies
Bug: 335639730 Teset: manual Merged-In: If38f563e7342a8d99d4f88ada0529a26cff1df93 Change-Id: If38f563e7342a8d99d4f88ada0529a26cff1df93
-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
-rwxr-xr-xnci/src/com/android/nfc/dhimpl/NativeP2pDevice.java76
5 files changed, 0 insertions, 169 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 896f6561..786f3974 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";
@@ -682,12 +680,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 df2f2fad..e2b6559f 100644
--- a/nci/jni/NfcJniUtil.h
+++ b/nci/jni/NfcJniUtil.h
@@ -112,7 +112,6 @@ struct nfc_jni_native_data {
/* Cached objects */
jobject cached_NfcTag;
- jobject cached_P2pDevice;
/* Secure Element selected */
int seId;
@@ -156,5 +155,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
diff --git a/nci/src/com/android/nfc/dhimpl/NativeP2pDevice.java b/nci/src/com/android/nfc/dhimpl/NativeP2pDevice.java
deleted file mode 100755
index 1b1359bc..00000000
--- a/nci/src/com/android/nfc/dhimpl/NativeP2pDevice.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2010 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.nfc.dhimpl;
-
-import com.android.nfc.DeviceHost.NfcDepEndpoint;
-
-/**
- * Native interface to the P2P Initiator functions
- */
-public class NativeP2pDevice implements NfcDepEndpoint {
-
- private int mHandle;
-
- private int mMode;
-
- private byte[] mGeneralBytes;
-
- private native byte[] doReceive();
- @Override
- public byte[] receive() {
- return doReceive();
- }
-
- private native boolean doSend(byte[] data);
- @Override
- public boolean send(byte[] data) {
- return doSend(data);
- }
-
- private native boolean doConnect();
- @Override
- public boolean connect() {
- return doConnect();
- }
-
- private native boolean doDisconnect();
- @Override
- public boolean disconnect() {
- return doDisconnect();
- }
-
- public native byte[] doTransceive(byte[] data);
- @Override
- public byte[] transceive(byte[] data) {
- return doTransceive(data);
- }
-
- @Override
- public int getHandle() {
- return mHandle;
- }
-
- @Override
- public int getMode() {
- return mMode;
- }
-
- @Override
- public byte[] getGeneralBytes() {
- return mGeneralBytes;
- }
-}