[RESTRICT AUTOMERGE] Allow activity to be reparent while allowTaskReparenting is applied

Any malicious application could hijack tasks by
android:allowTaskReparenting. This vulnerability can perform UI
spoofing or spying on user’s activities.

This CL only allows activities to be reparent while
android:allowTaskReparenting is applied and the affinity of activity
is same with the target task.

Bug: 240663194
Bug: 252853095
Test: atest IntentTests
Change-Id: I73abb9ec05af95bc14f887ae825a9ada9600f771
Merged-In: I73abb9ec05af95bc14f887ae825a9ada9600f771
(cherry picked from commit 7af50c4d5f0354438872167b0e446930caca9deb)
1 file changed