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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user