diff --git a/Libraries/Core/Timers/JSTimers.js b/Libraries/Core/Timers/JSTimers.js index 9c5d2a099e3887..504daa5f446193 100644 --- a/Libraries/Core/Timers/JSTimers.js +++ b/Libraries/Core/Timers/JSTimers.js @@ -11,7 +11,6 @@ 'use strict'; const BatchedBridge = require('../../BatchedBridge/BatchedBridge'); -const Platform = require('../../Utilities/Platform'); const Systrace = require('../../Performance/Systrace'); const invariant = require('invariant'); @@ -36,14 +35,6 @@ export type JSTimerType = const FRAME_DURATION = 1000 / 60; const IDLE_CALLBACK_FRAME_DEADLINE = 1; -const MAX_TIMER_DURATION_MS = 60 * 1000; -const IS_ANDROID = Platform.OS === 'android'; -const ANDROID_LONG_TIMER_MESSAGE = - 'Setting a timer for a long period of time, i.e. multiple minutes, is a ' + - 'performance and correctness issue on Android as it keeps the timer ' + - 'module awake, and timers can only be called when the app is in the foreground. ' + - 'See https://github.com/facebook/react-native/issues/12981 for more info.'; - // Parallel arrays const callbacks: Array = []; const types: Array = []; @@ -218,15 +209,6 @@ const JSTimers = { * @param {number} duration Number of milliseconds. */ setTimeout: function(func: Function, duration: number, ...args: any): number { - if (__DEV__ && IS_ANDROID && duration > MAX_TIMER_DURATION_MS) { - console.warn( - ANDROID_LONG_TIMER_MESSAGE + - '\n' + - '(Saw setTimeout with duration ' + - duration + - 'ms)', - ); - } const id = _allocateCallback( () => func.apply(undefined, args), 'setTimeout', @@ -244,15 +226,6 @@ const JSTimers = { duration: number, ...args: any ): number { - if (__DEV__ && IS_ANDROID && duration > MAX_TIMER_DURATION_MS) { - console.warn( - ANDROID_LONG_TIMER_MESSAGE + - '\n' + - '(Saw setInterval with duration ' + - duration + - 'ms)', - ); - } const id = _allocateCallback( () => func.apply(undefined, args), 'setInterval',