diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/nfc/NfcDispatcher.java | 22 | ||||
-rwxr-xr-x | src/com/android/nfc/NfcService.java | 1 |
2 files changed, 16 insertions, 7 deletions
diff --git a/src/com/android/nfc/NfcDispatcher.java b/src/com/android/nfc/NfcDispatcher.java index 37f08e7..6628eca 100644 --- a/src/com/android/nfc/NfcDispatcher.java +++ b/src/com/android/nfc/NfcDispatcher.java @@ -293,13 +293,7 @@ public class NfcDispatcher { return false; } } else { - try { - // If the current app called stopAppSwitches() then our startActivity() - // can be delayed for several seconds. This happens with the default home - // screen. As a system service we can override this behavior with - // resumeAppSwitches() - mIActivityManager.resumeAppSwitches(); - } catch (RemoteException e) { } + resumeAppSwitches(); if (records != null) { String firstPackage = null; for (NdefRecord record : records) { @@ -337,6 +331,20 @@ public class NfcDispatcher { } } + /** + * Tells the ActivityManager to resume allowing app switches. + * + * If the current app called stopAppSwitches() then our startActivity() can + * be delayed for several seconds. This happens with the default home + * screen. As a system service we can override this behavior with + * resumeAppSwitches(). + */ + void resumeAppSwitches() { + try { + mIActivityManager.resumeAppSwitches(); + } catch (RemoteException e) { } + } + /** Returns true if the tech list filter matches the techs on the tag */ private boolean filterMatch(String[] tagTechs, String[] filterTechs) { if (filterTechs == null || filterTechs.length == 0) return false; diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java index 84b0cdf..4457c34 100755 --- a/src/com/android/nfc/NfcService.java +++ b/src/com/android/nfc/NfcService.java @@ -1524,6 +1524,7 @@ public class NfcService extends Application implements DeviceHostListener { } private void sendSeBroadcast(Intent intent) { + mNfcDispatcher.resumeAppSwitches(); intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); mContext.sendBroadcast(intent, NFCEE_ADMIN_PERM); } |