SuppressLint("MissingPermission") in Location, NetInfo, Vibration mod… (#23294)

Summary:
Location, NetInfo and Vibration modules require its own permissions to work properly, and Android Studio and lint shows warning in the modules because permissions are not found in AndroidManifest.xml of ReactAndroid, due to that not all apps require these functionalities/permissions. Therefore, developers have to add required permissions if they want to use before mentioned functionalities.

This PR suppresses missing permission warnings.

[Android] [Changed] - Suppress missing permission warnings
Pull Request resolved: https://github.com/facebook/react-native/pull/23294

Differential Revision: D13959120

Pulled By: cpojer

fbshipit-source-id: 10526f1218989b805528a5415e03371d5865be63
This commit is contained in:
Dulmandakh
2019-02-05 10:26:32 -08:00
committed by Facebook Github Bot
parent 38eb2a70af
commit d53dbb0dfb
3 changed files with 6 additions and 0 deletions
@@ -7,6 +7,7 @@
package com.facebook.react.modules.location;
import android.annotation.SuppressLint;
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
@@ -32,6 +33,7 @@ import javax.annotation.Nullable;
/**
* Native module that exposes Geolocation to JS.
*/
@SuppressLint("MissingPermission")
@ReactModule(name = LocationModule.NAME)
public class LocationModule extends ReactContextBaseJavaModule {
@@ -7,6 +7,7 @@
package com.facebook.react.modules.netinfo;
import android.annotation.SuppressLint;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -30,6 +31,7 @@ import static com.facebook.react.modules.core.DeviceEventManagerModule.RCTDevice
/**
* Module that monitors and provides information about the connectivity state of the device.
*/
@SuppressLint("MissingPermission")
@ReactModule(name = NetInfoModule.NAME)
public class NetInfoModule extends ReactContextBaseJavaModule
implements LifecycleEventListener {
@@ -7,6 +7,7 @@
package com.facebook.react.modules.vibration;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Vibrator;
@@ -16,6 +17,7 @@ import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.module.annotations.ReactModule;
@SuppressLint("MissingPermission")
@ReactModule(name = VibrationModule.NAME)
public class VibrationModule extends ReactContextBaseJavaModule {