mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-05-19 14:10:38 -04:00
[app] Don't crash when trying to enable Wi-Fi
Fixes acra-crash-reports#741
This commit is contained in:
committed by
Hans-Christoph Steiner
parent
9f637a602c
commit
650dc4432a
@@ -492,7 +492,13 @@ public class SwapWorkflowActivity extends AppCompatActivity {
|
||||
if (Build.VERSION.SDK_INT <= 28) {
|
||||
wifiManager.setWifiEnabled(false);
|
||||
}
|
||||
if (wifiApControl.enable()) {
|
||||
boolean wifiEnabled = false;
|
||||
try {
|
||||
wifiEnabled = wifiApControl.enable();
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Error enabling WiFi: ", e);
|
||||
}
|
||||
if (wifiEnabled) {
|
||||
Toast.makeText(this, R.string.swap_toast_hotspot_enabled, Toast.LENGTH_SHORT).show();
|
||||
SwapService.putHotspotActivatedUserPreference(true);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user