diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-11-29 12:23:03 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-11-29 12:24:32 +0100 |
commit | 0c4a7499619d54038aae39c869ee2de5836b03d2 (patch) | |
tree | 673fffda42578bd5400c1e16755db85ebd5824ef /android | |
parent | sdremote: allow accessing options menu from the selector activity as well (diff) | |
download | core-0c4a7499619d54038aae39c869ee2de5836b03d2.tar.gz core-0c4a7499619d54038aae39c869ee2de5836b03d2.zip |
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
Diffstat (limited to 'android')
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(); |