diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/nfc/NfcDispatcher.java | 5 | ||||
-rwxr-xr-x | src/com/android/nfc/NfcService.java | 31 | ||||
-rw-r--r-- | src/com/android/nfc/SendUi.java | 2 | ||||
-rw-r--r-- | src/com/android/nfc/handover/HandoverManager.java | 5 |
4 files changed, 19 insertions, 24 deletions
diff --git a/src/com/android/nfc/NfcDispatcher.java b/src/com/android/nfc/NfcDispatcher.java index b3ab97c..f628dea 100644 --- a/src/com/android/nfc/NfcDispatcher.java +++ b/src/com/android/nfc/NfcDispatcher.java @@ -305,7 +305,10 @@ public class NfcDispatcher { if (message == null) { return false; } - dispatch.setNdefIntent(); + Intent intent = dispatch.setNdefIntent(); + + // Bail out if the intent does not contain filterable NDEF data + if (intent == null) return false; // Try to start AAR activity with matching filter List<String> aarPackages = extractAarPackages(message); diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java index 3acfa1c..e8fc9e4 100755 --- a/src/com/android/nfc/NfcService.java +++ b/src/com/android/nfc/NfcService.java @@ -187,9 +187,8 @@ public class NfcService extends Application implements DeviceHostListener { private SharedPreferences mPrefs; private SharedPreferences.Editor mPrefsEditor; private PowerManager.WakeLock mRoutingWakeLock; - private PowerManager.WakeLock mOpenWakeLock; - private PowerManager.WakeLock mDisconnectWakeLock; - private PowerManager.WakeLock mTransceiveWakeLock; + private PowerManager.WakeLock mEeWakeLock; + int mStartSound; int mEndSound; int mErrorSound; @@ -323,16 +322,10 @@ public class NfcService extends Application implements DeviceHostListener { mPowerManager = (PowerManager) getSystemService(Context.POWER_SERVICE); - // TODO(mikey|maco): consolidate as a single wakelock when individual - // stats are no longer useful. mRoutingWakeLock = mPowerManager.newWakeLock( PowerManager.PARTIAL_WAKE_LOCK, "NfcService:mRoutingWakeLock"); - mOpenWakeLock = mPowerManager.newWakeLock( - PowerManager.PARTIAL_WAKE_LOCK, "NfcService:mOpenWakeLock"); - mDisconnectWakeLock = mPowerManager.newWakeLock( - PowerManager.PARTIAL_WAKE_LOCK, "NfcService:mDisconnectWakeLock"); - mTransceiveWakeLock = mPowerManager.newWakeLock( - PowerManager.PARTIAL_WAKE_LOCK, "NfcService:mTransceiveWakeLock"); + mEeWakeLock = mPowerManager.newWakeLock( + PowerManager.PARTIAL_WAKE_LOCK, "NfcService:mEeWakeLock"); mKeyguard = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE); mScreenState = checkScreenState(); @@ -417,20 +410,20 @@ public class NfcService extends Application implements DeviceHostListener { } int doOpenSecureElementConnection() { - mOpenWakeLock.acquire(); + mEeWakeLock.acquire(); try { return mSecureElement.doOpenSecureElementConnection(); } finally { - mOpenWakeLock.release(); + mEeWakeLock.release(); } } byte[] doTransceive(int handle, byte[] cmd) { - mTransceiveWakeLock.acquire(); + mEeWakeLock.acquire(); try { return doTransceiveNoLock(handle, cmd); } finally { - mTransceiveWakeLock.release(); + mEeWakeLock.release(); } } @@ -439,11 +432,11 @@ public class NfcService extends Application implements DeviceHostListener { } void doDisconnect(int handle) { - mDisconnectWakeLock.acquire(); + mEeWakeLock.acquire(); try { mSecureElement.doDisconnect(handle); } finally { - mDisconnectWakeLock.release(); + mEeWakeLock.release(); } } @@ -640,7 +633,7 @@ public class NfcService extends Application implements DeviceHostListener { } try { - mTransceiveWakeLock.acquire(); + mEeWakeLock.acquire(); try { mDeviceHost.setTimeout(TagTechnology.ISO_DEP, 10000); @@ -654,7 +647,7 @@ public class NfcService extends Application implements DeviceHostListener { mDeviceHost.resetTimeouts(); } finally { - mTransceiveWakeLock.release(); + mEeWakeLock.release(); } } finally { doDisconnect(handle); diff --git a/src/com/android/nfc/SendUi.java b/src/com/android/nfc/SendUi.java index 23602c9..c54f54e 100644 --- a/src/com/android/nfc/SendUi.java +++ b/src/com/android/nfc/SendUi.java @@ -183,7 +183,7 @@ public class SendUi implements Animator.AnimatorListener, View.OnTouchListener, // We're only allowed to use hardware acceleration if // isHighEndGfx() returns true - otherwise, we're too limited // on resources to do it. - mHardwareAccelerated = ActivityManager.isHighEndGfx(mDisplay); + mHardwareAccelerated = ActivityManager.isHighEndGfx(); int hwAccelerationFlags = mHardwareAccelerated ? WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED : 0; diff --git a/src/com/android/nfc/handover/HandoverManager.java b/src/com/android/nfc/handover/HandoverManager.java index 8983389..b4c2025 100644 --- a/src/com/android/nfc/handover/HandoverManager.java +++ b/src/com/android/nfc/handover/HandoverManager.java @@ -390,8 +390,7 @@ public class HandoverManager implements BluetoothProfile.ServiceListener, notBuilder.setContentText(mContext.getString(R.string.beam_touch_to_view)); Intent viewIntent = buildViewIntent(); - PendingIntent contentIntent = PendingIntent.getActivity(mContext, 0, viewIntent, - Intent.FLAG_ACTIVITY_NEW_TASK); + PendingIntent contentIntent = PendingIntent.getActivity(mContext, 0, viewIntent, 0); notBuilder.setContentIntent(contentIntent); @@ -538,7 +537,7 @@ public class HandoverManager implements BluetoothProfile.ServiceListener, Uri uri = mediaUri != null ? mediaUri : Uri.parse(ContentResolver.SCHEME_FILE + "://" + filePath); viewIntent.setDataAndTypeAndNormalize(uri, mimeTypes.get(filePath)); - + viewIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); return viewIntent; } |