diff options
| author | Jeff Sharkey <jsharkey@android.com> | 2018-02-20 13:36:14 -0700 |
|---|---|---|
| committer | Jeff Sharkey <jsharkey@android.com> | 2018-02-20 13:36:23 -0700 |
| commit | 4e0d30757e2c1d61dacc33655110268be165ec8a (patch) | |
| tree | 01f6d80a59a4d52a3f612fb67c0c40b89cd1d12d /core/java/android/util | |
| parent | 6b10cbd0f283b34351059b46e4c6e42a2382bb9a (diff) | |
Only emit debug logging when requested.
Test: builds, boots
Bug: 72556865
Change-Id: I69d5d760221ef907eeea38490f56243f0a3b9dcb
Diffstat (limited to 'core/java/android/util')
| -rw-r--r-- | core/java/android/util/RecurrenceRule.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/java/android/util/RecurrenceRule.java b/core/java/android/util/RecurrenceRule.java index 1fe638d6b76b..cd8b097cd2f1 100644 --- a/core/java/android/util/RecurrenceRule.java +++ b/core/java/android/util/RecurrenceRule.java @@ -41,7 +41,7 @@ import java.util.Objects; */ public class RecurrenceRule implements Parcelable { private static final String TAG = "RecurrenceRule"; - private static final boolean DEBUG = true; + private static final boolean LOGD = Log.isLoggable(TAG, Log.DEBUG); private static final int VERSION_INIT = 0; @@ -192,7 +192,7 @@ public class RecurrenceRule implements Parcelable { public RecurringIterator() { final ZonedDateTime anchor = (end != null) ? end : ZonedDateTime.now(sClock).withZoneSameInstant(start.getZone()); - if (DEBUG) Log.d(TAG, "Resolving using anchor " + anchor); + if (LOGD) Log.d(TAG, "Resolving using anchor " + anchor); updateCycle(); @@ -231,7 +231,7 @@ public class RecurrenceRule implements Parcelable { @Override public Pair<ZonedDateTime, ZonedDateTime> next() { - if (DEBUG) Log.d(TAG, "Cycle " + i + " from " + cycleStart + " to " + cycleEnd); + if (LOGD) Log.d(TAG, "Cycle " + i + " from " + cycleStart + " to " + cycleEnd); Pair<ZonedDateTime, ZonedDateTime> p = new Pair<>(cycleStart, cycleEnd); i--; updateCycle(); |
