Check rule package name in ZenModeHelper.addAutomaticRule

instead of checking that of the configuration activity, which is potentially spoofable. The package name is verified to be the same app as the caller by NMS.

This change removes isSystemRule (called only once) in favor of checking the provided package name directly.

Bug: 242537431
Test: ZenModeHelperTest, manual by verifying via provided exploit apk
Change-Id: Ic7f350618c26a613df455a4128c9195f4b424a4d
(cherry picked from commit 59732d6232d7d82d03897b25be0381c3c510db9b)
Merged-In: Ic7f350618c26a613df455a4128c9195f4b424a4d
2 files changed