File tree Expand file tree Collapse file tree
android/src/main/java/com/devstepbcn/wifi Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,9 +109,12 @@ public void forceWifiUsage(boolean useWifi) {
109109 if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .N ) {
110110 canWriteFlag = true ;
111111 // Only need ACTION_MANAGE_WRITE_SETTINGS on 6.0.0, regular permissions suffice on later versions
112+ } else if (Build .VERSION .RELEASE .toString ().equals ("6.0.1" )) {
113+ canWriteFlag = true ;
114+ // Don't need ACTION_MANAGE_WRITE_SETTINGS on 6.0.1, if we can positively identify it treat like 7+
112115 } else if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .M ) {
116+ // On M 6.0.0 (N+ or higher and 6.0.1 hit above), we need ACTION_MANAGE_WRITE_SETTINGS to forceWifi.
113117 canWriteFlag = Settings .System .canWrite (reactContext );
114-
115118 if (!canWriteFlag ) {
116119 Intent intent = new Intent (Settings .ACTION_MANAGE_WRITE_SETTINGS );
117120 intent .setData (Uri .parse ("package:" + reactContext .getPackageName ()));
You can’t perform that action at this time.
0 commit comments