Exemplo n.º 1
0
 /** 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);
   }
 }
Exemplo n.º 2
0
 /**
  * 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);
   }
 }