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

Commit ce271360 authored by John Spurlock's avatar John Spurlock Committed by Android (Google) Code Review
Browse files

Merge "Dump the countdown condition, if active."

parents 96658f71 fb8eb00b
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -88,6 +88,8 @@ public class ConditionProviders extends ManagedServices {
            for (int i = 0; i < mRecords.size(); i++) {
                pw.print("      "); pw.println(mRecords.get(i));
            }
            pw.print("    mCountdownHelper: ");
            pw.println(mCountdownHelper.getCurrentConditionDescription());
        }
    }

@@ -474,6 +476,16 @@ public class ConditionProviders extends ManagedServices {
            }
        }

        public String getCurrentConditionDescription() {
            if (mCurrent == 0) return null;
            final long time = mCurrent;
            final long now = System.currentTimeMillis();
            final CharSequence span =
                    DateUtils.getRelativeTimeSpanString(time, now, DateUtils.MINUTE_IN_MILLIS);
            return String.format("Scheduled for %s, %s in the future (%s), now=%s",
                    ts(time), time - now, span, ts(now));
        }

        private String ts(long time) {
            return new Date(time) + " (" + time + ")";
        }