Merge "Add worksource AAB bucket to WakeupAlarmOccurred WW atom." into qt-dev
This commit is contained in:
@@ -994,6 +994,19 @@ message WakeupAlarmOccurred {
|
|||||||
|
|
||||||
// Name of source package (for historical reasons, since BatteryStats tracked it).
|
// Name of source package (for historical reasons, since BatteryStats tracked it).
|
||||||
optional string package_name = 3;
|
optional string package_name = 3;
|
||||||
|
|
||||||
|
// These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
|
||||||
|
enum Bucket {
|
||||||
|
UNKNOWN = 0;
|
||||||
|
EXEMPTED = 5;
|
||||||
|
ACTIVE = 10;
|
||||||
|
WORKING_SET = 20;
|
||||||
|
FREQUENT = 30;
|
||||||
|
RARE = 40;
|
||||||
|
NEVER = 50;
|
||||||
|
}
|
||||||
|
// The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
|
||||||
|
optional Bucket app_standby_bucket = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -8457,18 +8457,43 @@ public class ActivityManagerService extends IActivityManager.Stub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DEBUG_POWER) {
|
int standbyBucket = 0;
|
||||||
Slog.w(TAG, "noteWakupAlarm[ sourcePkg=" + sourcePkg + ", sourceUid=" + sourceUid
|
|
||||||
+ ", workSource=" + workSource + ", tag=" + tag + "]");
|
|
||||||
}
|
|
||||||
|
|
||||||
mBatteryStatsService.noteWakupAlarm(sourcePkg, sourceUid, workSource, tag);
|
mBatteryStatsService.noteWakupAlarm(sourcePkg, sourceUid, workSource, tag);
|
||||||
if (workSource != null) {
|
if (workSource != null) {
|
||||||
StatsLog.write(StatsLog.WAKEUP_ALARM_OCCURRED, workSource, tag, sourcePkg);
|
String workSourcePackage = workSource.getName(0);
|
||||||
|
int workSourceUid = workSource.getAttributionUid();
|
||||||
|
if (workSourcePackage == null) {
|
||||||
|
workSourcePackage = sourcePkg;
|
||||||
|
workSourceUid = sourceUid;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mUsageStatsService != null) {
|
||||||
|
standbyBucket = mUsageStatsService.getAppStandbyBucket(workSourcePackage,
|
||||||
|
UserHandle.getUserId(workSourceUid), SystemClock.elapsedRealtime());
|
||||||
|
}
|
||||||
|
|
||||||
|
StatsLog.write(StatsLog.WAKEUP_ALARM_OCCURRED, workSource, tag, sourcePkg,
|
||||||
|
standbyBucket);
|
||||||
|
if (DEBUG_POWER) {
|
||||||
|
Slog.w(TAG, "noteWakeupAlarm[ sourcePkg=" + sourcePkg + ", sourceUid=" + sourceUid
|
||||||
|
+ ", workSource=" + workSource + ", tag=" + tag + ", standbyBucket="
|
||||||
|
+ standbyBucket + " wsName=" + workSourcePackage + ")]");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (mUsageStatsService != null) {
|
||||||
|
standbyBucket = mUsageStatsService.getAppStandbyBucket(sourcePkg,
|
||||||
|
UserHandle.getUserId(sourceUid), SystemClock.elapsedRealtime());
|
||||||
|
}
|
||||||
StatsLog.write_non_chained(StatsLog.WAKEUP_ALARM_OCCURRED, sourceUid, null, tag,
|
StatsLog.write_non_chained(StatsLog.WAKEUP_ALARM_OCCURRED, sourceUid, null, tag,
|
||||||
sourcePkg);
|
sourcePkg, standbyBucket);
|
||||||
|
if (DEBUG_POWER) {
|
||||||
|
Slog.w(TAG, "noteWakeupAlarm[ sourcePkg=" + sourcePkg + ", sourceUid=" + sourceUid
|
||||||
|
+ ", workSource=" + workSource + ", tag=" + tag + ", standbyBucket="
|
||||||
|
+ standbyBucket + "]");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user