fix out of memory with continuous entry and exit InstalledAppDetail.
A session keeps in ApplicationsState list. The fragment don't release
the session when it is destroyed. The cause of out of memory is that the
session list is increased, but it can't be released.
Change-Id: I23635610c9fdfb8a3423299a91cf9b11cb5cdb65
Signed-off-by: daqiangx <daqiangx.li@intel.com>
diff --git a/src/com/android/settings/applications/AppInfoBase.java b/src/com/android/settings/applications/AppInfoBase.java
index ff618c2..9ef1fed 100644
--- a/src/com/android/settings/applications/AppInfoBase.java
+++ b/src/com/android/settings/applications/AppInfoBase.java
@@ -105,6 +105,12 @@
super.onPause();
}
+ @Override
+ public void onDestroy() {
+ mSession.release();
+ super.onDestroy();
+ }
+
protected String retrieveAppEntry() {
final Bundle args = getArguments();
mPackageName = (args != null) ? args.getString(ARG_PACKAGE_NAME) : null;