2015-03-08 22:30:03 +00:00
|
|
|
|
/*
|
2015-05-27 08:48:27 +00:00
|
|
|
|
* Copyright © 2013 – 2015 Ricki Hirner (bitfire web engineering).
|
2014-12-20 19:21:46 +00:00
|
|
|
|
* All rights reserved. This program and the accompanying materials
|
|
|
|
|
* are made available under the terms of the GNU Public License v3.0
|
|
|
|
|
* which accompanies this distribution, and is available at
|
|
|
|
|
* http://www.gnu.org/licenses/gpl.html
|
2015-03-08 22:30:03 +00:00
|
|
|
|
*/
|
2014-12-20 19:21:46 +00:00
|
|
|
|
package at.bitfire.davdroid.syncadapter;
|
|
|
|
|
|
|
|
|
|
import android.accounts.Account;
|
|
|
|
|
import android.app.Service;
|
2015-10-14 11:38:18 +00:00
|
|
|
|
import android.content.AbstractThreadedSyncAdapter;
|
2014-12-20 19:21:46 +00:00
|
|
|
|
import android.content.ContentProviderClient;
|
|
|
|
|
import android.content.Context;
|
|
|
|
|
import android.content.Intent;
|
2015-10-14 11:38:18 +00:00
|
|
|
|
import android.content.SyncResult;
|
|
|
|
|
import android.os.Bundle;
|
2014-12-20 19:21:46 +00:00
|
|
|
|
import android.os.IBinder;
|
|
|
|
|
|
|
|
|
|
public class CalendarsSyncAdapterService extends Service {
|
|
|
|
|
private static SyncAdapter syncAdapter;
|
2015-05-15 21:35:27 +00:00
|
|
|
|
|
2014-12-20 19:21:46 +00:00
|
|
|
|
@Override
|
|
|
|
|
public void onCreate() {
|
|
|
|
|
if (syncAdapter == null)
|
|
|
|
|
syncAdapter = new SyncAdapter(getApplicationContext());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onDestroy() {
|
|
|
|
|
syncAdapter = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public IBinder onBind(Intent intent) {
|
|
|
|
|
return syncAdapter.getSyncAdapterBinder();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2015-10-14 11:38:18 +00:00
|
|
|
|
private static class SyncAdapter extends AbstractThreadedSyncAdapter {
|
2014-12-20 19:21:46 +00:00
|
|
|
|
|
2015-10-14 11:38:18 +00:00
|
|
|
|
public SyncAdapter(Context context) {
|
|
|
|
|
super(context, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider, SyncResult syncResult) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-12-20 19:21:46 +00:00
|
|
|
|
|
|
|
|
|
}
|