blob: dd9d14edc4182a3ba71c4917e698728f46855da5 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2008 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
Fred Quintanad9d2f112009-04-23 13:36:27 -070019import android.accounts.Account;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080020import android.os.Bundle;
21import android.content.ISyncContext;
22
23/**
24 * Interface used to control the sync activity on a SyncAdapter
25 * @hide
26 */
27oneway interface ISyncAdapter {
28 /**
29 * Initiate a sync for this account. SyncAdapter-specific parameters may
30 * be specified in extras, which is guaranteed to not be null.
31 *
32 * @param syncContext the ISyncContext used to indicate the progress of the sync. When
33 * the sync is finished (successfully or not) ISyncContext.onFinished() must be called.
Fred Quintana21bb0de2009-06-16 10:24:58 -070034 * @param authority the authority that should be synced
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080035 * @param account the account that should be synced
36 * @param extras SyncAdapter-specific parameters
37 */
Fred Quintana21bb0de2009-06-16 10:24:58 -070038 void startSync(ISyncContext syncContext, String authority,
39 in Account account, in Bundle extras);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080040
41 /**
42 * Cancel the most recently initiated sync. Due to race conditions, this may arrive
43 * after the ISyncContext.onFinished() for that sync was called.
Fred Quintana21bb0de2009-06-16 10:24:58 -070044 * @param syncContext the ISyncContext that was passed to {@link #startSync}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080045 */
Fred Quintana21bb0de2009-06-16 10:24:58 -070046 void cancelSync(ISyncContext syncContext);
Fred Quintanae7424ff2009-10-14 15:59:21 -070047
48 /**
49 * Initialize the SyncAdapter for this account and authority.
50 *
51 * @param account the account that should be synced
52 * @param authority the authority that should be synced
53 */
54 void initialize(in Account account, String authority);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080055}