ISyncAdapter.aidl revision d9d2f1140b52fd0c014e9deac59f6000564b7e84
1/*
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
19import android.accounts.Account;
20import 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.
34     * @param account the account that should be synced
35     * @param extras SyncAdapter-specific parameters
36     */
37    void startSync(ISyncContext syncContext, in Account account, in Bundle extras);
38
39    /**
40     * Cancel the most recently initiated sync. Due to race conditions, this may arrive
41     * after the ISyncContext.onFinished() for that sync was called.
42     */
43    void cancelSync();
44}
45