michael@0: /** michael@0: * Copyright (c) 2012-2013, David Wiesner michael@0: * michael@0: * This file is part of Andoid Caldav Sync Adapter Free. michael@0: * michael@0: * Andoid Caldav Sync Adapter Free is free software: you can redistribute michael@0: * it and/or modify it under the terms of the GNU General Public License michael@0: * as published by the Free Software Foundation, either version 3 of the michael@0: * License, or at your option any later version. michael@0: * michael@0: * Andoid Caldav Sync Adapter Free is distributed in the hope that michael@0: * it will be useful, but WITHOUT ANY WARRANTY; without even the implied michael@0: * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the michael@0: * GNU General Public License for more details. michael@0: * michael@0: * You should have received a copy of the GNU General Public License michael@0: * along with Andoid Caldav Sync Adapter Free. michael@0: * If not, see . michael@0: * michael@0: */ michael@0: michael@0: package org.gege.caldavsyncadapter.syncadapter; michael@0: michael@0: import android.app.Service; michael@0: import android.content.Intent; michael@0: import android.os.IBinder; michael@0: michael@0: public class SyncService extends Service { michael@0: private static final Object sSyncAdapterLock = new Object(); michael@0: michael@0: private static SyncAdapter sSyncAdapter = null; michael@0: michael@0: @Override michael@0: public void onCreate() { michael@0: synchronized (sSyncAdapterLock) { michael@0: if (sSyncAdapter == null) { michael@0: sSyncAdapter = new SyncAdapter(getApplicationContext(), true); michael@0: } michael@0: } michael@0: } michael@0: michael@0: @Override michael@0: public IBinder onBind(Intent intent) { michael@0: return sSyncAdapter.getSyncAdapterBinder(); michael@0: } michael@0: }