diff options
author | Daniel Gultsch <inputmice@siacs.eu> | 2015-01-08 14:45:44 +0100 |
---|---|---|
committer | Daniel Gultsch <inputmice@siacs.eu> | 2015-01-08 14:45:44 +0100 |
commit | 0fe193b027b2879d68fe7bb9b27c0a8cd35aa205 (patch) | |
tree | cfa417256b4434b445202bfbac68d4dfdb9a6881 /src/main/java | |
parent | f8aa1bfec4df8cc7e34eae537f68ab45ed62756c (diff) |
code cleanup
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/XmppConnectionService.java | 27 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java | 2 |
2 files changed, 15 insertions, 14 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 495b9c26..ad951f3e 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -388,17 +388,20 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa public int onStartCommand(Intent intent, int flags, int startId) { final String action = intent == null ? null : intent.getAction(); if (action != null) { - if (action.equals(ACTION_MERGE_PHONE_CONTACTS)) { - PhoneHelper.loadPhoneContacts(getApplicationContext(), new CopyOnWriteArrayList<Bundle>(), this); - return START_STICKY; - } else if (action.equals(Intent.ACTION_SHUTDOWN)) { - logoutAndSave(); - return START_NOT_STICKY; - } else if (action.equals(ACTION_CLEAR_NOTIFICATION)) { - mNotificationService.clear(); - } else if (action.equals(ACTION_DISABLE_FOREGROUND)) { - getPreferences().edit().putBoolean("keep_foreground_service",false).commit(); - toggleForegroundService(); + switch (action) { + case ACTION_MERGE_PHONE_CONTACTS: + PhoneHelper.loadPhoneContacts(getApplicationContext(), new CopyOnWriteArrayList<Bundle>(), this); + return START_STICKY; + case Intent.ACTION_SHUTDOWN: + logoutAndSave(); + return START_NOT_STICKY; + case ACTION_CLEAR_NOTIFICATION: + mNotificationService.clear(); + break; + case ACTION_DISABLE_FOREGROUND: + getPreferences().edit().putBoolean("keep_foreground_service",false).commit(); + toggleForegroundService(); + break; } } this.wakeLock.acquire(); @@ -1484,7 +1487,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa @Override public void onIqPacketReceived(Account account, IqPacket packet) { if (packet.getType() != IqPacket.TYPE.ERROR) { - ArrayList<String> features = new ArrayList<String>(); + ArrayList<String> features = new ArrayList<>(); for (Element child : packet.query().getChildren()) { if (child != null && child.getName().equals("feature")) { String var = child.getAttribute("var"); diff --git a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java index daaa59cf..a6df1085 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java @@ -233,8 +233,6 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers final Contact contact = user.getContact(); if (contact != null) { name = contact.getDisplayName(); - } else if (user.getJid() != null) { - name = user.getJid().toBareJid().toString(); } else { name = user.getName(); } |