Merge "Fix possible security issue. Bug #2553187" into froyo
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user