From 0c4a7499619d54038aae39c869ee2de5836b03d2 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 29 Nov 2012 12:23:03 +0100 Subject: 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 --- android/sdremote/res/values/strings.xml | 2 ++ android/sdremote/res/xml/preferences.xml | 6 ++++++ .../impressremote/communication/CommunicationService.java | 6 +++++- 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'android/sdremote') 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 @@ Automatically decline all incoming calls. Volume Switching Change slides using volume buttons + Enable wireless + Try to connect to the computer over wireless Switch computer Return to Slide Bluetooth 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" /> + + 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(); -- cgit v1.2.3