Lines Matching refs:authority

137         final String authority;
145 String authority, Bundle extras, boolean expedited) {
148 this.authority = authority;
157 this.authority = other.authority;
176 final String authority;
185 AuthorityInfo(Account account, String authority, int ident) {
187 this.authority = authority;
393 AuthorityInfo authority = getAuthorityLocked(account, providerName,
395 return authority != null && authority.enabled;
401 AuthorityInfo authority = mAuthorities.valueAt(i);
402 if (authority.authority.equals(providerName)
403 && authority.enabled) {
415 AuthorityInfo authority = getOrCreateAuthorityLocked(account, providerName, -1, false);
416 if (authority.enabled == sync) {
420 authority.enabled = sync;
433 AuthorityInfo authority = getAuthorityLocked(account, providerName,
435 if (authority == null) {
438 return authority.syncable;
444 AuthorityInfo authority = mAuthorities.valueAt(i);
445 if (authority.authority.equals(providerName)) {
446 return authority.syncable;
461 AuthorityInfo authority = getOrCreateAuthorityLocked(account, providerName, -1, false);
462 if (authority.syncable == syncable) {
466 authority.syncable = syncable;
478 AuthorityInfo authority = getAuthorityLocked(account, providerName, "getBackoff");
479 if (authority == null || authority.backoffTime < 0) {
482 return Pair.create(authority.backoffTime, authority.backoffDelay);
498 if (providerName != null && !providerName.equals(authorityInfo.authority)) {
510 AuthorityInfo authority =
512 if (authority.backoffTime == nextSyncTime && authority.backoffDelay == nextDelay) {
515 authority.backoffTime = nextSyncTime;
516 authority.backoffDelay = nextDelay;
532 AuthorityInfo authority = getOrCreateAuthorityLocked(
534 if (authority.delayUntil == delayUntil) {
537 authority.delayUntil = delayUntil;
545 AuthorityInfo authority = getAuthorityLocked(account, providerName, "getDelayUntil");
546 if (authority == null) {
549 return authority.delayUntil;
567 AuthorityInfo authority =
573 for (int i = 0, N = authority.periodicSyncs.size(); i < N; i++) {
574 Pair<Bundle, Long> syncInfo = authority.periodicSyncs.get(i);
580 authority.periodicSyncs.set(i, Pair.create(extras, period));
588 authority.periodicSyncs.add(Pair.create(extras, period));
589 SyncStatusInfo status = getOrCreateSyncStatusLocked(authority.ident);
590 status.setPeriodicSyncTime(authority.periodicSyncs.size() - 1, 0);
593 // remove any periodic syncs that match the authority and extras
594 SyncStatusInfo status = mSyncStatus.get(authority.ident);
596 Iterator<Pair<Bundle, Long>> iterator = authority.periodicSyncs.iterator();
638 AuthorityInfo authority = getAuthorityLocked(account, providerName, "getPeriodicSyncs");
639 if (authority != null) {
640 for (Pair<Bundle, Long> item : authority.periodicSyncs) {
669 public AuthorityInfo getOrCreateAuthority(Account account, String authority) {
671 return getOrCreateAuthorityLocked(account, authority,
672 -1 /* assign a new identifier if creating a new authority */,
677 public void removeAuthority(Account account, String authority) {
679 removeAuthorityLocked(account, authority, true /* doWrite */);
691 * account or authority in the pending list, or actively being processed.
693 public boolean isSyncActive(Account account, String authority) {
701 if (op.account.equals(account) && op.authority.equals(authority)) {
709 && ainfo.authority.equals(authority)) {
722 + " auth=" + op.authority
727 AuthorityInfo authority = getOrCreateAuthorityLocked(op.account,
728 op.authority,
731 if (authority == null) {
736 op.authorityId = authority.ident;
740 SyncStatusInfo status = getOrCreateSyncStatusLocked(authority.ident);
753 + " auth=" + op.authority
766 AuthorityInfo authority = getAuthorityLocked(op.account, op.authority,
768 if (authority != null) {
769 if (Log.isLoggable(TAG, Log.VERBOSE)) Log.v(TAG, "removing - " + authority);
775 && cur.authority.equals(op.authority)) {
783 SyncStatusInfo status = getOrCreateSyncStatusLocked(authority.ident);
898 + " auth=" + activeSyncContext.mSyncOperation.authority
905 AuthorityInfo authority = getAuthorityLocked(
907 activeSyncContext.mSyncOperation.authority,
909 if (authority == null) {
912 mCurrentSync = new SyncInfo(authority.ident,
913 authority.account, authority.authority,
932 * Note that sync has started for the given account and authority.
942 AuthorityInfo authority = getAuthorityLocked(accountName, authorityName,
944 if (authority == null) {
948 item.authorityId = authority.ident;
1136 * Returns the status that matches the authority and account.
1139 * @param authority the authority whose row should be selected
1140 * @return the SyncStatusInfo for the authority
1142 public SyncStatusInfo getStatusByAccountAndAuthority(Account account, String authority) {
1143 if (account == null || authority == null) {
1152 if (ainfo != null && ainfo.authority.equals(authority) &&
1164 public boolean isSyncPending(Account account, String authority) {
1176 if (ainfo.authority.equals(authority) && cur.pending) {
1229 AuthorityInfo authority = mAuthorities.get(stats.authorityId);
1230 if (authority != null && authority.enabled) {
1254 * Retrieve an authority, returning null if one does not exist.
1256 * @param accountName The name of the account for the authority.
1257 * @param authorityName The name of the authority itself.
1259 * requested authority does not exist.
1272 AuthorityInfo authority = account.authorities.get(authorityName);
1273 if (authority == null) {
1276 Log.v(TAG, tag + ": unknown authority " + authorityName);
1282 return authority;
1292 AuthorityInfo authority = account.authorities.get(authorityName);
1293 if (authority == null) {
1303 authority = new AuthorityInfo(accountName, authorityName, ident);
1304 account.authorities.put(authorityName, authority);
1305 mAuthorities.put(ident, authority);
1311 return authority;
1327 public SyncStatusInfo getOrCreateSyncStatus(AuthorityInfo authority) {
1329 return getOrCreateSyncStatusLocked(authority.ident);
1415 AuthorityInfo authority = null;
1421 if ("authority".equals(tagName)) {
1422 authority = parseAuthority(parser, version);
1424 if (authority.ident > highestAuthorityId) {
1425 highestAuthorityId = authority.ident;
1429 if ("periodicSync".equals(tagName) && authority != null) {
1430 periodicSync = parsePeriodicSync(parser, authority);
1462 * some authority names have changed. copy over their settings and delete the old ones
1471 AuthorityInfo authority = mAuthorities.valueAt(i);
1472 // skip this authority if it isn't one of the renamed ones
1473 final String newAuthorityName = sAuthorityRenames.get(authority.authority);
1478 // remember this authority so we can remove it later. we can't remove it
1480 authoritiesToRemove.add(authority);
1482 // this authority isn't enabled, no need to copy it to the new authority name since
1484 if (!authority.enabled) {
1488 // if we already have a record of this new authority then don't copy over the settings
1489 if (getAuthorityLocked(authority.account, newAuthorityName, "cleanup") != null) {
1493 AuthorityInfo newAuthority = getOrCreateAuthorityLocked(authority.account,
1500 removeAuthorityLocked(authorityInfo.account, authorityInfo.authority,
1509 AuthorityInfo authority = null;
1515 Log.e(TAG, "error parsing the id of the authority", e);
1517 Log.e(TAG, "the id of the authority is null", e);
1520 String authorityName = parser.getAttributeValue(null, "authority");
1529 authority = mAuthorities.get(id);
1530 if (DEBUG_FILE) Log.v(TAG, "Adding authority: account="
1534 if (authority == null) {
1536 authority = getOrCreateAuthorityLocked(
1544 authority.periodicSyncs.clear();
1547 if (authority != null) {
1548 authority.enabled = enabled == null || Boolean.parseBoolean(enabled);
1550 authority.syncable = -1;
1552 authority.syncable =
1556 Log.w(TAG, "Failure adding authority: account="
1563 return authority;
1566 private Pair<Bundle, Long> parsePeriodicSync(XmlPullParser parser, AuthorityInfo authority) {
1580 authority.periodicSyncs.add(periodicSync);
1638 AuthorityInfo authority = mAuthorities.valueAt(i);
1639 out.startTag(null, "authority");
1640 out.attribute(null, "id", Integer.toString(authority.ident));
1641 out.attribute(null, "account", authority.account.name);
1642 out.attribute(null, "type", authority.account.type);
1643 out.attribute(null, "authority", authority.authority);
1644 out.attribute(null, "enabled", Boolean.toString(authority.enabled));
1645 if (authority.syncable < 0) {
1648 out.attribute(null, "syncable", Boolean.toString(authority.syncable != 0));
1650 for (Pair<Bundle, Long> periodicSync : authority.periodicSyncs) {
1685 out.endTag(null, "authority");
1741 map.put("authority", "stats.authority as authority");
1764 String authorityName = c.getString(c.getColumnIndex("authority"));
1765 AuthorityInfo authority = this.getOrCreateAuthorityLocked(
1768 if (authority != null) {
1775 if (st.authorityId == authority.ident) {
1781 st = new SyncStatusInfo(authority.ident);
1782 mSyncStatus.put(authority.ident, st);
1818 AuthorityInfo authority = mAuthorities.valueAt(i);
1819 if (authority.authority.equals(provider)) {
1820 authority.enabled = value == null || Boolean.parseBoolean(value);
1821 authority.syncable = 1;
1931 AuthorityInfo authority = mAuthorities.get(authorityId);
1932 if (authority != null) {
1938 authority.account, syncSource,
1939 authority.authority, extras, expedited);
1943 + " auth=" + op.authority