Skip to content

Commit 95aec59

Browse files
authored
Merge pull request #56 from iamcc/patch-1
fix: cannot find symbol context
2 parents 43ea9a8 + 676ec0d commit 95aec59

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

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

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

108108
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
109-
canWriteFlag = Settings.System.canWrite(context);
109+
canWriteFlag = Settings.System.canWrite(reactContext);
110110

111111
if (!canWriteFlag) {
112112
Intent intent = new Intent(Settings.ACTION_MANAGE_WRITE_SETTINGS);
113-
intent.setData(Uri.parse("package:" + context.getPackageName()));
113+
intent.setData(Uri.parse("package:" + reactContext.getPackageName()));
114114
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
115115

116-
context.startActivity(intent);
116+
reactContext.startActivity(intent);
117117
}
118118
}
119119

120120
if (((Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) && canWriteFlag) || ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) && !(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M))) {
121-
final ConnectivityManager manager = (ConnectivityManager) context
121+
final ConnectivityManager manager = (ConnectivityManager) reactContext
122122
.getSystemService(Context.CONNECTIVITY_SERVICE);
123123
NetworkRequest.Builder builder;
124124
builder = new NetworkRequest.Builder();
@@ -146,7 +146,7 @@ public void onAvailable(Network network) {
146146
}
147147
} else {
148148
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
149-
ConnectivityManager manager = (ConnectivityManager) context
149+
ConnectivityManager manager = (ConnectivityManager) reactContext
150150
.getSystemService(Context.CONNECTIVITY_SERVICE);
151151
manager.bindProcessToNetwork(null);
152152
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {

0 commit comments

Comments
 (0)