summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-11-29 12:23:03 +0100
committerMiklos Vajna <vmiklos@suse.cz>2012-11-29 12:24:32 +0100
commit0c4a7499619d54038aae39c869ee2de5836b03d2 (patch)
tree673fffda42578bd5400c1e16755db85ebd5824ef
parent5386ce98300bbd1a8d2bda1342f6963ebb4e1a06 (diff)
sdremote: disable wifi by default in the client
It can be still enabled, but it makes little sense to have it on by default when the server is off by default. Change-Id: I625f90fd67781244cc4fffa90127fd1c8707c580
-rw-r--r--android/sdremote/res/values/strings.xml2
-rw-r--r--android/sdremote/res/xml/preferences.xml6
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java6
3 files changed, 13 insertions, 1 deletions
diff --git a/android/sdremote/res/values/strings.xml b/android/sdremote/res/values/strings.xml
index 150a38d857fc..9beaab7f869f 100644
--- a/android/sdremote/res/values/strings.xml
+++ b/android/sdremote/res/values/strings.xml
@@ -18,6 +18,8 @@
<string name="options_description">Automatically decline all incoming calls.</string>
<string name="options_volumeswitching">Volume Switching</string>
<string name="options_volumeswitching_descripton">Change slides using volume buttons</string>
+ <string name="options_enablewifi">Enable wireless</string>
+ <string name="options_enablewifi_descripton">Try to connect to the computer over wireless</string>
<string name="options_switchcomputer">Switch computer</string>
<string name="blankscreen_return">Return to Slide</string>
<string name="bluetooth">Bluetooth</string>
diff --git a/android/sdremote/res/xml/preferences.xml b/android/sdremote/res/xml/preferences.xml
index 0a1006365be2..ad7b1b327758 100644
--- a/android/sdremote/res/xml/preferences.xml
+++ b/android/sdremote/res/xml/preferences.xml
@@ -8,6 +8,12 @@
android:summary="@string/options_volumeswitching_descripton"
android:title="@string/options_volumeswitching" />
+ <CheckBoxPreference
+ android:defaultValue="false"
+ android:key="option_enablewifi"
+ android:summary="@string/options_enablewifi_descripton"
+ android:title="@string/options_enablewifi" />
+
<Preference
android:key="option_switchcomputer"
android:title="@string/options_switchcomputer" />
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java b/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
index b35e1e93de35..cc563980f42d 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
@@ -23,6 +23,7 @@ import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Binder;
import android.os.IBinder;
+import android.preference.PreferenceManager;
import android.support.v4.content.LocalBroadcastManager;
public class CommunicationService extends Service implements Runnable {
@@ -125,7 +126,10 @@ public class CommunicationService extends Service implements Runnable {
private boolean mBluetoothPreviouslyEnabled;
public void startSearching() {
- mNetworkFinder.startFinding();
+ SharedPreferences aPref = PreferenceManager.getDefaultSharedPreferences(this);
+ boolean bEnableWifi = aPref.getBoolean("option_enablewifi", false);
+ if (bEnableWifi)
+ mNetworkFinder.startFinding();
BluetoothAdapter aAdapter = BluetoothAdapter.getDefaultAdapter();
if (aAdapter != null) {
mBluetoothPreviouslyEnabled = aAdapter.isEnabled();