Note null alarm worksource names under the alarm's package

And log a nastygram because it implies the app is misbehaving.

Bug 29333122

Change-Id: Ia683304b8a9eafb234df81e874ee3f0636c4e56a
This commit is contained in:
Christopher Tate
2016-06-14 10:16:28 -07:00
parent 366f324113
commit 0029f57123

View File

@@ -3073,9 +3073,14 @@ class AlarmManagerService extends SystemService {
fs.numWakeup++;
if (alarm.workSource != null && alarm.workSource.size() > 0) {
for (int wi=0; wi<alarm.workSource.size(); wi++) {
final String wsName = alarm.workSource.getName(wi);
if (wsName == null) {
Slog.w(TAG, "Null worksource name for alarm " + alarm);
}
ActivityManagerNative.noteWakeupAlarm(
alarm.operation, alarm.workSource.get(wi),
alarm.workSource.getName(wi), alarm.statsTag);
(wsName != null) ? wsName : alarm.packageName,
alarm.statsTag);
}
} else {
ActivityManagerNative.noteWakeupAlarm(