Limit presentations on task-hosting displays to focused tasks

Task hosting displays present similar capabilities as the internal
display where users can launch and interact with apps. Allowing
arbitrary untrusted apps to add presentation exposes a security risk
that external displays can be hijacked without any warnings.

The most graceful approach would be to introduce a dialog for the user
to decide if they'd like to allow presentations each time, but for the
time being we apply the same requirement to all task-hosting displays
that only the globally focused task is allowed to add presentations on
them.

This change may have app compatibility consequences in the sense that
applications may assume they can launch presentations at anytime on
external displays, but the default behavior of external displays is to
host tasks so their requests can be rejected by default.

Also, this CL doesn't remove the existing presentation from an external
display that is changing to host tasks. It is less concerning from the
security point of view, but can still be a frustrating UX because the
presentation occludes the activities.

Bug: 527038421
Bug: 484320792
Test: atest PresentationControllerTests
Test: Background activities can't add presentation to external displays
      that host tasks.
Flag: EXEMPT CVE_FIX
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:3b4aad43843d0b10d4cdedcd6905b4b8b5ea0607
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:e3f24f4ee91d2e9d15f8093ae9ee29e7527bafda
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:ec88ac8e2fc5a67d745907f0bb8d27cc5ceac6b7
Merged-In: I180cf2cc28f8f2e0b39e62fc6d02ebaadd042f89
Change-Id: I180cf2cc28f8f2e0b39e62fc6d02ebaadd042f89
2 files changed