IContentService.aidl revision 7a1355950172b7a549820e9a2cd4a9b2099ec32f
1/* 2 * Copyright (C) 2009 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package android.content; 18 19import android.accounts.Account; 20import android.content.ActiveSyncInfo; 21import android.content.ISyncStatusObserver; 22import android.content.SyncStatusInfo; 23import android.net.Uri; 24import android.os.Bundle; 25import android.database.IContentObserver; 26 27/** 28 * @hide 29 */ 30interface IContentService { 31 void registerContentObserver(in Uri uri, boolean notifyForDescendentsn, 32 IContentObserver observer); 33 void unregisterContentObserver(IContentObserver observer); 34 35 void notifyChange(in Uri uri, IContentObserver observer, 36 boolean observerWantsSelfNotifications, boolean syncToNetwork); 37 38 void startSync(in Uri url, in Bundle extras); 39 void cancelSync(in Uri uri); 40 41 /** 42 * Check if the provider should be synced when a network tickle is received 43 * @param providerName the provider whose setting we are querying 44 * @return true of the provider should be synced when a network tickle is received 45 */ 46 boolean getSyncProviderAutomatically(String providerName); 47 48 /** 49 * Set whether or not the provider is synced when it receives a network tickle. 50 * 51 * @param providerName the provider whose behavior is being controlled 52 * @param sync true if the provider should be synced when tickles are received for it 53 */ 54 void setSyncProviderAutomatically(String providerName, boolean sync); 55 56 void setListenForNetworkTickles(boolean flag); 57 58 boolean getListenForNetworkTickles(); 59 60 /** 61 * Returns true if there is currently a sync operation for the given 62 * account or authority in the pending list, or actively being processed. 63 */ 64 boolean isSyncActive(in Account account, String authority); 65 66 ActiveSyncInfo getActiveSync(); 67 68 /** 69 * Returns the status that matches the authority. If there are multiples accounts for 70 * the authority, the one with the latest "lastSuccessTime" status is returned. 71 * @param authority the authority whose row should be selected 72 * @return the SyncStatusInfo for the authority, or null if none exists 73 */ 74 SyncStatusInfo getStatusByAuthority(String authority); 75 76 /** 77 * Return true if the pending status is true of any matching authorities. 78 */ 79 boolean isAuthorityPending(in Account account, String authority); 80 81 void addStatusChangeListener(int mask, ISyncStatusObserver callback); 82 83 void removeStatusChangeListener(ISyncStatusObserver callback); 84} 85