diff options
Diffstat (limited to 'android/sdremote')
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(); |