31 lines
757 B
Java
31 lines
757 B
Java
|
package ch.dissem.apps.abit.synchronization;
|
||
|
|
||
|
import android.app.Service;
|
||
|
import android.content.Intent;
|
||
|
import android.os.IBinder;
|
||
|
|
||
|
/**
|
||
|
* A bound Service that instantiates the authenticator
|
||
|
* when started.
|
||
|
*/
|
||
|
public class AuthenticatorService extends Service {
|
||
|
/**
|
||
|
* Instance field that stores the authenticator object
|
||
|
*/
|
||
|
private Authenticator authenticator;
|
||
|
|
||
|
@Override
|
||
|
public void onCreate() {
|
||
|
// Create a new authenticator object
|
||
|
authenticator = new Authenticator(this);
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
* When the system binds to this Service to make the RPC call
|
||
|
* return the authenticator's IBinder.
|
||
|
*/
|
||
|
@Override
|
||
|
public IBinder onBind(Intent intent) {
|
||
|
return authenticator.getIBinder();
|
||
|
}
|
||
|
}
|