Unregister the NFC callback onPause.
This prevents us from leaking BrowserActivity when we go to
the background.
Bug: 5233864
Change-Id: Idf59de67637c8c9eb39ea9f8b9cb93320c4afa99
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index adc2677..ff1ad0e 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -253,8 +253,6 @@
}
void start(final Bundle icicle, final Intent intent) {
- NfcHandler.register(mActivity, this);
-
boolean noCrashRecovery = intent.getBooleanExtra(NO_CRASH_RECOVERY, false);
if (icicle != null || noCrashRecovery) {
doStart(icicle, intent);
@@ -637,6 +635,7 @@
mNetworkHandler.onPause();
WebView.disablePlatformNotifications();
+ NfcHandler.unregister(mActivity);
}
void onSaveInstanceState(Bundle outState) {
@@ -670,6 +669,7 @@
mUi.onResume();
mNetworkHandler.onResume();
WebView.enablePlatformNotifications();
+ NfcHandler.register(mActivity, this);
}
private void releaseWakeLock() {