Restrict what activity launches show permission prompts

Only show a permission prompt if the activity is a launcher, the calling
app is the same as the opened intent app, or the
isEligibleForLegacyPermissionPrompt ActivityOption is set. Also prevents
the dialog from showing while the keyguard is locked.

Test: atest NotificationPermissionTest
Bug: 194833441
Fixes: 220891438
Change-Id: Ie5381af045d538a5b822bb1ccdf62b1dd916114f
7 files changed