Skip to content

Commit

Permalink
For mozilla-mobile#13959: add comment to explain why we only resetAft…
Browse files Browse the repository at this point in the history
…er in certain build modes.
  • Loading branch information
mcomella committed Sep 28, 2020
1 parent 3bf71ef commit e1bd619
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/src/main/java/org/mozilla/fenix/ext/StrictMode.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import org.mozilla.fenix.Config
* @return the value returned by [functionBlock].
*/
inline fun <R> 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 {
Expand Down

0 comments on commit e1bd619

Please sign in to comment.