diff options
author | Amith Yamasani <yamasani@google.com> | 2012-09-19 10:58:32 -0700 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2012-09-19 10:58:32 -0700 |
commit | b1bf9cf3835ce41f3864f1056554f0180624e2c7 (patch) | |
tree | 3b44a4c2846b2aa5ffdd617b4d0fa7a86660f253 /src/com/android/settings/applications | |
parent | 27f155a4012aece82d58f7142960aec6414ade4d (diff) | |
download | packages_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.java | 23 |
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>(); |