summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Layher <layhertony@gmail.com>2015-02-13 22:58:19 -0500
committerTony Layher <layhertony@gmail.com>2015-02-15 17:23:02 -0500
commitc6f7234af774578fc567f3bf6699fac463f26243 (patch)
tree3839f2a3ac75f904f08adddbf4fdd58c986c93b4
parenta29f6b5492a6336423e03fe9fdcf8c3bf59efce9 (diff)
downloadandroid_packages_apps_Nfc-stable/cm-12.0-YNG1I.tar.gz
android_packages_apps_Nfc-stable/cm-12.0-YNG1I.tar.bz2
android_packages_apps_Nfc-stable/cm-12.0-YNG1I.zip
NFCService: Add sysprop to prevent FW download during boot with NFC off.stable/cm-12.0-YNG1TAstable/cm-12.0-YNG1Tstable/cm-12.0-YNG1I
* The SEC NFC chip used by samsung for the Note4, Alpha and S5-mini does not handle the download attempt on boot well if NFC is off. * If download is attempted while booting with NFC off, the NFC device is opened and never closed, resulting in a kernel wake lock. It also prevents turning NFC on due to the device already being open with the service in a tranisition from off -> on. * Devices can set the property ro.nfc.sec_hal to any value to signify the use of the sec NFC chip. (S3FWRN) Change-Id: Ifb28074eb473ab5b7e4b82a14336ee51972d3975
-rwxr-xr-xsrc/com/android/nfc/NfcService.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java
index d8278833..cbdfc081 100755
--- a/src/com/android/nfc/NfcService.java
+++ b/src/com/android/nfc/NfcService.java
@@ -60,9 +60,11 @@ import android.os.PowerManager;
import android.os.Process;
import android.os.RemoteException;
import android.os.ServiceManager;
+import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.UserManager;
import android.provider.Settings;
+import android.text.TextUtils;
import android.util.Log;
import com.android.nfc.DeviceHost.DeviceHostListener;
@@ -427,6 +429,15 @@ public class NfcService implements DeviceHostListener {
}
}
+ boolean isSecHal() {
+ String nfcSecHal = SystemProperties.get("ro.nfc.sec_hal");
+ if (!TextUtils.isEmpty(nfcSecHal)) {
+ Log.i(TAG, "This device uses SEC NFC CHIP.");
+ return true;
+ }
+ return false;
+ }
+
/**
* Manages tasks that involve turning on/off the NFC controller.
* <p/>
@@ -489,7 +500,7 @@ public class NfcService implements DeviceHostListener {
(!mIsAirplaneSensitive || !isAirplaneModeOn() || airplaneOverride)) {
Log.d(TAG, "NFC is on. Doing normal stuff");
enableInternal();
- } else {
+ } else if (!isSecHal()) {
Log.d(TAG, "NFC is off. Checking firmware version");
mDeviceHost.checkFirmware();
}