fix lint error/warnings (#23333)

Summary:
Fix lint errors and warning, which might be a cause of various crashes on older Android OS, using Android Support Library.

```bash
./gradlew :ReactAndroid:lint
```

[Android] [Changed] - fix lint error/warnings
Pull Request resolved: https://github.com/facebook/react-native/pull/23333

Differential Revision: D14019322

Pulled By: mdvacca

fbshipit-source-id: 74c98da269c318cf3b114c8d9c876186369f2b8c
This commit is contained in:
Dulmandakh
2019-02-09 22:21:40 -08:00
committed by Facebook Github Bot
parent 8ccc55fbd3
commit d2fc19f4aa
11 changed files with 29 additions and 12 deletions
@@ -12,6 +12,7 @@ import javax.annotation.Nullable;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
import android.annotation.SuppressLint;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -67,6 +68,7 @@ public abstract class HeadlessJsTaskService extends Service implements HeadlessJ
/**
* Acquire a wake lock to ensure the device doesn't go to sleep while processing background tasks.
*/
@SuppressLint("WakelockTimeout")
public static void acquireWakeLockNow(Context context) {
if (sWakeLock == null || !sWakeLock.isHeld()) {
PowerManager powerManager =