send contacts to oc instance
[pub/Android/ownCloud.git] / src / eu / alefzero / owncloud / syncadapter / ContactSyncService.java
diff --git a/src/eu/alefzero/owncloud/syncadapter/ContactSyncService.java b/src/eu/alefzero/owncloud/syncadapter/ContactSyncService.java
new file mode 100644 (file)
index 0000000..372c17c
--- /dev/null
@@ -0,0 +1,25 @@
+package eu.alefzero.owncloud.syncadapter;
+
+import android.app.Service;
+import android.content.Intent;
+import android.os.IBinder;
+
+public class ContactSyncService extends Service {
+  private static final Object syncAdapterLock = new Object();
+  private static AbstractOwnCloudSyncAdapter mSyncAdapter = null;
+  
+  @Override
+  public void onCreate() {
+      synchronized (syncAdapterLock) {
+          if (mSyncAdapter == null) {
+              mSyncAdapter = new ContactSyncAdapter(getApplicationContext(), true);
+          }
+      }
+  }
+  
+  @Override
+  public IBinder onBind(Intent arg0) {
+    return mSyncAdapter.getSyncAdapterBinder();
+  }
+
+}