Merge "Fix NPE and turn on logging for device-idle alarms" into sc-dev am: ff5792fca7

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13432182

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic490315f93de04062e2abbe07536143c2b45d995
This commit is contained in:
Suprabh Shukla
2021-01-30 02:32:41 +00:00
committed by Automerger Merge Worker

View File

@@ -151,7 +151,8 @@ public class AlarmManagerService extends SystemService {
static final boolean DEBUG_BG_LIMIT = localLOGV || false; static final boolean DEBUG_BG_LIMIT = localLOGV || false;
static final boolean DEBUG_STANDBY = localLOGV || false; static final boolean DEBUG_STANDBY = localLOGV || false;
static final boolean RECORD_ALARMS_IN_HISTORY = true; static final boolean RECORD_ALARMS_IN_HISTORY = true;
static final boolean RECORD_DEVICE_IDLE_ALARMS = false; // TODO(b/178484639) : Turn off once alarms and reminders work is complete.
static final boolean RECORD_DEVICE_IDLE_ALARMS = true;
static final String TIMEZONE_PROPERTY = "persist.sys.timezone"; static final String TIMEZONE_PROPERTY = "persist.sys.timezone";
static final int TICK_HISTORY_DEPTH = 10; static final int TICK_HISTORY_DEPTH = 10;
@@ -1731,8 +1732,8 @@ public class AlarmManagerService extends SystemService {
if (RECORD_DEVICE_IDLE_ALARMS) { if (RECORD_DEVICE_IDLE_ALARMS) {
IdleDispatchEntry ent = new IdleDispatchEntry(); IdleDispatchEntry ent = new IdleDispatchEntry();
ent.uid = a.uid; ent.uid = a.uid;
ent.pkg = a.operation.getCreatorPackage(); ent.pkg = a.sourcePackage;
ent.tag = a.operation.getTag(""); ent.tag = a.statsTag;
ent.op = "START IDLE"; ent.op = "START IDLE";
ent.elapsedRealtime = mInjector.getElapsedRealtime(); ent.elapsedRealtime = mInjector.getElapsedRealtime();
ent.argRealtime = a.getWhenElapsed(); ent.argRealtime = a.getWhenElapsed();
@@ -3151,8 +3152,8 @@ public class AlarmManagerService extends SystemService {
if (RECORD_DEVICE_IDLE_ALARMS) { if (RECORD_DEVICE_IDLE_ALARMS) {
IdleDispatchEntry ent = new IdleDispatchEntry(); IdleDispatchEntry ent = new IdleDispatchEntry();
ent.uid = alarm.uid; ent.uid = alarm.uid;
ent.pkg = alarm.operation.getCreatorPackage(); ent.pkg = alarm.sourcePackage;
ent.tag = alarm.operation.getTag(""); ent.tag = alarm.statsTag;
ent.op = "END IDLE"; ent.op = "END IDLE";
ent.elapsedRealtime = mInjector.getElapsedRealtime(); ent.elapsedRealtime = mInjector.getElapsedRealtime();
ent.argRealtime = alarm.getWhenElapsed(); ent.argRealtime = alarm.getWhenElapsed();