private void processUpdate(long authId, byte[] content) { if (authId != currentAuthId) { return; } ProtoStruct protoStruct; try { protoStruct = ProtoSerializer.readUpdate(content); } catch (IOException e) { e.printStackTrace(); Log.w(TAG, "Broken mt update"); return; } int type = ((Push) protoStruct).updateType; byte[] body = ((Push) protoStruct).body; RpcScope updateBox; try { updateBox = new RpcParser().read(type, body); } catch (IOException e) { e.printStackTrace(); Log.w(TAG, "Broken update box"); return; } // Log.w(TAG, "Box: " + updateBox + ""); callback.onUpdateReceived(updateBox); }
private void onNewSessionCreated(long authId) { if (authId != currentAuthId) { return; } Log.w(TAG, "New Session Created"); callback.onNewSessionCreated(); }
private void onAuthIdInvalidated(long authId) { if (authId != currentAuthId) { return; } Log.w(TAG, "Auth id invalidated"); keyStorage.saveAuthKey(0); currentAuthId = 0; proto = null; callback.onAuthIdInvalidated(); self().send(new RequestAuthId()); }
void connectionCountChanged(int count) { callback.onConnectionsChanged(count); }