IContentService.aidl revision 231cc608d06ffc31c24bf8aa8c8275bdd2636581
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.content.ActiveSyncInfo;
20import android.content.ISyncStatusObserver;
21import android.content.SyncStatusInfo;
22import android.net.Uri;
23import android.os.Bundle;
24import android.database.IContentObserver;
25
26/**
27 * @hide
28 */
29interface IContentService {
30    void registerContentObserver(in Uri uri, boolean notifyForDescendentsn,
31            IContentObserver observer);
32    void unregisterContentObserver(IContentObserver observer);
33
34    void notifyChange(in Uri uri, IContentObserver observer,
35            boolean observerWantsSelfNotifications, boolean syncToNetwork);
36
37    void startSync(in Uri url, in Bundle extras);
38    void cancelSync(in Uri uri);
39
40    /**
41     * Check if the provider should be synced when a network tickle is received
42     * @param providerName the provider whose setting we are querying
43     * @return true of the provider should be synced when a network tickle is received
44     */
45    boolean getSyncProviderAutomatically(String providerName);
46
47    /**
48     * Set whether or not the provider is synced when it receives a network tickle.
49     *
50     * @param providerName the provider whose behavior is being controlled
51     * @param sync true if the provider should be synced when tickles are received for it
52     */
53    void setSyncProviderAutomatically(String providerName, boolean sync);
54
55    void setListenForNetworkTickles(boolean flag);
56
57    boolean getListenForNetworkTickles();
58
59    /**
60     * Returns true if there is currently a sync operation for the given
61     * account or authority in the pending list, or actively being processed.
62     */
63    boolean isSyncActive(String account, String authority);
64
65    ActiveSyncInfo getActiveSync();
66
67    /**
68     * Returns the status that matches the authority. If there are multiples accounts for
69     * the authority, the one with the latest "lastSuccessTime" status is returned.
70     * @param authority the authority whose row should be selected
71     * @return the SyncStatusInfo for the authority, or null if none exists
72     */
73    SyncStatusInfo getStatusByAuthority(String authority);
74
75    /**
76     * Return true if the pending status is true of any matching authorities.
77     */
78    boolean isAuthorityPending(String account, String authority);
79
80    void addStatusChangeListener(int mask, ISyncStatusObserver callback);
81
82    void removeStatusChangeListener(ISyncStatusObserver callback);
83}
84