Kaydet (Commit) 0c4a7499 authored tarafından Miklos Vajna's avatar Miklos Vajna

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
üst 5386ce98
......@@ -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>
......
......@@ -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" />
......
......@@ -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();
......
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