Skip to content
Snippets Groups Projects
Verified Commit ac3f1f4c authored by Torsten Grote's avatar Torsten Grote
Browse files

Only show hotspot frequency, if we can get the real one

parent f0fb9489
No related branches found
No related tags found
1 merge request!1Add web server for app downloading and small fixes
......@@ -134,11 +134,14 @@ public class MainViewModel extends AndroidViewModel {
releaseWifiP2pHotspot(app.getString(R.string.callback_no_group_info));
}
} else {
double freq = 2.4;
if (SDK_INT >= 29) freq = ((double) group.getFrequency()) / 1000;
config.setValue(new NetworkConfig(group.getNetworkName(), group.getPassphrase(),
true));
status.setValue(app.getString(R.string.callback_started, freq));
if (SDK_INT >= 29) {
double freq = ((double) group.getFrequency()) / 1000;
status.setValue(app.getString(R.string.callback_started_freq, freq));
} else {
status.setValue(app.getString(R.string.callback_started));
}
startWebServer();
}
};
......
......@@ -5,7 +5,8 @@
<string name="ssid">Name: %s</string>
<string name="password">Password: %s</string>
<string name="starting_hotspot">Starting hotspot</string>
<string name="callback_started">Hotspot started (%1$.1f GHz)</string>
<string name="callback_started">Hotspot started</string>
<string name="callback_started_freq">Hotspot started (%1$.2f GHz)</string>
<string name="callback_failed">Hotspot failed to start: error code %d</string>
<string name="callback_waiting">Waiting for hotspot to start</string>
<string name="callback_no_group_info">Hotspot failed to start: no group info</string>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment