Skip to content

Commit a9822aa

Browse files
author
Parker Bond
committed
don't request special permissions on SDK 24+
1 parent d45f3bc commit a9822aa

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

android/src/main/java/com/devstepbcn/wifi/AndroidWifiModule.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ public void forceWifiUsage(boolean useWifi) {
106106
if (useWifi) {
107107
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
108108

109-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
109+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
110+
canWriteFlag = true;
111+
// Only need ACTION_MANAGE_WRITE_SETTINGS on 6.0.0, regular permissions suffice on later versions
112+
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
110113
canWriteFlag = Settings.System.canWrite(reactContext);
111114

112115
if (!canWriteFlag) {
@@ -520,4 +523,3 @@ public void onReceive(Context c, Intent intent) {
520523
}
521524
}
522525
}
523-

0 commit comments

Comments
 (0)