/** Disconnect and connect using new network. */ public void forceReconnect() { AccountManager accountManager = AccountManager.getInstance(); for (String account : accountManager.getAccounts()) { accountManager.getAccount(account).forceReconnect(); AccountManager.getInstance().onAccountChanged(account); } }
/** * Update connection state. * * <p>Start connections in waiting states and stop invalidated connections. * * @param userRequest */ public void updateConnections(boolean userRequest) { AccountManager accountManager = AccountManager.getInstance(); for (String account : accountManager.getAccounts()) { if (accountManager.getAccount(account).updateConnection(userRequest)) AccountManager.getInstance().onAccountChanged(account); } }