Merge "Limit Activity taskAffinity to application uid"

This commit is contained in:
TreeHugger Robot
2019-12-02 17:44:40 +00:00
committed by Android (Google) Code Review

View File

@@ -1520,7 +1520,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
hasBeenLaunched = false;
mStackSupervisor = supervisor;
taskAffinity = aInfo.taskAffinity;
// b/35954083: Limit task affinity to uid to avoid various issues associated with sharing
// affinity across uids.
final String uid = Integer.toString(info.applicationInfo.uid);
if (info.taskAffinity != null && !info.taskAffinity.startsWith(uid)) {
info.taskAffinity = uid + ":" + info.taskAffinity;
}
taskAffinity = info.taskAffinity;
stateNotNeeded = (aInfo.flags & FLAG_STATE_NOT_NEEDED) != 0;
nonLocalizedLabel = aInfo.nonLocalizedLabel;
labelRes = aInfo.labelRes;