Commit 53baf1a0 authored by Toni Beier's avatar Toni Beier

Merge branch 'connection_test_compatible_with_target_sdk_over_25' into 'master'

Connection test works on target sdk version higher than 25

See merge request !9
parents 6b6908e3 04de5305
Pipeline #21817 failed with stages
in 1 minute and 12 seconds
......@@ -606,7 +606,12 @@ public class MainActivity extends AppCompatActivity {
if (info != null && info.isConnected()) {
WifiManager wifiManager = (WifiManager)context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
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);
......
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