with reference to the earlier discussion:
Omemo message session with second new omemoDevice of same user failed
It was found that Omemo is not taking any action on receiving the pubsub#event from buddies.
On further investigation, based on the captured log below, it was found that OmemService#registerDeviceListListener() happens ~2 after the first pubsub#event has sent from the buddy. Therefore the following methods in OmemoService and OmemoManager have failed to capture the pubsub#event and to take appropriate actions:
private static void subscribeToDeviceLists(OmemoManager omemoManager) {
registerDeviceListListener(omemoManager);
ServiceDiscoveryManager.getInstanceFor(omemoManager.getConnection()).addFeature(PEP_NODE_DEVICE_LIST_NOTIFY);
}
private static void registerDeviceListListener(final OmemoManager omemoManager) {
PEPManager.getInstanceFor(omemoManager.getConnection()).removePEPListener(omemoManager.deviceListUpdateListener);
PEPManager.getInstanceFor(omemoManager.getConnection()).addPEPListener(omemoManager.deviceListUpdateListener);
}
PEPListener deviceListUpdateListener = new PEPListener() { …};
============================
Note: pubsub#event is sent by the xmpp ejabberd server is because aTalk has subscribed to the pubsub#event right after the xmpp connection is made.
// XEP-0384: OMEMO Encryption
supportedFeatures.add(OmemoConstants.PEP_NODE_DEVICE_LIST_NOTIFY);
see discussion thread: Entity Capabilities required for OMEMO support
=== =================== aTalk log on pubsub#event ===================
07-18 08:00:55.600 D/SMACK: RECV (0):
07-18 08:00:55.620 D/SMACK: RECV (0):
07-18 08:00:55.620 D/SMACK: RECV (0):
07-18 08:00:55.630 D/SMACK: RECV (0):
07-18 08:00:55.640 D/SMACK: RECV (0):
07-18 08:00:55.680 D/SMACK: RECV (0):
07-18 08:00:55.680 D/SMACK: RECV (0):
07-18 08:00:55.680 D/SMACK: RECV (0):
07-18 08:00:55.680 D/SMACK: RECV (0):
07-18 08:00:55.680 D/SMACK: RECV (0):
…
07-18 08:00:57.310 D/SMACK: SENT (0): BcdRaXODwwV2iX21saahdi5EXYx2zHnKL9ToLHwQPExS</signedPreKeyPu blic>9InTdCLINuWZFTQpidfrcoCthzXG0UEBWG6KC+0pLXUlclSKZo6C OLUCgZT26lfv7Xw5PUW+WkJwC7F2avykAA==BbZGG4d UIqGR4GkiE2QDSwoa2JnFyiTowje+tIlOkAZ5BbW/KsLDl9IoAu9mmojckoRpRXBIRc+APhilqE+Ua193
…
BeXzeIe5mr3a0Dbz+wsSYpnHPt0zB9CdlzM6g2TpVuUHBX2+cFhupE
07-18 08:01:01.630 D/SMACK: RECV (0):