summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsjefdeklerk <sjefdeklerk@hotmail.com>2014-12-27 15:11:46 -0500
committerTony Layher <layhertony@gmail.com>2014-12-27 15:12:39 -0500
commit80526e37c41dbd0e0c7a30d4170220a7a098965f (patch)
tree2f4cc09e5c7a527f6aabfec49d700158444e4449
parent24881104df969c442893089fe1c73c3862b06484 (diff)
downloadandroid_packages_apps_Nfc-80526e37c41dbd0e0c7a30d4170220a7a098965f.tar.gz
android_packages_apps_Nfc-80526e37c41dbd0e0c7a30d4170220a7a098965f.tar.bz2
android_packages_apps_Nfc-80526e37c41dbd0e0c7a30d4170220a7a098965f.zip
nfc jni: allow bypassing of switching power states
Samsung has started shipping a new NFC chip that does not respond to changes in power lvl. After investigation of the stock jni it has been realized their implementation bypasses the power level function. Allow that in our case. Change-Id: Icaf96f841393deaae45760f899c52aeadcf3907f
-rw-r--r--nci/jni/Android.mk4
-rwxr-xr-xnci/jni/PowerSwitch.cpp8
2 files changed, 11 insertions, 1 deletions
diff --git a/nci/jni/Android.mk b/nci/jni/Android.mk
index 8d65bfc2..e4e2bd6f 100644
--- a/nci/jni/Android.mk
+++ b/nci/jni/Android.mk
@@ -19,6 +19,10 @@ $(patsubst ./%,%, \
)
endef
+ifeq ($(BOARD_USES_SEC_NFC),true)
+ LOCAL_CFLAGS += -DUSES_SEC_NFC
+endif
+
LOCAL_SRC_FILES:= $(call all-cpp-files-under, .)
LOCAL_C_INCLUDES += \
diff --git a/nci/jni/PowerSwitch.cpp b/nci/jni/PowerSwitch.cpp
index cf320b5b..49ac5f5f 100755
--- a/nci/jni/PowerSwitch.cpp
+++ b/nci/jni/PowerSwitch.cpp
@@ -155,6 +155,7 @@ PowerSwitch::PowerLevel PowerSwitch::getLevel ()
** Returns: True if ok.
**
*******************************************************************************/
+#ifndef USES_SEC_NFC
bool PowerSwitch::setLevel (PowerLevel newLevel)
{
static const char fn [] = "PowerSwitch::setLevel";
@@ -217,7 +218,12 @@ TheEnd:
mMutex.unlock ();
return retval;
}
-
+#else
+bool PowerSwitch::setLevel (PowerLevel newLevel)
+{
+ return false;
+}
+#endif
bool PowerSwitch::setScreenOffPowerState (ScreenOffPowerState newState)
{