am 1faae167: am 691b806f: Merge "Fix possible security issue. Bug #2553187" into froyo

Merge commit '1faae1677229bf9a4552cc3f90e0afe2858e7a4c' into kraken

* commit '1faae1677229bf9a4552cc3f90e0afe2858e7a4c':
  Fix possible security issue.
This commit is contained in:
Romain Guy
2010-03-29 16:40:43 -07:00
committed by Android Git Automerger
3 changed files with 13 additions and 5 deletions

View File

@@ -78,9 +78,11 @@ public class PackageItemInfo {
public PackageItemInfo(PackageItemInfo orig) {
name = orig.name;
if (name != null) name = name.trim();
packageName = orig.packageName;
labelRes = orig.labelRes;
nonLocalizedLabel = orig.nonLocalizedLabel;
if (nonLocalizedLabel != null) nonLocalizedLabel = nonLocalizedLabel.toString().trim();
icon = orig.icon;
metaData = orig.metaData;
}
@@ -103,10 +105,10 @@ public class PackageItemInfo {
if (labelRes != 0) {
CharSequence label = pm.getText(packageName, labelRes, null);
if (label != null) {
return label;
return label.toString().trim();
}
}
if(name != null) {
if (name != null) {
return name;
}
return packageName;

View File

@@ -133,7 +133,7 @@ public class ResolveInfo implements Parcelable {
if (resolvePackageName != null && labelRes != 0) {
label = pm.getText(resolvePackageName, labelRes, null);
if (label != null) {
return label;
return label.toString().trim();
}
}
ComponentInfo ci = activityInfo != null ? activityInfo : serviceInfo;
@@ -141,10 +141,14 @@ public class ResolveInfo implements Parcelable {
if (labelRes != 0) {
label = pm.getText(ci.packageName, labelRes, ai);
if (label != null) {
return label;
return label.toString().trim();
}
}
return ci.loadLabel(pm);
CharSequence data = ci.loadLabel(pm);
// Make the data safe
if (data != null) data = data.toString().trim();
return data;
}
/**

View File

@@ -42,12 +42,14 @@
android:textAppearance="?android:attr/textAppearanceLargeInverse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="2"
android:paddingLeft="10dip" />
<!-- Extended activity info to distinguish between duplicate activity names -->
<TextView android:id="@android:id/text2"
android:textAppearance="?android:attr/textAppearanceMediumInverse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="2"
android:paddingLeft="10dip" />
</LinearLayout>
</LinearLayout>