public final class ContentService
extends IContentService.Stub
Modifier and Type | Class and Description |
---|---|
static class |
ContentService.Lifecycle |
static class |
ContentService.ObserverCall
Hide this class since it is not part of api,
but current unittest framework requires it to be public
|
static class |
ContentService.ObserverNode
Hide this class since it is not part of api,
but current unittest framework requires it to be public
|
Modifier and Type | Method and Description |
---|---|
void |
addPeriodicSync(Account account,
String authority,
Bundle extras,
long pollFrequency)
Old API.
|
void |
addStatusChangeListener(int mask,
ISyncStatusObserver callback) |
void |
cancelRequest(SyncRequest request) |
void |
cancelSync(Account account,
String authority,
ComponentName cname)
Clear all scheduled sync operations that match the uri and cancel the active sync
if they match the authority and account, if they are present.
|
void |
cancelSyncAsUser(Account account,
String authority,
ComponentName cname,
int userId)
Clear all scheduled sync operations that match the uri and cancel the active sync
if they match the authority and account, if they are present.
|
protected void |
dump(FileDescriptor fd,
PrintWriter pw_,
String[] args) |
Bundle |
getCache(String packageName,
Uri key,
int userId) |
List<SyncInfo> |
getCurrentSyncs() |
List<SyncInfo> |
getCurrentSyncsAsUser(int userId)
If the user id supplied is different to the calling user, the caller must hold the
INTERACT_ACROSS_USERS_FULL permission.
|
int |
getIsSyncable(Account account,
String providerName) |
int |
getIsSyncableAsUser(Account account,
String providerName,
int userId)
If the user id supplied is different to the calling user, the caller must hold the
INTERACT_ACROSS_USERS_FULL permission.
|
boolean |
getMasterSyncAutomatically() |
boolean |
getMasterSyncAutomaticallyAsUser(int userId)
If the user id supplied is different to the calling user, the caller must hold the
INTERACT_ACROSS_USERS_FULL permission.
|
List<PeriodicSync> |
getPeriodicSyncs(Account account,
String providerName,
ComponentName cname) |
String[] |
getSyncAdapterPackagesForAuthorityAsUser(String authority,
int userId) |
SyncAdapterType[] |
getSyncAdapterTypes()
Get information about the SyncAdapters that are known to the system.
|
SyncAdapterType[] |
getSyncAdapterTypesAsUser(int userId)
Get information about the SyncAdapters that are known to the system for a particular user.
|
boolean |
getSyncAutomatically(Account account,
String providerName) |
boolean |
getSyncAutomaticallyAsUser(Account account,
String providerName,
int userId)
If the user id supplied is different to the calling user, the caller must hold the
INTERACT_ACROSS_USERS_FULL permission.
|
SyncStatusInfo |
getSyncStatus(Account account,
String authority,
ComponentName cname) |
SyncStatusInfo |
getSyncStatusAsUser(Account account,
String authority,
ComponentName cname,
int userId)
If the user id supplied is different to the calling user, the caller must hold the
INTERACT_ACROSS_USERS_FULL permission.
|
boolean |
isSyncActive(Account account,
String authority,
ComponentName cname) |
boolean |
isSyncPending(Account account,
String authority,
ComponentName cname) |
boolean |
isSyncPendingAsUser(Account account,
String authority,
ComponentName cname,
int userId) |
void |
notifyChange(Uri uri,
IContentObserver observer,
boolean observerWantsSelfNotifications,
boolean syncToNetwork) |
void |
notifyChange(Uri uri,
IContentObserver observer,
boolean observerWantsSelfNotifications,
int flags,
int userHandle)
Notify observers of a particular user's view of the provider.
|
boolean |
onTransact(int code,
Parcel data,
Parcel reply,
int flags) |
void |
putCache(String packageName,
Uri key,
Bundle value,
int userId) |
void |
registerContentObserver(Uri uri,
boolean notifyForDescendants,
IContentObserver observer) |
void |
registerContentObserver(Uri uri,
boolean notifyForDescendants,
IContentObserver observer,
int userHandle)
Register a content observer tied to a specific user's view of the provider.
|
void |
removePeriodicSync(Account account,
String authority,
Bundle extras) |
void |
removeStatusChangeListener(ISyncStatusObserver callback) |
void |
requestSync(Account account,
String authority,
Bundle extras) |
void |
setIsSyncable(Account account,
String providerName,
int syncable) |
void |
setMasterSyncAutomatically(boolean flag) |
void |
setMasterSyncAutomaticallyAsUser(boolean flag,
int userId) |
void |
setSyncAutomatically(Account account,
String providerName,
boolean sync) |
void |
setSyncAutomaticallyAsUser(Account account,
String providerName,
boolean sync,
int userId) |
void |
sync(SyncRequest request)
Request a sync with a generic
SyncRequest object. |
void |
syncAsUser(SyncRequest request,
int userId)
If the user id supplied is different to the calling user, the caller must hold the
INTERACT_ACROSS_USERS_FULL permission.
|
void |
unregisterContentObserver(IContentObserver observer) |
protected void dump(FileDescriptor fd, PrintWriter pw_, String[] args)
public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException
RemoteException
public void registerContentObserver(Uri uri, boolean notifyForDescendants, IContentObserver observer, int userHandle)
userHandle
- the user whose view of the provider is to be observed. May be
the calling user without requiring any permission, otherwise the caller needs to
hold the INTERACT_ACROSS_USERS_FULL permission or hold a read uri grant to the uri.
Pseudousers USER_ALL and USER_CURRENT are properly handled; all other pseudousers
are forbidden.public void registerContentObserver(Uri uri, boolean notifyForDescendants, IContentObserver observer)
public void unregisterContentObserver(IContentObserver observer)
public void notifyChange(Uri uri, IContentObserver observer, boolean observerWantsSelfNotifications, int flags, int userHandle)
userHandle
- the user whose view of the provider is to be notified. May be
the calling user without requiring any permission, otherwise the caller needs to
hold the INTERACT_ACROSS_USERS_FULL permission or hold a write uri grant to the uri.
Pseudousers USER_ALL and USER_CURRENT are properly interpreted; no other pseudousers are
allowed.public void notifyChange(Uri uri, IContentObserver observer, boolean observerWantsSelfNotifications, boolean syncToNetwork)
public void sync(SyncRequest request)
SyncRequest
object. This will be
either:
periodic OR one-off sync.
and
anonymous OR provider sync.
Depending on the request, we enqueue to suit in the SyncManager.request
- The request object. Validation of this object is done by its builder.public void syncAsUser(SyncRequest request, int userId)
public void cancelSync(Account account, String authority, ComponentName cname)
account
- filter the pending and active syncs to cancel using this account, or null.authority
- filter the pending and active syncs to cancel using this authority, or
null.cname
- cancel syncs running on this service, or null for provider/account.public void cancelSyncAsUser(Account account, String authority, ComponentName cname, int userId)
If the user id supplied is different to the calling user, the caller must hold the INTERACT_ACROSS_USERS_FULL permission.
account
- filter the pending and active syncs to cancel using this account, or null.authority
- filter the pending and active syncs to cancel using this authority, or
null.userId
- the user id for which to cancel sync operations.cname
- cancel syncs running on this service, or null for provider/account.public void cancelRequest(SyncRequest request)
public SyncAdapterType[] getSyncAdapterTypes()
public SyncAdapterType[] getSyncAdapterTypesAsUser(int userId)
If the user id supplied is different to the calling user, the caller must hold the INTERACT_ACROSS_USERS_FULL permission.
public String[] getSyncAdapterPackagesForAuthorityAsUser(String authority, int userId)
public boolean getSyncAutomatically(Account account, String providerName)
public boolean getSyncAutomaticallyAsUser(Account account, String providerName, int userId)
public void setSyncAutomatically(Account account, String providerName, boolean sync)
public void setSyncAutomaticallyAsUser(Account account, String providerName, boolean sync, int userId)
public void addPeriodicSync(Account account, String authority, Bundle extras, long pollFrequency)
public List<PeriodicSync> getPeriodicSyncs(Account account, String providerName, ComponentName cname)
public int getIsSyncable(Account account, String providerName)
public int getIsSyncableAsUser(Account account, String providerName, int userId)
public void setIsSyncable(Account account, String providerName, int syncable)
public boolean getMasterSyncAutomatically()
public boolean getMasterSyncAutomaticallyAsUser(int userId)
public void setMasterSyncAutomatically(boolean flag)
public void setMasterSyncAutomaticallyAsUser(boolean flag, int userId)
public boolean isSyncActive(Account account, String authority, ComponentName cname)
public List<SyncInfo> getCurrentSyncsAsUser(int userId)
public SyncStatusInfo getSyncStatus(Account account, String authority, ComponentName cname)
public SyncStatusInfo getSyncStatusAsUser(Account account, String authority, ComponentName cname, int userId)
public boolean isSyncPending(Account account, String authority, ComponentName cname)
public boolean isSyncPendingAsUser(Account account, String authority, ComponentName cname, int userId)
public void addStatusChangeListener(int mask, ISyncStatusObserver callback)
public void removeStatusChangeListener(ISyncStatusObserver callback)