mirror of
https://github.com/nextcloud/talk-android
synced 2025-08-12 06:25:02 +01:00
37 lines
929 B
Java
37 lines
929 B
Java
/*
|
|
* Nextcloud Talk - Android Client
|
|
*
|
|
* SPDX-FileCopyrightText: 2020 Tobias Kaminsky <tobias@kaminsky.me>
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*/
|
|
package com.nextcloud.talk.utils;
|
|
|
|
|
|
import android.app.Service;
|
|
import android.content.Intent;
|
|
import android.os.IBinder;
|
|
import android.util.Log;
|
|
|
|
public class SyncService extends Service {
|
|
|
|
private static final Object sSyncAdapterLock = new Object();
|
|
|
|
private static SyncAdapter sSyncAdapter = null;
|
|
|
|
@Override
|
|
public void onCreate() {
|
|
Log.i("SyncService", "Sync service created");
|
|
synchronized (sSyncAdapterLock) {
|
|
if (sSyncAdapter == null) {
|
|
sSyncAdapter = new SyncAdapter(getApplicationContext(), true);
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public IBinder onBind(Intent intent) {
|
|
Log.i("SyncService", "Sync service binded");
|
|
return sSyncAdapter.getSyncAdapterBinder();
|
|
}
|
|
}
|