Lines Matching defs:authority

154         final String authority;
162 String authority, Bundle extras, boolean expedited) {
167 this.authority = authority;
178 this.authority = other.authority;
198 final String authority;
216 authority = toCopy.authority;
230 AuthorityInfo(Account account, int userId, String authority, int ident) {
233 this.authority = authority;
277 * @param authority
280 public void onSyncRequest(Account account, int userId, int reason, String authority,
476 AuthorityInfo authority = getAuthorityLocked(account, userId, providerName,
478 return authority != null && authority.enabled;
484 AuthorityInfo authority = mAuthorities.valueAt(i);
485 if (authority.authority.equals(providerName)
486 && authority.userId == userId
487 && authority.enabled) {
502 AuthorityInfo authority = getOrCreateAuthorityLocked(account, userId, providerName, -1,
504 if (authority.enabled == sync) {
510 authority.enabled = sync;
524 AuthorityInfo authority = getAuthorityLocked(account, userId, providerName,
526 if (authority == null) {
529 return authority.syncable;
535 AuthorityInfo authority = mAuthorities.valueAt(i);
536 if (authority.authority.equals(providerName)) {
537 return authority.syncable;
555 AuthorityInfo authority = getOrCreateAuthorityLocked(account, userId, providerName, -1,
557 if (authority.syncable == syncable) {
563 authority.syncable = syncable;
576 AuthorityInfo authority = getAuthorityLocked(account, userId, providerName,
578 if (authority == null || authority.backoffTime < 0) {
581 return Pair.create(authority.backoffTime, authority.backoffDelay);
601 if (providerName != null && !providerName.equals(authorityInfo.authority)) {
613 AuthorityInfo authority =
616 if (authority.backoffTime == nextSyncTime && authority.backoffDelay == nextDelay) {
619 authority.backoffTime = nextSyncTime;
620 authority.backoffDelay = nextDelay;
640 + " authority:" + authorityInfo.authority
649 accountInfo.accountAndUser.userId, authorityInfo.authority, 0);
669 AuthorityInfo authority = getOrCreateAuthorityLocked(
671 if (authority.delayUntil == delayUntil) {
674 authority.delayUntil = delayUntil;
682 AuthorityInfo authority = getAuthorityLocked(account, userId, providerName,
684 if (authority == null) {
687 return authority.delayUntil;
707 AuthorityInfo authority =
713 for (int i = 0, N = authority.periodicSyncs.size(); i < N; i++) {
714 Pair<Bundle, Long> syncInfo = authority.periodicSyncs.get(i);
720 authority.periodicSyncs.set(i, Pair.create(extras, period));
728 authority.periodicSyncs.add(Pair.create(extras, period));
729 SyncStatusInfo status = getOrCreateSyncStatusLocked(authority.ident);
730 status.setPeriodicSyncTime(authority.periodicSyncs.size() - 1, 0);
733 // remove any periodic syncs that match the authority and extras
734 SyncStatusInfo status = mSyncStatus.get(authority.ident);
736 Iterator<Pair<Bundle, Long>> iterator = authority.periodicSyncs.iterator();
780 AuthorityInfo authority = getAuthorityLocked(account, userId, providerName,
782 if (authority != null) {
783 for (Pair<Bundle, Long> item : authority.periodicSyncs) {
816 public AuthorityInfo getOrCreateAuthority(Account account, int userId, String authority) {
818 return getOrCreateAuthorityLocked(account, userId, authority,
819 -1 /* assign a new identifier if creating a new authority */,
824 public void removeAuthority(Account account, int userId, String authority) {
826 removeAuthorityLocked(account, userId, authority, true /* doWrite */);
838 * account or authority actively being processed.
840 public boolean isSyncActive(Account account, int userId, String authority) {
845 && ainfo.authority.equals(authority)
860 + " auth=" + op.authority
865 AuthorityInfo authority = getOrCreateAuthorityLocked(op.account, op.userId,
866 op.authority,
869 if (authority == null) {
874 op.authorityId = authority.ident;
878 SyncStatusInfo status = getOrCreateSyncStatusLocked(authority.ident);
892 + " auth=" + op.authority
905 AuthorityInfo authority = getAuthorityLocked(op.account, op.userId, op.authority,
907 if (authority != null) {
908 if (DEBUG) Log.v(TAG, "removing - " + authority);
914 && cur.authority.equals(op.authority)
923 SyncStatusInfo status = getOrCreateSyncStatusLocked(authority.ident);
1020 + " auth=" + activeSyncContext.mSyncOperation.authority
1024 AuthorityInfo authority = getOrCreateAuthorityLocked(
1027 activeSyncContext.mSyncOperation.authority,
1028 -1 /* assign a new identifier if creating a new authority */,
1030 syncInfo = new SyncInfo(authority.ident,
1031 authority.account, authority.authority,
1033 getCurrentSyncs(authority.userId).add(syncInfo);
1048 + " auth=" + syncInfo.authority);
1064 * Note that sync has started for the given account and authority.
1074 AuthorityInfo authority = getAuthorityLocked(accountName, userId, authorityName,
1076 if (authority == null) {
1081 item.authorityId = authority.ident;
1258 * Returns the status that matches the authority and account.
1261 * @param authority the authority whose row should be selected
1262 * @return the SyncStatusInfo for the authority
1265 String authority) {
1266 if (account == null || authority == null) {
1275 if (ainfo != null && ainfo.authority.equals(authority)
1288 public boolean isSyncPending(Account account, int userId, String authority) {
1303 if (ainfo.authority.equals(authority) && cur.pending) {
1353 * Retrieve an authority, returning null if one does not exist.
1355 * @param accountName The name of the account for the authority.
1356 * @param authorityName The name of the authority itself.
1358 * requested authority does not exist.
1372 AuthorityInfo authority = accountInfo.authorities.get(authorityName);
1373 if (authority == null) {
1376 Log.v(TAG, tag + ": unknown authority " + authorityName);
1382 return authority;
1393 AuthorityInfo authority = account.authorities.get(authorityName);
1394 if (authority == null) {
1405 authority = new AuthorityInfo(accountName, userId, authorityName, ident);
1406 account.authorities.put(authorityName, authority);
1407 mAuthorities.put(ident, authority);
1413 return authority;
1430 public SyncStatusInfo getOrCreateSyncStatus(AuthorityInfo authority) {
1432 return getOrCreateSyncStatusLocked(authority.ident);
1527 AuthorityInfo authority = null;
1533 if ("authority".equals(tagName)) {
1534 authority = parseAuthority(parser, version);
1536 if (authority.ident > highestAuthorityId) {
1537 highestAuthorityId = authority.ident;
1543 if ("periodicSync".equals(tagName) && authority != null) {
1544 periodicSync = parsePeriodicSync(parser, authority);
1576 * some authority names have changed. copy over their settings and delete the old ones
1585 AuthorityInfo authority = mAuthorities.valueAt(i);
1586 // skip this authority if it isn't one of the renamed ones
1587 final String newAuthorityName = sAuthorityRenames.get(authority.authority);
1592 // remember this authority so we can remove it later. we can't remove it
1594 authoritiesToRemove.add(authority);
1596 // this authority isn't enabled, no need to copy it to the new authority name since
1598 if (!authority.enabled) {
1602 // if we already have a record of this new authority then don't copy over the settings
1603 if (getAuthorityLocked(authority.account, authority.userId, newAuthorityName, "cleanup")
1608 AuthorityInfo newAuthority = getOrCreateAuthorityLocked(authority.account,
1609 authority.userId, newAuthorityName, -1 /* ident */, false /* doWrite */);
1616 authorityInfo.authority, false /* doWrite */);
1639 AuthorityInfo authority = null;
1645 Log.e(TAG, "error parsing the id of the authority", e);
1647 Log.e(TAG, "the id of the authority is null", e);
1650 String authorityName = parser.getAttributeValue(null, "authority");
1661 authority = mAuthorities.get(id);
1662 if (DEBUG_FILE) Log.v(TAG, "Adding authority: account="
1667 if (authority == null) {
1669 authority = getOrCreateAuthorityLocked(
1677 authority.periodicSyncs.clear();
1680 if (authority != null) {
1681 authority.enabled = enabled == null || Boolean.parseBoolean(enabled);
1683 authority.syncable = -1;
1685 authority.syncable =
1689 Log.w(TAG, "Failure adding authority: account="
1696 return authority;
1699 private Pair<Bundle, Long> parsePeriodicSync(XmlPullParser parser, AuthorityInfo authority) {
1713 authority.periodicSyncs.add(periodicSync);
1780 AuthorityInfo authority = mAuthorities.valueAt(i);
1781 out.startTag(null, "authority");
1782 out.attribute(null, "id", Integer.toString(authority.ident));
1783 out.attribute(null, "account", authority.account.name);
1784 out.attribute(null, XML_ATTR_USER, Integer.toString(authority.userId));
1785 out.attribute(null, "type", authority.account.type);
1786 out.attribute(null, "authority", authority.authority);
1787 out.attribute(null, XML_ATTR_ENABLED, Boolean.toString(authority.enabled));
1788 if (authority.syncable < 0) {
1791 out.attribute(null, "syncable", Boolean.toString(authority.syncable != 0));
1793 for (Pair<Bundle, Long> periodicSync : authority.periodicSyncs) {
1828 out.endTag(null, "authority");
1884 map.put("authority", "stats.authority as authority");
1907 String authorityName = c.getString(c.getColumnIndex("authority"));
1908 AuthorityInfo authority = this.getOrCreateAuthorityLocked(
1911 if (authority != null) {
1918 if (st.authorityId == authority.ident) {
1924 st = new SyncStatusInfo(authority.ident);
1925 mSyncStatus.put(authority.ident, st);
1961 AuthorityInfo authority = mAuthorities.valueAt(i);
1962 if (authority.authority.equals(provider)) {
1963 authority.enabled = value == null || Boolean.parseBoolean(value);
1964 authority.syncable = 1;
2075 AuthorityInfo authority = mAuthorities.get(authorityId);
2076 if (authority != null) {
2086 authority.account, authority.userId, reason, syncSource,
2087 authority.authority, extras, expedited);
2091 + " auth=" + op.authority
2208 private void requestSync(Account account, int userId, int reason, String authority,
2216 mSyncRequestListener.onSyncRequest(account, userId, reason, authority, extras);
2218 ContentResolver.requestSync(account, authority, extras);