summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsrc/com/android/nfc/NfcService.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java
index 0f3feedc..153a650d 100755
--- a/src/com/android/nfc/NfcService.java
+++ b/src/com/android/nfc/NfcService.java
@@ -815,7 +815,10 @@ public class NfcService implements DeviceHostListener {
public void setForegroundDispatch(PendingIntent intent,
IntentFilter[] filters, TechListParcel techListsParcel) {
NfcPermissions.enforceUserPermissions(mContext);
-
+ if (!mForegroundUtils.isInForeground(Binder.getCallingUid())) {
+ Log.e(TAG, "setForegroundDispatch: Caller not in foreground.");
+ return;
+ }
// Short-cut the disable path
if (intent == null && filters == null && techListsParcel == null) {
mNfcDispatcher.setForegroundDispatch(null, null, null);
@@ -945,6 +948,10 @@ public class NfcService implements DeviceHostListener {
@Override
public void setReaderMode(IBinder binder, IAppCallback callback, int flags, Bundle extras)
throws RemoteException {
+ if (!mForegroundUtils.isInForeground(Binder.getCallingUid())) {
+ Log.e(TAG, "setReaderMode: Caller not in foreground.");
+ return;
+ }
synchronized (NfcService.this) {
if (flags != 0) {
try {