use of com.googlecode.asmack.disco.DiscoReceiver in project AsmackService by rtreffer.
the class XmppTransportService method onCreate.
/**
* Initialize the xmpp service, binding all required receivers.
*/
@Override
public void onCreate() {
super.onCreate();
accountManager = AccountManager.get(this);
ContentProviderClient provider = getContentResolver().acquireContentProviderClient(ContactsContract.AUTHORITY_URI);
ContactDataMapper mapper = new ContactDataMapper(provider);
BroadcastReceiver receiver = new PresenceBroadcastReceiver(mapper);
registerReceiver(receiver, new IntentFilter(XmppTransportService.XMPP_STANZA_INTENT));
receiver = new DiscoReceiver();
registerReceiver(receiver, new IntentFilter(XmppTransportService.XMPP_STANZA_INTENT));
receiver = new KeepaliveActionIntentReceiver(this);
;
registerReceiver(receiver, new IntentFilter(Intent.ACTION_TIME_TICK));
receiver = new SendStanzaReceiver(this);
registerReceiver(receiver, new IntentFilter(XMPP_STANZA_SEND_INTENT));
receiver = new ConnectivityReceiver(this);
registerReceiver(receiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
accountManager.addOnAccountsUpdatedListener(this, null, true);
}
Aggregations