For #13959: add comment to explain why we only resetAfter in certain build modes.
This commit is contained in:
parent
3bf71ef655
commit
e1bd6191c7
|
@ -15,6 +15,8 @@ import org.mozilla.fenix.Config
|
||||||
* @return the value returned by [functionBlock].
|
* @return the value returned by [functionBlock].
|
||||||
*/
|
*/
|
||||||
inline fun <R> StrictMode.ThreadPolicy.resetPoliciesAfter(functionBlock: () -> R): R {
|
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) {
|
return if (Config.channel.isDebug) {
|
||||||
resetAfter { functionBlock() }
|
resetAfter { functionBlock() }
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user