Skip to content

Commit

Permalink
SuppressLint("MissingPermission") in Location, NetInfo, Vibration mod… (
Browse files Browse the repository at this point in the history
#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: #23294

Differential Revision: D13959120

Pulled By: cpojer

fbshipit-source-id: 10526f1218989b805528a5415e03371d5865be63
  • Loading branch information
dulmandakh authored and facebook-github-bot committed Feb 5, 2019
1 parent 38eb2a7 commit d53dbb0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -32,6 +33,7 @@
/**
* Native module that exposes Geolocation to JS.
*/
@SuppressLint("MissingPermission")
@ReactModule(name = LocationModule.NAME)
public class LocationModule extends ReactContextBaseJavaModule {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -30,6 +31,7 @@
/**
* 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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

package com.facebook.react.modules.vibration;

import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Vibrator;

Expand All @@ -16,6 +17,7 @@
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.module.annotations.ReactModule;

@SuppressLint("MissingPermission")
@ReactModule(name = VibrationModule.NAME)
public class VibrationModule extends ReactContextBaseJavaModule {

Expand Down

0 comments on commit d53dbb0

Please sign in to comment.