summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormike wakerly <mikey@google.com>2011-09-27 15:54:21 -0700
committermike wakerly <mikey@google.com>2011-09-28 11:03:01 -0700
commit8e85fe445d229fba5d101b4f95fe0dfa34a8601e (patch)
tree9284a6ff86a6522919e402dd4707ddd8fb318036 /src
parenta92d7b39de4a456ac6e3f7d954b9eef3fe2b61e2 (diff)
downloadpackages_apps_nfc-8e85fe445d229fba5d101b4f95fe0dfa34a8601e.zip
packages_apps_nfc-8e85fe445d229fba5d101b4f95fe0dfa34a8601e.tar.gz
packages_apps_nfc-8e85fe445d229fba5d101b4f95fe0dfa34a8601e.tar.bz2
NfcService: call enableAppSwitches for additional events.
This addresses the responsiveness issue identified in b/5140941 Change-Id: I8fad061be2e3f1006e4e2910db84c0a3360e2a0a
Diffstat (limited to 'src')
-rw-r--r--src/com/android/nfc/NfcDispatcher.java22
-rwxr-xr-xsrc/com/android/nfc/NfcService.java1
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);
}