use 'phone' or 'tablet' as default resource

This commit is contained in:
Daniel Gultsch 2016-05-12 18:47:41 +02:00
parent 908aa19a36
commit 7113e21a43
4 changed files with 10 additions and 2 deletions

View File

@ -851,7 +851,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
public XmppConnection createConnection(final Account account) {
final SharedPreferences sharedPref = getPreferences();
account.setResource(sharedPref.getString("resource", "mobile")
account.setResource(sharedPref.getString("resource", getString(R.string.default_resource))
.toLowerCase(Locale.getDefault()));
final XmppConnection connection = new XmppConnection(account, this);
connection.setOnMessagePacketReceivedListener(this.mMessageParser);

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="default_resource">Tablet</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="default_resource">Phone</string>
</resources>

View File

@ -9,7 +9,7 @@
android:title="@string/pref_grant_presence_updates"/>
<ListPreference
android:defaultValue="Mobile"
android:defaultValue="@string/default_resource"
android:entries="@array/resources"
android:entryValues="@array/resources"
android:key="resource"