summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/applications
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2012-09-19 10:58:32 -0700
committerAmith Yamasani <yamasani@google.com>2012-09-19 10:58:32 -0700
commitb1bf9cf3835ce41f3864f1056554f0180624e2c7 (patch)
tree3b44a4c2846b2aa5ffdd617b4d0fa7a86660f253 /src/com/android/settings/applications
parent27f155a4012aece82d58f7142960aec6414ade4d (diff)
downloadpackages_apps_settings-b1bf9cf3835ce41f3864f1056554f0180624e2c7.zip
packages_apps_settings-b1bf9cf3835ce41f3864f1056554f0180624e2c7.tar.gz
packages_apps_settings-b1bf9cf3835ce41f3864f1056554f0180624e2c7.tar.bz2
Fix a crash in InstalledAppDetails
Initialize mPackageInfo in onCreate Bug: 7194755 Change-Id: Ic82351591bd38c4c161bbb23c4033038d1d7fa85
Diffstat (limited to 'src/com/android/settings/applications')
-rw-r--r--src/com/android/settings/applications/InstalledAppDetails.java23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/com/android/settings/applications/InstalledAppDetails.java b/src/com/android/settings/applications/InstalledAppDetails.java
index 2284b91..97d7b75 100644
--- a/src/com/android/settings/applications/InstalledAppDetails.java
+++ b/src/com/android/settings/applications/InstalledAppDetails.java
@@ -564,6 +564,16 @@ public class InstalledAppDetails extends Fragment
}
}
mAppEntry = mState.getEntry(packageName);
+ // Get application info again to refresh changed properties of application
+ try {
+ mPackageInfo = mPm.getPackageInfo(mAppEntry.info.packageName,
+ PackageManager.GET_DISABLED_COMPONENTS |
+ PackageManager.GET_UNINSTALLED_PACKAGES |
+ PackageManager.GET_SIGNATURES);
+ } catch (NameNotFoundException e) {
+ Log.e(TAG, "Exception when retrieving package:" + mAppEntry.info.packageName, e);
+ }
+
return packageName;
}
@@ -576,18 +586,11 @@ public class InstalledAppDetails extends Fragment
if (mAppEntry == null) {
return false; // onCreate must have failed, make sure to exit
}
-
- // Get application info again to refresh changed properties of application
- try {
- mPackageInfo = mPm.getPackageInfo(mAppEntry.info.packageName,
- PackageManager.GET_DISABLED_COMPONENTS |
- PackageManager.GET_UNINSTALLED_PACKAGES |
- PackageManager.GET_SIGNATURES);
- } catch (NameNotFoundException e) {
- Log.e(TAG, "Exception when retrieving package:" + mAppEntry.info.packageName, e);
+
+ if (mPackageInfo == null) {
return false; // onCreate must have failed, make sure to exit
}
-
+
// Get list of preferred activities
List<ComponentName> prefActList = new ArrayList<ComponentName>();