mirror of
https://github.com/moparisthebest/Yaaic
synced 2024-11-26 10:52:16 -05:00
IRCService: Code cleanup and suppress warnings
This commit is contained in:
parent
2350e9743a
commit
14ed6f7f2b
@ -56,15 +56,15 @@ public class IRCService extends Service
|
|||||||
private final IRCBinder binder;
|
private final IRCBinder binder;
|
||||||
private final HashMap<Integer, IRCConnection> connections;
|
private final HashMap<Integer, IRCConnection> connections;
|
||||||
private boolean foreground = false;
|
private boolean foreground = false;
|
||||||
private ArrayList<String> connectedServerTitles;
|
private final ArrayList<String> connectedServerTitles;
|
||||||
private LinkedHashMap<String, Conversation> mentions;
|
private final LinkedHashMap<String, Conversation> mentions;
|
||||||
private int newMentions = 0;
|
private int newMentions = 0;
|
||||||
|
|
||||||
private static final int FOREGROUND_NOTIFICATION = 1;
|
private static final int FOREGROUND_NOTIFICATION = 1;
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("unchecked")
|
||||||
private static final Class[] mStartForegroundSignature = new Class[] { int.class, Notification.class };
|
private static final Class[] mStartForegroundSignature = new Class[] { int.class, Notification.class };
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("unchecked")
|
||||||
private static final Class[] mStopForegroundSignature = new Class[] { boolean.class };
|
private static final Class[] mStopForegroundSignature = new Class[] { boolean.class };
|
||||||
|
|
||||||
public static final String ACTION_FOREGROUND = "org.yaaic.service.foreground";
|
public static final String ACTION_FOREGROUND = "org.yaaic.service.foreground";
|
||||||
@ -263,8 +263,9 @@ public class IRCService extends Service
|
|||||||
*/
|
*/
|
||||||
public synchronized void addNewMention(int serverId, Conversation conversation, String msg, boolean vibrate, boolean sound)
|
public synchronized void addNewMention(int serverId, Conversation conversation, String msg, boolean vibrate, boolean sound)
|
||||||
{
|
{
|
||||||
if (conversation == null)
|
if (conversation == null) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
conversation.addNewMention();
|
conversation.addNewMention();
|
||||||
++newMentions;
|
++newMentions;
|
||||||
@ -287,16 +288,19 @@ public class IRCService extends Service
|
|||||||
*/
|
*/
|
||||||
public synchronized void ackNewMentions(int serverId, String convTitle)
|
public synchronized void ackNewMentions(int serverId, String convTitle)
|
||||||
{
|
{
|
||||||
if (convTitle == null)
|
if (convTitle == null) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Conversation conversation = mentions.remove(getConversationId(serverId, convTitle));
|
Conversation conversation = mentions.remove(getConversationId(serverId, convTitle));
|
||||||
if (conversation == null)
|
if (conversation == null) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
newMentions -= conversation.getNewMentions();
|
newMentions -= conversation.getNewMentions();
|
||||||
conversation.clearNewMentions();
|
conversation.clearNewMentions();
|
||||||
if (newMentions < 0)
|
if (newMentions < 0) {
|
||||||
newMentions = 0;
|
newMentions = 0;
|
||||||
|
}
|
||||||
|
|
||||||
updateNotification(null, null, false, false);
|
updateNotification(null, null, false, false);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user