Skip to content

Commit 4632485

Browse files
dulmandakhfacebook-github-bot
authored andcommitted
SuppressLint("MissingPermission") in Location, NetInfo, Vibration mod… (facebook#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: facebook#23294 Differential Revision: D13959120 Pulled By: cpojer fbshipit-source-id: 10526f1218989b805528a5415e03371d5865be63
1 parent 7bf3447 commit 4632485

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

ReactAndroid/src/main/java/com/facebook/react/modules/location/LocationModule.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
package com.facebook.react.modules.location;
99

10+
import android.annotation.SuppressLint;
1011
import android.content.Context;
1112
import android.location.Location;
1213
import android.location.LocationListener;
@@ -32,6 +33,7 @@
3233
/**
3334
* Native module that exposes Geolocation to JS.
3435
*/
36+
@SuppressLint("MissingPermission")
3537
@ReactModule(name = LocationModule.NAME)
3638
public class LocationModule extends ReactContextBaseJavaModule {
3739

ReactAndroid/src/main/java/com/facebook/react/modules/vibration/VibrationModule.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
package com.facebook.react.modules.vibration;
99

10+
import android.annotation.SuppressLint;
1011
import android.content.Context;
1112
import android.os.Vibrator;
1213

@@ -16,6 +17,7 @@
1617
import com.facebook.react.bridge.ReadableArray;
1718
import com.facebook.react.module.annotations.ReactModule;
1819

20+
@SuppressLint("MissingPermission")
1921
@ReactModule(name = VibrationModule.NAME)
2022
public class VibrationModule extends ReactContextBaseJavaModule {
2123

moved/NetInfoModule.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
package com.facebook.react.modules.netinfo;
99

10+
import android.annotation.SuppressLint;
1011
import android.content.BroadcastReceiver;
1112
import android.content.Context;
1213
import android.content.Intent;
@@ -30,6 +31,7 @@
3031
/**
3132
* Module that monitors and provides information about the connectivity state of the device.
3233
*/
34+
@SuppressLint("MissingPermission")
3335
@ReactModule(name = NetInfoModule.NAME)
3436
public class NetInfoModule extends ReactContextBaseJavaModule
3537
implements LifecycleEventListener {

0 commit comments

Comments
 (0)