Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3bbb271 authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

OperationManagerService provide binder on 'OnBind()' method

- Add a private final Binder implementation as class's property
- Return the binder instance on 'onBind(Intent intent)' method
parent a9a04647
Loading
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.Binder;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
@@ -49,6 +50,13 @@ import foundation.e.drive.utils.ServiceExceptionHandler;
 */
public class OperationManagerService extends Service implements OnRemoteOperationListener{
    private final static String TAG = OperationManagerService.class.getSimpleName();
    private final Binder binder = new Binder(){
        OperationManagerService getService(){
            return OperationManagerService.this;
        }
    };



    private int workerAmount = 0; //Number of thread available to execute RemoteOperation
    private boolean[] mThreadWorkingState; //State of the threads; true mean the thread is working
@@ -313,7 +321,7 @@ public class OperationManagerService extends Service implements OnRemoteOperatio
    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        throw new UnsupportedOperationException();
         return binder;
    }

    @Override