Improve first opaque activity candidate detection

To catch the right candidate as first opaque activity beneath
a translucent one and handle normal permission dialog
behaviour and smart links.

Fixes: 278661668
Test: Run `atest WmTests:SizeCompatTests`

Change-Id: I62e829555c43136080ee4909f7dcf8c388165e9f
3 files changed