Refine permission check process of 2-pane deep link

- Check the deep link activity instance before redirecting to the
  internal activity for the managed profile invocation, so the caller
  can't bypass the permission check.
- Get the referrer as the caller so that onNewIntent can recognize the
  new caller and check if it has a permission to open the target page.

Test: robotest & manual
Bug: 268193384
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:0f13f70655099543ba34eb8aeaa74b34a3993a3b)
Merged-In: Ie69742983fb74ee2316b7aad16461db95ed927c2
Change-Id: Ie69742983fb74ee2316b7aad16461db95ed927c2
2 files changed