src/org/gege/caldavsyncadapter/syncadapter/SyncService.java

Tue, 10 Feb 2015 18:12:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 10 Feb 2015 18:12:00 +0100
changeset 0
fb9019fb1bf7
permissions
-rw-r--r--

Import initial revisions of existing project AndroidCaldavSyncAdapater,
forked from upstream repository at 27e8a0f8495c92e0780d450bdf0c7cec77a03a55.

     1 /**
     2  * Copyright (c) 2012-2013, David Wiesner
     3  * 
     4  * This file is part of Andoid Caldav Sync Adapter Free.
     5  *
     6  * Andoid Caldav Sync Adapter Free is free software: you can redistribute 
     7  * it and/or modify it under the terms of the GNU General Public License 
     8  * as published by the Free Software Foundation, either version 3 of the 
     9  * License, or at your option any later version.
    10  *
    11  * Andoid Caldav Sync Adapter Free is distributed in the hope that 
    12  * it will be useful, but WITHOUT ANY WARRANTY; without even the implied 
    13  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14  * GNU General Public License for more details.
    15  *
    16  * You should have received a copy of the GNU General Public License
    17  * along with Andoid Caldav Sync Adapter Free.  
    18  * If not, see <http://www.gnu.org/licenses/>.
    19  * 
    20  */
    22 package org.gege.caldavsyncadapter.syncadapter;
    24 import android.app.Service;
    25 import android.content.Intent;
    26 import android.os.IBinder;
    28 public class SyncService extends Service {
    29     private static final Object sSyncAdapterLock = new Object();
    31     private static SyncAdapter sSyncAdapter = null;
    33     @Override
    34     public void onCreate() {
    35         synchronized (sSyncAdapterLock) {
    36             if (sSyncAdapter == null) {
    37                 sSyncAdapter = new SyncAdapter(getApplicationContext(), true);
    38             }
    39         }
    40     }
    42     @Override
    43     public IBinder onBind(Intent intent) {
    44         return sSyncAdapter.getSyncAdapterBinder();
    45     }
    46 }

mercurial