summaryrefslogtreecommitdiffstats
path: root/src/com/android/packageinstaller/PackageUtil.java
diff options
context:
space:
mode:
authorSuchi Amalapurapu <asuchitra@google.com>2009-11-18 15:32:38 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-11-18 15:32:38 -0800
commit05a3000ed6092c0010f996a9b7c2493124c3c134 (patch)
tree9ee1590e1ef8861cf609e8bb8c834b82a8746f71 /src/com/android/packageinstaller/PackageUtil.java
parent7562a6a9316da47341c23f8661adbc1684a35473 (diff)
parentccb4dda8b1525c90323fa9dd7b96b9eeb78b7082 (diff)
downloadandroid_packages_apps_PackageInstaller-05a3000ed6092c0010f996a9b7c2493124c3c134.tar.gz
android_packages_apps_PackageInstaller-05a3000ed6092c0010f996a9b7c2493124c3c134.tar.bz2
android_packages_apps_PackageInstaller-05a3000ed6092c0010f996a9b7c2493124c3c134.zip
am ccb4dda8: Fix for 2268060, 2251223 if conditional initializing package label. Also load the label from the new pkg for existing packages Use installer\'s metrics and configuration info when creating resources for new package
Merge commit 'ccb4dda8b1525c90323fa9dd7b96b9eeb78b7082' into eclair-plus-aosp * commit 'ccb4dda8b1525c90323fa9dd7b96b9eeb78b7082': Fix for 2268060, 2251223 if conditional initializing package label.
Diffstat (limited to 'src/com/android/packageinstaller/PackageUtil.java')
-rw-r--r--src/com/android/packageinstaller/PackageUtil.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/com/android/packageinstaller/PackageUtil.java b/src/com/android/packageinstaller/PackageUtil.java
index 1e80204c..5b31062c 100644
--- a/src/com/android/packageinstaller/PackageUtil.java
+++ b/src/com/android/packageinstaller/PackageUtil.java
@@ -115,11 +115,10 @@ public class PackageUtil {
int snippetId, Uri packageURI) {
View appSnippet = pContext.findViewById(snippetId);
final String archiveFilePath = packageURI.getPath();
- DisplayMetrics metrics = new DisplayMetrics();
- metrics.setToDefaults();
+ Resources pRes = pContext.getResources();
AssetManager assmgr = new AssetManager();
assmgr.addAssetPath(archiveFilePath);
- Resources res = new Resources(assmgr, metrics, null);
+ Resources res = new Resources(assmgr, pRes.getDisplayMetrics(), pRes.getConfiguration());
CharSequence label = null;
// Try to load the label from the package's resources. If an app has not explicitly
// specified any label, just use the package name.
@@ -129,10 +128,9 @@ public class PackageUtil {
} catch (Resources.NotFoundException e) {
}
}
- if ((label == null) && (appInfo.nonLocalizedLabel != null)) {
- label = appInfo.nonLocalizedLabel;
- } else {
- label = appInfo.packageName;
+ if (label == null) {
+ label = (appInfo.nonLocalizedLabel != null) ?
+ appInfo.nonLocalizedLabel : appInfo.packageName;
}
Drawable icon = null;
// Try to load the icon from the package's resources. If an app has not explicitly