Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 35f56746 authored by Christopher Tate's avatar Christopher Tate
Browse files

Consistent reporting of failure conditions

Querying for the state of the exact-alarm permission produced
inconsistent results depending on circumstances.  This is now fixed so
the failure reporting is invariant.

Bug: 193032972
Test: manual
Test: atest CtsAlarmManagerTestCases
Change-Id: Ie1cc126cec568b6f53ebe6049e57ed13abdfd5bb
parent 51204c44
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2593,7 +2593,7 @@ public class AlarmManagerService extends SystemService {
            final int uid = mPackageManagerInternal.getPackageUid(packageName, 0, userId);
            if (callingUid != uid && !UserHandle.isCore(callingUid)) {
                throw new SecurityException("Uid " + callingUid
                        + " cannot query hasScheduleExactAlarm for uid " + uid);
                        + " cannot query hasScheduleExactAlarm for package " + packageName);
            }
            return (uid > 0) ? hasScheduleExactAlarmInternal(packageName, uid) : false;
        }