/**
  * Creates the account.
  *
  * @param context the context
  * @param bundleData the bundle data
  * @return true, if successful
  */
 public static boolean createAccount(Context context, OEUser bundleData) {
   AccountManager accMgr = null;
   accMgr = AccountManager.get(context);
   String accountType = PARAM_AUTHTOKEN_TYPE;
   String password = String.valueOf(bundleData.getPassword());
   String accountName = bundleData.getAndroidName();
   Account account = new Account(accountName, accountType);
   Bundle bundle = bundleData.getAsBundle();
   return accMgr.addAccountExplicitly(account, password, bundle);
 }
  public static boolean updateAccountDetails(Context context, OEUser userObject) {

    boolean flag = false;
    OEUser user = OpenERPAccountManager.getAccountDetail(context, userObject.getAndroidName());
    Bundle userBundle = userObject.getAsBundle();
    if (user != null) {
      AccountManager accMgr = AccountManager.get(context);
      for (String key : userBundle.keySet()) {
        accMgr.setUserData(
            OpenERPAccountManager.getAccount(context, user.getAndroidName()),
            key,
            userBundle.getString(key));
      }

      flag = true;
    }
    return flag;
  }