Commit 04de5305 authored by Toni Beier's avatar Toni Beier

Connection test works on target sdk version higher than 25

parent 6b6908e3
Pipeline #21754 passed with stages
in 3 minutes and 12 seconds
...@@ -606,7 +606,12 @@ public class MainActivity extends AppCompatActivity { ...@@ -606,7 +606,12 @@ public class MainActivity extends AppCompatActivity {
if (info != null && info.isConnected()) { if (info != null && info.isConnected()) {
WifiManager wifiManager = (WifiManager)context.getApplicationContext().getSystemService(Context.WIFI_SERVICE); WifiManager wifiManager = (WifiManager)context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
WifiInfo wifiInfo = wifiManager.getConnectionInfo(); WifiInfo wifiInfo = wifiManager.getConnectionInfo();
String ssid = wifiInfo.getSSID(); String ssid = null;
if (android.os.Build.VERSION.SDK_INT <= Build.VERSION_CODES.N_MR1) {
ssid = wifiInfo.getSSID();
} else {
ssid = info.getExtraInfo();
}
Log.d("postInstallCheck", "connected to Wifi: " + ssid); Log.d("postInstallCheck", "connected to Wifi: " + ssid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment