RESTRICT AUTOMERGE Turning off wtf logging for alarm limit

The issue is not happening frequently enough for the large amount of
logging to be justfied. A bugreport should still contain the full list
of alarms when the caller is a core system uid. This should be enough
for debugging critical crashes.

Test: Builds, existing tests pass.
adb logcat -s AlarmManager

Bug: 157782538
Change-Id: I6998007888d5b313595c349322abba72ad66e91f
This commit is contained in:
Suprabh Shukla
2020-07-13 15:30:17 -07:00
parent fcb77e88ab
commit b42083b06a

View File

@@ -150,8 +150,6 @@ class AlarmManagerService extends SystemService {
// TODO (b/157782538): Turn off once bug is fixed. // TODO (b/157782538): Turn off once bug is fixed.
static final boolean DEBUG_PER_UID_LIMIT = true; static final boolean DEBUG_PER_UID_LIMIT = true;
// TODO (b/157782538): Turn off once bug is fixed.
static final boolean WARN_SYSTEM_ON_ALARM_LIMIT = true;
static final boolean RECORD_ALARMS_IN_HISTORY = true; static final boolean RECORD_ALARMS_IN_HISTORY = true;
static final boolean RECORD_DEVICE_IDLE_ALARMS = false; static final boolean RECORD_DEVICE_IDLE_ALARMS = false;
@@ -1774,19 +1772,8 @@ class AlarmManagerService extends SystemService {
"Maximum limit of concurrent alarms " + mConstants.MAX_ALARMS_PER_UID "Maximum limit of concurrent alarms " + mConstants.MAX_ALARMS_PER_UID
+ " reached for uid: " + UserHandle.formatUid(callingUid) + " reached for uid: " + UserHandle.formatUid(callingUid)
+ ", callingPackage: " + callingPackage; + ", callingPackage: " + callingPackage;
Slog.w(TAG, errorMsg);
if (WARN_SYSTEM_ON_ALARM_LIMIT && UserHandle.isCore(callingUid)) { if (DEBUG_PER_UID_LIMIT && UserHandle.isCore(callingUid)) {
final StringWriter logWriter = new StringWriter();
final PrintWriter pw = new PrintWriter(logWriter);
pw.println(errorMsg);
pw.println("Next 20 alarms for " + callingUid + ":");
dumpUpcomingNAlarmsForUid(pw, callingUid, 20);
pw.flush();
Slog.wtf(TAG, logWriter.toString());
} else {
Slog.w(TAG, errorMsg);
}
if (DEBUG_PER_UID_LIMIT) {
logAllAlarmsForUidLocked(callingUid); logAllAlarmsForUidLocked(callingUid);
} }
throw new IllegalStateException(errorMsg); throw new IllegalStateException(errorMsg);