summaryrefslogtreecommitdiffstats
path: root/nci
diff options
context:
space:
mode:
authorEvan Chu <evanchu@broadcom.com>2012-08-17 12:36:09 -0400
committerMartijn Coenen <maco@google.com>2012-08-28 16:14:42 +0200
commit8e9cdd7891bc1d6589b6d51b7c39efc87a64ba5e (patch)
treeac156028a404aa09ed272bb72debcd25fd87d01a /nci
parentdfc52b4bafc435e72d25aaba736612352bfd0581 (diff)
downloadpackages_apps_nfc-8e9cdd7891bc1d6589b6d51b7c39efc87a64ba5e.zip
packages_apps_nfc-8e9cdd7891bc1d6589b6d51b7c39efc87a64ba5e.tar.gz
packages_apps_nfc-8e9cdd7891bc1d6589b6d51b7c39efc87a64ba5e.tar.bz2
Create JavaClassConstants.h to store some global names
Create JavaClassConstants.h to store some global names Change-Id: I918d9e8f6db646f637cddbebbc2c4e5c5495623d
Diffstat (limited to 'nci')
-rw-r--r--nci/jni/JavaClassConstants.h36
-rw-r--r--nci/jni/NativeLlcpConnectionlessSocket.cpp4
-rw-r--r--nci/jni/NativeLlcpServiceSocket.cpp5
-rw-r--r--nci/jni/NativeLlcpSocket.cpp4
-rwxr-xr-xnci/jni/NativeNfcManager.cpp1
-rwxr-xr-xnci/jni/NativeNfcTag.cpp2
-rw-r--r--nci/jni/NativeP2pDevice.cpp4
-rwxr-xr-xnci/jni/NativeSecureElement.cpp2
-rwxr-xr-xnci/jni/NfcTag.cpp7
-rw-r--r--nci/jni/PeerToPeer.cpp3
-rwxr-xr-xnci/jni/SecureElement.cpp13
11 files changed, 48 insertions, 33 deletions
diff --git a/nci/jni/JavaClassConstants.h b/nci/jni/JavaClassConstants.h
new file mode 100644
index 0000000..fb71757
--- /dev/null
+++ b/nci/jni/JavaClassConstants.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ * Copyright (C) 2012 Broadcom Corporation
+ *
+ * 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.
+ */
+#pragma once
+
+
+namespace android
+{
+ extern jmethodID gCachedNfcManagerNotifyNdefMessageListeners;
+ extern jmethodID gCachedNfcManagerNotifyTransactionListeners;
+ extern jmethodID gCachedNfcManagerNotifyLlcpLinkActivation;
+ extern jmethodID gCachedNfcManagerNotifyLlcpLinkDeactivated;
+ extern jmethodID gCachedNfcManagerNotifySeFieldActivated;
+ extern jmethodID gCachedNfcManagerNotifySeFieldDeactivated;
+
+ extern const char* gNativeP2pDeviceClassName;
+ extern const char* gNativeLlcpServiceSocketClassName;
+ extern const char* gNativeLlcpConnectionlessSocketClassName;
+ extern const char* gNativeLlcpSocketClassName;
+ extern const char* gNativeNfcTagClassName;
+ extern const char* gNativeNfcManagerClassName;
+ extern const char* gNativeNfcSecureElementClassName;
+}
diff --git a/nci/jni/NativeLlcpConnectionlessSocket.cpp b/nci/jni/NativeLlcpConnectionlessSocket.cpp
index 2c4618f..a278844 100644
--- a/nci/jni/NativeLlcpConnectionlessSocket.cpp
+++ b/nci/jni/NativeLlcpConnectionlessSocket.cpp
@@ -19,6 +19,7 @@
#include <errno.h>
#include "OverrideLog.h"
#include "NfcJniUtil.h"
+#include "JavaClassConstants.h"
extern "C"
{
#include "nfa_api.h"
@@ -30,9 +31,6 @@ namespace android
{
-extern char* gNativeLlcpConnectionlessSocketClassName;
-
-
/*****************************************************************************
**
** private variables and functions
diff --git a/nci/jni/NativeLlcpServiceSocket.cpp b/nci/jni/NativeLlcpServiceSocket.cpp
index 7572690..ac00f61 100644
--- a/nci/jni/NativeLlcpServiceSocket.cpp
+++ b/nci/jni/NativeLlcpServiceSocket.cpp
@@ -19,6 +19,7 @@
#include "NfcJniUtil.h"
#include "NfcAdaptation.h"
#include "PeerToPeer.h"
+#include "JavaClassConstants.h"
extern "C"
{
#include "nfa_api.h"
@@ -30,10 +31,6 @@ namespace android
{
-extern char* gNativeLlcpServiceSocketClassName;
-extern char* gNativeLlcpSocketClassName;
-
-
/*******************************************************************************
**
** Function: nativeLlcpServiceSocket_doAccept
diff --git a/nci/jni/NativeLlcpSocket.cpp b/nci/jni/NativeLlcpSocket.cpp
index f0f0d3d..55a4a76 100644
--- a/nci/jni/NativeLlcpSocket.cpp
+++ b/nci/jni/NativeLlcpSocket.cpp
@@ -16,15 +16,13 @@
*/
#include "OverrideLog.h"
#include "PeerToPeer.h"
+#include "JavaClassConstants.h"
namespace android
{
-extern char* gNativeLlcpSocketClassName;
-
-
/*******************************************************************************
**
** Function: nativeLlcpSocket_doConnect
diff --git a/nci/jni/NativeNfcManager.cpp b/nci/jni/NativeNfcManager.cpp
index 69a9c3f..20bdd96 100755
--- a/nci/jni/NativeNfcManager.cpp
+++ b/nci/jni/NativeNfcManager.cpp
@@ -26,6 +26,7 @@
#include "NfcTag.h"
#include "config.h"
#include "PowerSwitch.h"
+#include "JavaClassConstants.h"
extern "C"
{
diff --git a/nci/jni/NativeNfcTag.cpp b/nci/jni/NativeNfcTag.cpp
index 39ce2b1..a4d2ec7 100755
--- a/nci/jni/NativeNfcTag.cpp
+++ b/nci/jni/NativeNfcTag.cpp
@@ -25,6 +25,7 @@
#include "config.h"
#include "Mutex.h"
#include "IntervalTimer.h"
+#include "JavaClassConstants.h"
extern "C"
{
@@ -36,7 +37,6 @@ extern "C"
namespace android
{
extern nfc_jni_native_data* getNative(JNIEnv *e, jobject o);
- extern char* gNativeNfcTagClassName;
extern bool nfcManager_isNfcActive();
extern int gGeneralTransceiveTimeout;
}
diff --git a/nci/jni/NativeP2pDevice.cpp b/nci/jni/NativeP2pDevice.cpp
index 2f06b96..216edb1 100644
--- a/nci/jni/NativeP2pDevice.cpp
+++ b/nci/jni/NativeP2pDevice.cpp
@@ -17,15 +17,13 @@
#include "OverrideLog.h"
#include "NfcJniUtil.h"
+#include "JavaClassConstants.h"
namespace android
{
-extern char* gNativeP2pDeviceClassName;
-
-
static jboolean nativeP2pDeviceDoConnect (JNIEnv* e, jobject o)
{
ALOGD ("%s", __FUNCTION__);
diff --git a/nci/jni/NativeSecureElement.cpp b/nci/jni/NativeSecureElement.cpp
index 55bece8..7054b26 100755
--- a/nci/jni/NativeSecureElement.cpp
+++ b/nci/jni/NativeSecureElement.cpp
@@ -16,6 +16,7 @@
*/
#include "OverrideLog.h"
#include "SecureElement.h"
+#include "JavaClassConstants.h"
#include "nfa_brcm_api.h"
@@ -25,7 +26,6 @@ namespace android
extern void com_android_nfc_NfcManager_disableDiscovery (JNIEnv* e, jobject o);
extern void com_android_nfc_NfcManager_enableDiscovery (JNIEnv* e, jobject o, jint mode);
-extern char* gNativeNfcSecureElementClassName;
extern int gGeneralTransceiveTimeout;
diff --git a/nci/jni/NfcTag.cpp b/nci/jni/NfcTag.cpp
index 9d629a2..35df2f0 100755
--- a/nci/jni/NfcTag.cpp
+++ b/nci/jni/NfcTag.cpp
@@ -10,18 +10,13 @@
*****************************************************************************/
#include "OverrideLog.h"
#include "NfcTag.h"
+#include "JavaClassConstants.h"
extern "C"
{
#include "rw_int.h"
}
-namespace android
-{
- extern jmethodID gCachedNfcManagerNotifyNdefMessageListeners;
-}
-
-
/*******************************************************************************
**
** Function: NfcTag
diff --git a/nci/jni/PeerToPeer.cpp b/nci/jni/PeerToPeer.cpp
index 1db7487..56174d5 100644
--- a/nci/jni/PeerToPeer.cpp
+++ b/nci/jni/PeerToPeer.cpp
@@ -13,11 +13,10 @@
#include "NfcJniUtil.h"
#include "llcp_defs.h"
#include "config.h"
+#include "JavaClassConstants.h"
namespace android
{
- extern jmethodID gCachedNfcManagerNotifyLlcpLinkActivation;
- extern jmethodID gCachedNfcManagerNotifyLlcpLinkDeactivated;
extern void nativeNfcTag_registerNdefTypeHandler ();
extern void nativeNfcTag_deregisterNdefTypeHandler ();
}
diff --git a/nci/jni/SecureElement.cpp b/nci/jni/SecureElement.cpp
index 0bc86c8..8847db7 100755
--- a/nci/jni/SecureElement.cpp
+++ b/nci/jni/SecureElement.cpp
@@ -17,14 +17,7 @@
#include "PowerSwitch.h"
#include "HostAidRouter.h"
#include "nfa_vs_brcm_api.h"
-
-
-namespace android
-{
- extern jmethodID gCachedNfcManagerNotifyTransactionListeners;
- extern jmethodID gCachedNfcManagerNotifySeFieldActivated;
- extern jmethodID gCachedNfcManagerNotifySeFieldDeactivated;
-}
+#include "JavaClassConstants.h"
/*****************************************************************************
@@ -190,7 +183,7 @@ bool SecureElement::initialize (nfc_jni_native_data* native)
SyncEventGuard guard (mHciRegisterEvent);
- nfaStat = NFA_HciRegister ("brcm_jni", nfaHciCallback, TRUE);
+ nfaStat = NFA_HciRegister (const_cast<char*>("brcm_jni"), nfaHciCallback, TRUE);
if (nfaStat != NFA_STATUS_OK)
{
ALOGE ("%s: fail hci register; error=0x%X", fn, nfaStat);
@@ -229,7 +222,7 @@ void SecureElement::finalize ()
NFA_EeDeregister (nfaEeCallback);
if (mNfaHciHandle != NFA_HANDLE_INVALID)
- NFA_HciDeregister ("brcm_jni");
+ NFA_HciDeregister (const_cast<char*>("brcm_jni"));
mNfaHciHandle = NFA_HANDLE_INVALID;
mNativeData = NULL;