Merge "Code cleanup: removed NativeP2pDevice file and dependencies" into main
diff --git a/nci/jni/JavaClassConstants.h b/nci/jni/JavaClassConstants.h
index b619e74..e3d9de4 100644
--- a/nci/jni/JavaClassConstants.h
+++ b/nci/jni/JavaClassConstants.h
@@ -29,7 +29,6 @@
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 c5478d8..c8b7e59 100644
--- a/nci/jni/NativeNfcManager.cpp
+++ b/nci/jni/NativeNfcManager.cpp
@@ -98,8 +98,6 @@
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 @@
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 efb8252..0000000
--- 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 6e09c7f..b1bedfa 100644
--- a/nci/jni/NfcJniUtil.h
+++ b/nci/jni/NfcJniUtil.h
@@ -105,7 +105,6 @@
/* Cached objects */
jobject cached_NfcTag;
- jobject cached_P2pDevice;
/* Secure Element selected */
int seId;
@@ -143,5 +142,4 @@
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 1b1359b..0000000
--- 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;
- }
-}