Commit 9ace9635 authored by Jeffrey I. Schiller's avatar Jeffrey I. Schiller

Require that the "wifi.enabled" flag in appengine-web.xml be set to

true to enable WiFi use of MIT App Inventor. As of this commit, this
is shipped set to false.

Change-Id: Ib053a3d8173a7684c4748525b138a20cd6d62395
parent 4bac9bda
......@@ -7,6 +7,7 @@ package com.google.appinventor.server.project.utils;
import com.google.appinventor.common.version.GitBuildId;
import com.google.appinventor.server.encryption.EncryptionException;
import com.google.appinventor.server.flags.Flag;
import com.google.appinventor.shared.rpc.ServerLayout;
import com.google.appinventor.shared.rpc.user.UserInfoProvider;
......@@ -40,6 +41,8 @@ public final class JavaWebStart {
private static final String VERSION_PREFIX_DELIMITER = "_";
private static final Flag<Boolean> wifiEnabled = Flag.createFlag("wifi.enabled", false);
private JavaWebStart() { // COV_NF_LINE
} // COV_NF_LINE
......@@ -141,6 +144,10 @@ public final class JavaWebStart {
for (String jarFile : jarFiles) {
jnlp.append(" <jar href=\"").append(jarFile).append("\"/>\n");
}
if (wifiEnabled.get())
jnlp.append(" <property name=\"wifi.enabled\" value=\"true\"/>\n");
jnlp.append(" </resources>\n")
.append(" <application-desc main-class=\"").append(mainClass).append("\">\n");
for (String arg : args) {
......
......@@ -51,6 +51,12 @@
buildserver to match -->
<property name="build.send.git.version" value="true" />
<!-- Set this to true to enable the use of Wifi connections from the blocks editor to
the phone. The phone must have an up-to-date copy of the MIT AICompanion App to
use this feature. -->
<property name="wifi.enabled" value="false" />
</system-properties>
<!-- Enable concurrency in the app engine server -->
......
......@@ -90,8 +90,13 @@ public class CDeviceSelector extends JMenuBar {
} else {
connectedIcon = new ImageIcon(descriptor);
}
if (System.getProperty("wifi.enabled") != null && System.getProperty("wifi.enabled").equals("true")) {
addDevice("WiFi"); // Add the WiFi device, so now there will always be at least one
// which means that the noDevicesPlaceholder can be deprecated
// which means that the noDevicesPlaceholder can be deprecated when WiFi is enabled.
} else {
System.out.println("Wifi Disabled");
}
}
public void addCallback(DeviceSelectedCallback callback) {
......
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