다음을 통해 공유


CloudMediaProviderContract.ExtraSyncGeneration Field

Definition

Generation number to fetch the latest media or album metadata changes from the media collection.

[Android.Runtime.Register("EXTRA_SYNC_GENERATION", ApiSince=33)]
public const string ExtraSyncGeneration;
[<Android.Runtime.Register("EXTRA_SYNC_GENERATION", ApiSince=33)>]
val mutable ExtraSyncGeneration : string

Field Value

Attributes

Remarks

Generation number to fetch the latest media or album metadata changes from the media collection.

The provider should associate a monotonically increasing sync generation to each media item change (insertion/deletion/update). This is useful to quickly identify exactly which media items have changed since a previous point in time.

Providers should also associate a separate monotonically increasing sync generation for album changes (insertion/deletion/update). This album sync generation, should record both changes to the album metadata itself and changes to the media items contained in the album. E.g. a direct change to an album's CloudMediaProviderContract.AlbumColumns#DISPLAY_NAME will increase the album sync generation, likewise adding a photo to that album should also increase the sync generation.

Note that multiple media (or album) items can share a sync generation as long as the entire change appears atomic from the perspective of the query APIs. E.g. each item in a batch photo sync from the cloud can have the same sync generation if they were all synced atomically into the collection from the perspective of an external observer.

This extra can be passed as a Bundle parameter to the media or album query methods and the provider should only return items with a sync generation that is strictly greater than the one provided in the filter.

If the provider supports this filter, it must support the respective CloudMediaProvider#onGetMediaCollectionInfo methods to return the count and max generation for media or albums.

If the provider handled the generation, they must add the #EXTRA_SYNC_GENERATION key to the array of ContentResolver#EXTRA_HONORED_ARGS as part of the returned Cursor#setExtrasBundle.

Java documentation for android.provider.CloudMediaProviderContract.EXTRA_SYNC_GENERATION.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to