From 394465e33e71c6d427fd27ffe41401f0c6e121ba Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Tue, 22 Sep 2020 15:12:25 -0700 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/13959: add comment to explain why we only resetAfter in certain build modes. --- app/src/main/java/org/mozilla/fenix/ext/StrictMode.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/org/mozilla/fenix/ext/StrictMode.kt b/app/src/main/java/org/mozilla/fenix/ext/StrictMode.kt index 3caf21b981..634482c313 100644 --- a/app/src/main/java/org/mozilla/fenix/ext/StrictMode.kt +++ b/app/src/main/java/org/mozilla/fenix/ext/StrictMode.kt @@ -15,6 +15,8 @@ import org.mozilla.fenix.Config * @return the value returned by [functionBlock]. */ inline fun StrictMode.ThreadPolicy.resetPoliciesAfter(functionBlock: () -> R): R { + // Calling resetAfter takes 1-2ms (unknown device) so we only execute it if StrictMode can + // actually be enabled. https://github.com/mozilla-mobile/fenix/issues/11617 return if (Config.channel.isDebug) { resetAfter { functionBlock() } } else {