use 'phone' or 'tablet' as default resource
This commit is contained in:
parent
908aa19a36
commit
7113e21a43
|
@ -851,7 +851,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
|
||||||
|
|
||||||
public XmppConnection createConnection(final Account account) {
|
public XmppConnection createConnection(final Account account) {
|
||||||
final SharedPreferences sharedPref = getPreferences();
|
final SharedPreferences sharedPref = getPreferences();
|
||||||
account.setResource(sharedPref.getString("resource", "mobile")
|
account.setResource(sharedPref.getString("resource", getString(R.string.default_resource))
|
||||||
.toLowerCase(Locale.getDefault()));
|
.toLowerCase(Locale.getDefault()));
|
||||||
final XmppConnection connection = new XmppConnection(account, this);
|
final XmppConnection connection = new XmppConnection(account, this);
|
||||||
connection.setOnMessagePacketReceivedListener(this.mMessageParser);
|
connection.setOnMessagePacketReceivedListener(this.mMessageParser);
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="default_resource">Tablet</string>
|
||||||
|
</resources>
|
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="default_resource">Phone</string>
|
||||||
|
</resources>
|
|
@ -9,7 +9,7 @@
|
||||||
android:title="@string/pref_grant_presence_updates"/>
|
android:title="@string/pref_grant_presence_updates"/>
|
||||||
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:defaultValue="Mobile"
|
android:defaultValue="@string/default_resource"
|
||||||
android:entries="@array/resources"
|
android:entries="@array/resources"
|
||||||
android:entryValues="@array/resources"
|
android:entryValues="@array/resources"
|
||||||
android:key="resource"
|
android:key="resource"
|
||||||
|
|
Loading…
Reference in New Issue