Merge "Intern process names." into oc-mr1-dev

am: a530d79209

Change-Id: I84c2c6cec01add83511fef717960f79eb7a763b9
This commit is contained in:
Makoto Onuki
2017-08-09 01:31:03 +00:00
committed by android-build-merger
2 changed files with 9 additions and 1 deletions

View File

@@ -3002,7 +3002,7 @@ public class PackageParser {
if (procSeq == null || procSeq.length() <= 0) {
return defProc;
}
return buildCompoundName(pkg, procSeq, "process", outError);
return TextUtils.safeIntern(buildCompoundName(pkg, procSeq, "process", outError));
}
private static String buildTaskAffinityName(String pkg, String defProc,

View File

@@ -483,6 +483,14 @@ public class TextUtils {
return isEmpty(s) ? 0 : s.length();
}
/**
* @return interned string if it's null.
* @hide
*/
public static String safeIntern(String s) {
return (s != null) ? s.intern() : null;
}
/**
* Returns the length that the specified CharSequence would have if
* spaces and ASCII control characters were trimmed from the start and end,