Check app querying permissions.

We no longer let apps query the existence of other apps (with some
exceptions). Make sure we honor that by always returning false for the
power-allowlist if the calling app doesn't have the required
permissions.

Bug: 166668654
Test: atest DeviceIdleTest
Test: atest CtsSecurityTestCases:DeviceIdleControllerTest
Test: atest FrameworksMockingServicesTests:DeviceIdleControllerTest
Change-Id: I895f1d666a213e141d9fbf08600c611f04f3a7fd
2 files changed