Lines Matching defs:authority

151         final String authority;
159 String authority, Bundle extras, boolean expedited) {
163 this.authority = authority;
173 this.authority = other.authority;
193 final String authority;
211 authority = toCopy.authority;
225 AuthorityInfo(Account account, int userId, String authority, int ident) {
228 this.authority = authority;
269 * @param authority
272 public void onSyncRequest(Account account, int userId, String authority, Bundle extras);
467 AuthorityInfo authority = getAuthorityLocked(account, userId, providerName,
469 return authority != null && authority.enabled;
475 AuthorityInfo authority = mAuthorities.valueAt(i);
476 if (authority.authority.equals(providerName)
477 && authority.userId == userId
478 && authority.enabled) {
493 AuthorityInfo authority = getOrCreateAuthorityLocked(account, userId, providerName, -1,
495 if (authority.enabled == sync) {
501 authority.enabled = sync;
514 AuthorityInfo authority = getAuthorityLocked(account, userId, providerName,
516 if (authority == null) {
519 return authority.syncable;
525 AuthorityInfo authority = mAuthorities.valueAt(i);
526 if (authority.authority.equals(providerName)) {
527 return authority.syncable;
545 AuthorityInfo authority = getOrCreateAuthorityLocked(account, userId, providerName, -1,
547 if (authority.syncable == syncable) {
553 authority.syncable = syncable;
565 AuthorityInfo authority = getAuthorityLocked(account, userId, providerName,
567 if (authority == null || authority.backoffTime < 0) {
570 return Pair.create(authority.backoffTime, authority.backoffDelay);
590 if (providerName != null && !providerName.equals(authorityInfo.authority)) {
602 AuthorityInfo authority =
605 if (authority.backoffTime == nextSyncTime && authority.backoffDelay == nextDelay) {
608 authority.backoffTime = nextSyncTime;
609 authority.backoffDelay = nextDelay;
629 + " authority:" + authorityInfo.authority
638 accountInfo.accountAndUser.userId, authorityInfo.authority, 0);
658 AuthorityInfo authority = getOrCreateAuthorityLocked(
660 if (authority.delayUntil == delayUntil) {
663 authority.delayUntil = delayUntil;
671 AuthorityInfo authority = getAuthorityLocked(account, userId, providerName,
673 if (authority == null) {
676 return authority.delayUntil;
696 AuthorityInfo authority =
702 for (int i = 0, N = authority.periodicSyncs.size(); i < N; i++) {
703 Pair<Bundle, Long> syncInfo = authority.periodicSyncs.get(i);
709 authority.periodicSyncs.set(i, Pair.create(extras, period));
717 authority.periodicSyncs.add(Pair.create(extras, period));
718 SyncStatusInfo status = getOrCreateSyncStatusLocked(authority.ident);
719 status.setPeriodicSyncTime(authority.periodicSyncs.size() - 1, 0);
722 // remove any periodic syncs that match the authority and extras
723 SyncStatusInfo status = mSyncStatus.get(authority.ident);
725 Iterator<Pair<Bundle, Long>> iterator = authority.periodicSyncs.iterator();
769 AuthorityInfo authority = getAuthorityLocked(account, userId, providerName,
771 if (authority != null) {
772 for (Pair<Bundle, Long> item : authority.periodicSyncs) {
804 public AuthorityInfo getOrCreateAuthority(Account account, int userId, String authority) {
806 return getOrCreateAuthorityLocked(account, userId, authority,
807 -1 /* assign a new identifier if creating a new authority */,
812 public void removeAuthority(Account account, int userId, String authority) {
814 removeAuthorityLocked(account, userId, authority, true /* doWrite */);
826 * account or authority actively being processed.
828 public boolean isSyncActive(Account account, int userId, String authority) {
833 && ainfo.authority.equals(authority)
848 + " auth=" + op.authority
853 AuthorityInfo authority = getOrCreateAuthorityLocked(op.account, op.userId,
854 op.authority,
857 if (authority == null) {
862 op.authorityId = authority.ident;
866 SyncStatusInfo status = getOrCreateSyncStatusLocked(authority.ident);
880 + " auth=" + op.authority
893 AuthorityInfo authority = getAuthorityLocked(op.account, op.userId, op.authority,
895 if (authority != null) {
896 if (DEBUG) Log.v(TAG, "removing - " + authority);
902 && cur.authority.equals(op.authority)
911 SyncStatusInfo status = getOrCreateSyncStatusLocked(authority.ident);
1008 + " auth=" + activeSyncContext.mSyncOperation.authority
1012 AuthorityInfo authority = getOrCreateAuthorityLocked(
1015 activeSyncContext.mSyncOperation.authority,
1016 -1 /* assign a new identifier if creating a new authority */,
1018 syncInfo = new SyncInfo(authority.ident,
1019 authority.account, authority.authority,
1021 getCurrentSyncs(authority.userId).add(syncInfo);
1036 + " auth=" + syncInfo.authority);
1052 * Note that sync has started for the given account and authority.
1062 AuthorityInfo authority = getAuthorityLocked(accountName, userId, authorityName,
1064 if (authority == null) {
1069 item.authorityId = authority.ident;
1262 * Returns the status that matches the authority and account.
1265 * @param authority the authority whose row should be selected
1266 * @return the SyncStatusInfo for the authority
1269 String authority) {
1270 if (account == null || authority == null) {
1279 if (ainfo != null && ainfo.authority.equals(authority)
1292 public boolean isSyncPending(Account account, int userId, String authority) {
1307 if (ainfo.authority.equals(authority) && cur.pending) {
1357 * Retrieve an authority, returning null if one does not exist.
1359 * @param accountName The name of the account for the authority.
1360 * @param authorityName The name of the authority itself.
1362 * requested authority does not exist.
1376 AuthorityInfo authority = accountInfo.authorities.get(authorityName);
1377 if (authority == null) {
1380 Log.v(TAG, tag + ": unknown authority " + authorityName);
1386 return authority;
1397 AuthorityInfo authority = account.authorities.get(authorityName);
1398 if (authority == null) {
1409 authority = new AuthorityInfo(accountName, userId, authorityName, ident);
1410 account.authorities.put(authorityName, authority);
1411 mAuthorities.put(ident, authority);
1417 return authority;
1434 public SyncStatusInfo getOrCreateSyncStatus(AuthorityInfo authority) {
1436 return getOrCreateSyncStatusLocked(authority.ident);
1531 AuthorityInfo authority = null;
1537 if ("authority".equals(tagName)) {
1538 authority = parseAuthority(parser, version);
1540 if (authority.ident > highestAuthorityId) {
1541 highestAuthorityId = authority.ident;
1547 if ("periodicSync".equals(tagName) && authority != null) {
1548 periodicSync = parsePeriodicSync(parser, authority);
1580 * some authority names have changed. copy over their settings and delete the old ones
1589 AuthorityInfo authority = mAuthorities.valueAt(i);
1590 // skip this authority if it isn't one of the renamed ones
1591 final String newAuthorityName = sAuthorityRenames.get(authority.authority);
1596 // remember this authority so we can remove it later. we can't remove it
1598 authoritiesToRemove.add(authority);
1600 // this authority isn't enabled, no need to copy it to the new authority name since
1602 if (!authority.enabled) {
1606 // if we already have a record of this new authority then don't copy over the settings
1607 if (getAuthorityLocked(authority.account, authority.userId, newAuthorityName, "cleanup")
1612 AuthorityInfo newAuthority = getOrCreateAuthorityLocked(authority.account,
1613 authority.userId, newAuthorityName, -1 /* ident */, false /* doWrite */);
1620 authorityInfo.authority, false /* doWrite */);
1643 AuthorityInfo authority = null;
1649 Log.e(TAG, "error parsing the id of the authority", e);
1651 Log.e(TAG, "the id of the authority is null", e);
1654 String authorityName = parser.getAttributeValue(null, "authority");
1665 authority = mAuthorities.get(id);
1666 if (DEBUG_FILE) Log.v(TAG, "Adding authority: account="
1671 if (authority == null) {
1673 authority = getOrCreateAuthorityLocked(
1681 authority.periodicSyncs.clear();
1684 if (authority != null) {
1685 authority.enabled = enabled == null || Boolean.parseBoolean(enabled);
1687 authority.syncable = -1;
1689 authority.syncable =
1693 Log.w(TAG, "Failure adding authority: account="
1700 return authority;
1703 private Pair<Bundle, Long> parsePeriodicSync(XmlPullParser parser, AuthorityInfo authority) {
1717 authority.periodicSyncs.add(periodicSync);
1784 AuthorityInfo authority = mAuthorities.valueAt(i);
1785 out.startTag(null, "authority");
1786 out.attribute(null, "id", Integer.toString(authority.ident));
1787 out.attribute(null, "account", authority.account.name);
1788 out.attribute(null, XML_ATTR_USER, Integer.toString(authority.userId));
1789 out.attribute(null, "type", authority.account.type);
1790 out.attribute(null, "authority", authority.authority);
1791 out.attribute(null, XML_ATTR_ENABLED, Boolean.toString(authority.enabled));
1792 if (authority.syncable < 0) {
1795 out.attribute(null, "syncable", Boolean.toString(authority.syncable != 0));
1797 for (Pair<Bundle, Long> periodicSync : authority.periodicSyncs) {
1832 out.endTag(null, "authority");
1888 map.put("authority", "stats.authority as authority");
1911 String authorityName = c.getString(c.getColumnIndex("authority"));
1912 AuthorityInfo authority = this.getOrCreateAuthorityLocked(
1915 if (authority != null) {
1922 if (st.authorityId == authority.ident) {
1928 st = new SyncStatusInfo(authority.ident);
1929 mSyncStatus.put(authority.ident, st);
1965 AuthorityInfo authority = mAuthorities.valueAt(i);
1966 if (authority.authority.equals(provider)) {
1967 authority.enabled = value == null || Boolean.parseBoolean(value);
1968 authority.syncable = 1;
2078 AuthorityInfo authority = mAuthorities.get(authorityId);
2079 if (authority != null) {
2089 authority.account, authority.userId, syncSource,
2090 authority.authority, extras, expedited);
2094 + " auth=" + op.authority
2209 private void requestSync(Account account, int userId, String authority, Bundle extras) {
2216 mSyncRequestListener.onSyncRequest(account, userId, authority, extras);
2218 ContentResolver.requestSync(account, authority, extras);