IT. Expert System.

Android Reference

SyncStorageEngine


android.content

Class SyncStorageEngine



  • public class SyncStorageEngine
    extends Handler
    Singleton that tracks the sync data and overall sync history on the device.
    • Field Detail

      • EVENT_START

        public static final int EVENT_START
        Enum value for a sync start event.
        See Also:
        Constant Field Values
      • EVENT_STOP

        public static final int EVENT_STOP
        Enum value for a sync stop event.
        See Also:
        Constant Field Values
      • EVENTS

        public static final String[] EVENTS
        String names for the sync event types.
      • SOURCE_SERVER

        public static final int SOURCE_SERVER
        Enum value for a server-initiated sync.
        See Also:
        Constant Field Values
      • SOURCE_LOCAL

        public static final int SOURCE_LOCAL
        Enum value for a local-initiated sync.
        See Also:
        Constant Field Values
      • SOURCE_POLL

        public static final int SOURCE_POLL
        Enum value for a poll-based sync (e.g., upon connection to network)
        See Also:
        Constant Field Values
      • SOURCE_USER

        public static final int SOURCE_USER
        Enum value for a user-initiated sync.
        See Also:
        Constant Field Values
      • SOURCE_PERIODIC

        public static final int SOURCE_PERIODIC
        Enum value for a periodic sync.
        See Also:
        Constant Field Values
      • SYNC_CONNECTION_SETTING_CHANGED_INTENT

        public static final Intent SYNC_CONNECTION_SETTING_CHANGED_INTENT
      • SOURCES

        public static final String[] SOURCES
        String names for the sync source types.
      • PENDING_OPERATION_VERSION

        public static final int PENDING_OPERATION_VERSION
        See Also:
        Constant Field Values
      • STATISTICS_FILE_ITEM_OLD

        public static final int STATISTICS_FILE_ITEM_OLD
        See Also:
        Constant Field Values
    • Method Detail

      • init

        public static void init(Context context)
      • setOnSyncRequestListener

        protected void setOnSyncRequestListener(android.content.SyncStorageEngine.OnSyncRequestListener listener)
      • handleMessage

        public void handleMessage(Message msg)
        Description copied from class: Handler
        Subclasses must implement this to receive messages.
        Overrides:
        handleMessage in class Handler
      • getSyncRandomOffset

        public int getSyncRandomOffset()
      • addStatusChangeListener

        public void addStatusChangeListener(int mask,
                                   ISyncStatusObserver callback)
      • removeStatusChangeListener

        public void removeStatusChangeListener(ISyncStatusObserver callback)
      • getSyncAutomatically

        public boolean getSyncAutomatically(Account account,
                                   int userId,
                                   String providerName)
      • setSyncAutomatically

        public void setSyncAutomatically(Account account,
                                int userId,
                                String providerName,
                                boolean sync)
      • getIsSyncable

        public int getIsSyncable(Account account,
                        int userId,
                        String providerName)
      • setIsSyncable

        public void setIsSyncable(Account account,
                         int userId,
                         String providerName,
                         int syncable)
      • setBackoff

        public void setBackoff(Account account,
                      int userId,
                      String providerName,
                      long nextSyncTime,
                      long nextDelay)
      • clearAllBackoffs

        public void clearAllBackoffs(SyncQueue syncQueue)
      • setDelayUntilTime

        public void setDelayUntilTime(Account account,
                             int userId,
                             String providerName,
                             long delayUntil)
      • getDelayUntilTime

        public long getDelayUntilTime(Account account,
                             int userId,
                             String providerName)
      • addPeriodicSync

        public void addPeriodicSync(Account account,
                           int userId,
                           String providerName,
                           Bundle extras,
                           long pollFrequency)
      • removePeriodicSync

        public void removePeriodicSync(Account account,
                              int userId,
                              String providerName,
                              Bundle extras)
      • setMasterSyncAutomatically

        public void setMasterSyncAutomatically(boolean flag,
                                      int userId)
      • getMasterSyncAutomatically

        public boolean getMasterSyncAutomatically(int userId)
      • removeAuthority

        public void removeAuthority(Account account,
                           int userId,
                           String authority)
      • isSyncActive

        public boolean isSyncActive(Account account,
                           int userId,
                           String authority)
        Returns true if there is currently a sync operation for the given account or authority actively being processed.
      • getPendingOperations

        public ArrayList<SyncStorageEngine.PendingOperation> getPendingOperations()
        Return a copy of the current array of pending operations. The PendingOperation objects are the real objects stored inside, so that they can be used with deleteFromPending().
      • getPendingOperationCount

        public int getPendingOperationCount()
        Return the number of currently pending operations.
      • doDatabaseCleanup

        public void doDatabaseCleanup(Account[] accounts,
                             int userId)
        Called when the set of account has changed, given the new array of active accounts.
      • addActiveSync

        public SyncInfo addActiveSync(android.content.SyncManager.ActiveSyncContext activeSyncContext)
        Called when a sync is starting. Supply a valid ActiveSyncContext with information about the sync.
      • removeActiveSync

        public void removeActiveSync(SyncInfo syncInfo,
                            int userId)
        Called to indicate that a previously active sync is no longer active.
      • reportActiveChange

        public void reportActiveChange()
        To allow others to send active change reports, to poke clients.
      • insertStartSyncEvent

        public long insertStartSyncEvent(Account accountName,
                                int userId,
                                String authorityName,
                                long now,
                                int source,
                                boolean initialization)
        Note that sync has started for the given account and authority.
      • stopSyncEvent

        public void stopSyncEvent(long historyId,
                         long elapsedTime,
                         String resultMessage,
                         long downstreamActivity,
                         long upstreamActivity)
      • getCurrentSyncs

        public List<SyncInfo> getCurrentSyncs(int userId)
        Return a list of the currently active syncs. Note that the returned items are the real, live active sync objects, so be careful what you do with it.
      • getSyncStatus

        public ArrayList<SyncStatusInfo> getSyncStatus()
        Return an array of the current sync status for all authorities. Note that the objects inside the array are the real, live status objects, so be careful what you do with them.
      • getAuthorities

        public ArrayList<SyncStorageEngine.AuthorityInfo> getAuthorities()
        Return an array of the current authorities. Note that the objects inside the array are the real, live objects, so be careful what you do with them.
      • getStatusByAccountAndAuthority

        public SyncStatusInfo getStatusByAccountAndAuthority(Account account,
                                                    int userId,
                                                    String authority)
        Returns the status that matches the authority and account.
        Parameters:
        account - the account we want to check
        authority - the authority whose row should be selected
        Returns:
        the SyncStatusInfo for the authority
      • isSyncPending

        public boolean isSyncPending(Account account,
                            int userId,
                            String authority)
        Return true if the pending status is true of any matching authorities.
      • getSyncHistory

        public ArrayList<SyncStorageEngine.SyncHistoryItem> getSyncHistory()
        Return an array of the current sync status for all authorities. Note that the objects inside the array are the real, live status objects, so be careful what you do with them.
      • getDayStatistics

        public SyncStorageEngine.DayStats[] getDayStatistics()
        Return an array of the current per-day statistics. Note that the objects inside the array are the real, live status objects, so be careful what you do with them.
      • writeAllState

        public void writeAllState()
      • clearAndReadState

        public void clearAndReadState()
        public for testing


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 665 / . Delta: 0.02800 с