Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2fd352d authored by Suprabh Shukla's avatar Suprabh Shukla Committed by android-build-merger
Browse files

Merge "Removing noisy logging" into qt-dev am: 128c538b am: 30089253

am: 38857f80

Change-Id: Ic5689e84af0361bb6b633620b25bee15748f41e4
parents 77449ce6 38857f80
Loading
Loading
Loading
Loading
+0 −36
Original line number Original line Diff line number Diff line
@@ -3019,46 +3019,10 @@ class AlarmManagerService extends SystemService {
                DateFormat.format(pattern, info.getTriggerTime()).toString();
                DateFormat.format(pattern, info.getTriggerTime()).toString();
    }
    }


    /**
     * If the last time AlarmThread woke up precedes any due wakeup or non-wakeup alarm that we set
     * by more than half a minute, log a wtf.
     */
    private void validateLastAlarmExpiredLocked(long nowElapsed) {
        final StringBuilder errorMsg = new StringBuilder();
        boolean stuck = false;
        if (mNextNonWakeup < (nowElapsed - 10_000) && mLastWakeup < mNextNonWakeup) {
            stuck = true;
            errorMsg.append("[mNextNonWakeup=");
            TimeUtils.formatDuration(mNextNonWakeup - nowElapsed, errorMsg);
            errorMsg.append(" set at ");
            TimeUtils.formatDuration(mNextNonWakeUpSetAt - nowElapsed, errorMsg);
            errorMsg.append(", mLastWakeup=");
            TimeUtils.formatDuration(mLastWakeup - nowElapsed, errorMsg);
            errorMsg.append(", timerfd_gettime=" + mInjector.getNextAlarm(ELAPSED_REALTIME));
            errorMsg.append("];");
        }
        if (mNextWakeup < (nowElapsed - 10_000) && mLastWakeup < mNextWakeup) {
            stuck = true;
            errorMsg.append("[mNextWakeup=");
            TimeUtils.formatDuration(mNextWakeup - nowElapsed, errorMsg);
            errorMsg.append(" set at ");
            TimeUtils.formatDuration(mNextWakeUpSetAt - nowElapsed, errorMsg);
            errorMsg.append(", mLastWakeup=");
            TimeUtils.formatDuration(mLastWakeup - nowElapsed, errorMsg);
            errorMsg.append(", timerfd_gettime="
                    + mInjector.getNextAlarm(ELAPSED_REALTIME_WAKEUP));
            errorMsg.append("];");
        }
        if (stuck) {
            Slog.wtf(TAG, "Alarm delivery stuck: " + errorMsg.toString());
        }
    }

    void rescheduleKernelAlarmsLocked() {
    void rescheduleKernelAlarmsLocked() {
        // Schedule the next upcoming wakeup alarm.  If there is a deliverable batch
        // Schedule the next upcoming wakeup alarm.  If there is a deliverable batch
        // prior to that which contains no wakeups, we schedule that as well.
        // prior to that which contains no wakeups, we schedule that as well.
        final long nowElapsed = mInjector.getElapsedRealtime();
        final long nowElapsed = mInjector.getElapsedRealtime();
        validateLastAlarmExpiredLocked(nowElapsed);
        long nextNonWakeup = 0;
        long nextNonWakeup = 0;
        if (mAlarmBatches.size() > 0) {
        if (mAlarmBatches.size() > 0) {
            final Batch firstWakeup = findFirstWakeupBatchLocked();
            final Batch firstWakeup = findFirstWakeupBatchLocked();