This repository was archived by the owner on Apr 9, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
share_app/src/main/java/org/odk/share Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 1919import android .widget .Toast ;
2020
2121import org .odk .share .R ;
22+ import org .odk .share .controller .WifiHelper ;
2223import org .odk .share .controller .WifiHotspotHelper ;
2324import org .odk .share .events .HotspotEvent ;
2425import org .odk .share .events .UploadEvent ;
@@ -100,6 +101,10 @@ protected void onCreate(Bundle savedInstanceState) {
100101 Timber .e ("Port not available for socket communication" );
101102 finish ();
102103 }
104+ WifiHelper wifiHelper = new WifiHelper (this );
105+ if (wifiHelper .getWifiManager ().isWifiEnabled ()) {
106+ wifiHelper .disableWifi (null );
107+ }
103108
104109 isHotspotInitiated = false ;
105110 isHotspotRunning = false ;
Original file line number Diff line number Diff line change @@ -92,7 +92,9 @@ private void removeNetworkAndEnableOther(String ssid) {
9292 }
9393
9494 public void disableWifi (String ssid ) {
95- removeNetworkAndEnableOther (ssid );
95+ if (ssid != null ) {
96+ removeNetworkAndEnableOther (ssid );
97+ }
9698 wifiManager .setWifiEnabled (false );
9799 }
98100
You can’t perform that action at this time.
0 commit comments