- utilize the new abstact base class for FileSync
[pub/Android/ownCloud.git] / src / eu / alefzero / owncloud / syncadapter / FileSyncService.java
diff --git a/src/eu/alefzero/owncloud/syncadapter/FileSyncService.java b/src/eu/alefzero/owncloud/syncadapter/FileSyncService.java
new file mode 100644 (file)
index 0000000..fa8a354
--- /dev/null
@@ -0,0 +1,31 @@
+
+package eu.alefzero.owncloud.syncadapter;
+
+import android.app.Service;
+import android.content.Intent;
+import android.os.IBinder;
+
+public class FileSyncService extends Service {
+    private static final Object syncAdapterLock = new Object();
+    private static AbstractOwnCloudSyncAdapter concretSyncAdapter = null;
+
+    /*
+     * {@inheritDoc}
+     */
+    @Override
+    public void onCreate() {
+        synchronized (syncAdapterLock) {
+            if (concretSyncAdapter == null) {
+                concretSyncAdapter = new FileSyncAdapter(getApplicationContext(), true);
+            }
+        }
+    }
+
+    /*
+     * {@inheritDoc}
+     */
+    @Override
+    public IBinder onBind(Intent intent) {
+        return concretSyncAdapter.getSyncAdapterBinder();
+    }
+}