Add AppOps overload to be able to watch foreground changes.

We have never offered the native API to register mode watchers that are
invoked for foregroundness changes when the raw mode is MODE_FOREGROUND.

Test: Add logging to verify invocation
Bug: 247768581
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:949cb3d098fd98715826fc92ea3c26a51aa2d976)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:83d1c72376a9223d36ed685c3f88b40ddcb76b8f)
Merged-In: I89af46de557fbfc31d69613367a4e26a5222430a
Change-Id: I89af46de557fbfc31d69613367a4e26a5222430a
4 files changed