Merge "Don't truncate an app's own label when forcing safe label." into rvc-dev am: 2f988b5a82 am: a98609c3b9
Change-Id: I6f98c34e5b8a20961fdebcbcc4867477a78d15df
This commit is contained in:
@@ -24,6 +24,7 @@ import static android.text.TextUtils.makeSafeForPresentation;
|
|||||||
import android.annotation.FloatRange;
|
import android.annotation.FloatRange;
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.annotation.SystemApi;
|
import android.annotation.SystemApi;
|
||||||
|
import android.app.ActivityThread;
|
||||||
import android.content.res.XmlResourceParser;
|
import android.content.res.XmlResourceParser;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -194,7 +195,7 @@ public class PackageItemInfo {
|
|||||||
* item does not have a label, its name is returned.
|
* item does not have a label, its name is returned.
|
||||||
*/
|
*/
|
||||||
public @NonNull CharSequence loadLabel(@NonNull PackageManager pm) {
|
public @NonNull CharSequence loadLabel(@NonNull PackageManager pm) {
|
||||||
if (sForceSafeLabels) {
|
if (sForceSafeLabels && !Objects.equals(packageName, ActivityThread.currentPackageName())) {
|
||||||
return loadSafeLabel(pm, DEFAULT_MAX_LABEL_SIZE_PX, SAFE_STRING_FLAG_TRIM
|
return loadSafeLabel(pm, DEFAULT_MAX_LABEL_SIZE_PX, SAFE_STRING_FLAG_TRIM
|
||||||
| SAFE_STRING_FLAG_FIRST_LINE);
|
| SAFE_STRING_FLAG_FIRST_LINE);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user