Projects >> SOCIETIES-Platform >>bff119b8ef79ba25924b1704d7656b252c7a6b68

Chunk
Conflicting content
import org.societies.android.api.comms.IMethodCallback;
import org.societies.android.api.css.directory.IAndroidCssDirectory;
import org.societies.android.api.css.manager.IServiceManager;
<<<<<<< HEAD
import org.societies.android.api.events.IAndroidSocietiesEvents;
import org.societies.android.api.internal.context.IInternalCtxClient;
=======
>>>>>>> b8ca5af46f857705b0fc9d84f23fd641e908a161
import org.societies.android.api.internal.cssmanager.IFriendsManager;
import org.societies.android.api.internal.privacytrust.IPrivacyPolicyManager;
import org.societies.android.api.internal.privacytrust.trust.IInternalTrustClient;
Solution content
import org.societies.android.api.comms.IMethodCallback;
import org.societies.android.api.css.directory.IAndroidCssDirectory;
import org.societies.android.api.css.manager.IServiceManager;
import org.societies.android.api.events.IAndroidSocietiesEvents;
import org.societies.android.api.internal.context.IInternalCtxClient;
import org.societies.android.api.internal.cssmanager.IFriendsManager;
import org.societies.android.api.internal.privacytrust.IPrivacyPolicyManager;
import org.societies.android.api.internal.privacytrust.trust.IInternalTrustClient;
File
SocietiesClientServicesController.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
     */
	 * 
     * Start all Societies Client app services
 * for services that are considered essential and are dependencies of some or all services started in this class.
 */
public class SocietiesClientServicesController {
<<<<<<< HEAD
	private final static String LOG_TAG = SocietiesClientServicesController.class.getName();
	//timeout for bind, start and stop all services
	private final static long TASK_TIMEOUT = 10000;
	
	private final static int NUM_SERVICES = 14;
	
	private final static int CIS_DIRECTORY_SERVICE 		= 0;
	private final static int CIS_MANAGER_SERVICE 		= 1;
	private final static int CIS_SUBSCRIBED_SERVICE 	= 2;
	private final static int CSS_DIRECTORY_SERVICE 		= 3;
	private final static int TRUST_SERVICE 				= 4;
	private final static int SLM_SERVICE_CONTROL_SERVICE= 5;
	private final static int PRIVACY_DATA_SERVICE 		= 6;
	private final static int PRIVACY_POLICY_SERVICE 	= 7;
	private final static int SNS_SOCIAL_DATA_SERVICE 	= 8;
	private final static int PERSONALISATION_SERVICE 	= 9;
	private final static int SLM_SERVICE_DISCO_SERVICE 	= 10;
	private final static int FRIENDS_MANAGER_SERVICE 	= 11;
	private final static int CONTEXT_SERVICE 			= 12;
	private final static int INTERNAL_TRUST_SERVICE 	= 13;
	
	private Context context;
	private CountDownLatch servicesBinded;
	private CountDownLatch servicesStarted;
	private CountDownLatch servicesStopped;

	private BroadcastReceiver startupReceiver;
	private BroadcastReceiver shutdownReceiver;
	
	private boolean connectedToServices[];
	private ServiceConnection platformServiceConnections [];
	private Messenger allMessengers [];
	
	private IAndroidCssDirectory cssDirectoryService;
	private IServiceDiscovery slmServiceDisco;
	private IServiceControl slmServiceControl;
	private ISocialData snsConnectorService;
	private IFriendsManager friendMgrService;
	private IPrivacyPolicyManager privacyPolicyService;
	private IInternalTrustClient internalTrustService;
	
	private long startTime;
	
	public SocietiesClientServicesController(Context context) {
		this.context = context;
		this.connectedToServices = new boolean[NUM_SERVICES];
		allMessengers = new Messenger[NUM_SERVICES];
		this.platformServiceConnections = new ServiceConnection[NUM_SERVICES];
		this.startupReceiver = null;
		this.shutdownReceiver = null;

	}
	
	/**
	 * Bind to the app services. Assumes that login has already taken place
	 * @param IMethodCallback callback
	 */
	public void bindToServices(IMethodCallback callback) {
		//set up broadcast receiver for start/bind actions
		setupStartupBroadcastReceiver();

		InvokeBindAllServices invoker = new InvokeBindAllServices(callback);
		invoker.execute();
	}
	/**
	 * Unbind from app services
	 * 
	 */
	public void unbindFromServices() {
	   	Log.d(LOG_TAG, "Unbind from Societies Platform Services");
		
	   	for (int i = 0; i < this.connectedToServices.length; i++) {
			if (this.connectedToServices[i]) {
		        this.context.unbindService(this.platformServiceConnections[i]);
			}
	   	}
	   	//tear down broadcast receiver after stop/unbind actions
	   	this.teardownBroadcastReceiver(this.shutdownReceiver);
	}
	/**
	 * Start all Societies Client app services
	 * @param callback
	 */
	public void startAllServices(IMethodCallback callback) {
		InvokeStartAllServices invoker = new InvokeStartAllServices(callback);
		invoker.execute();
	}
	/**
	 * Stop all Societies Client app services
	 * @param callback
	 */
	public void stopAllServices(IMethodCallback callback) {
		//set up broadcast receiver for stop/unbind actions
		setupShutdownBroadcastReceiver();

		InvokeStopAllServices invoker = new InvokeStopAllServices(callback);
		invoker.execute();
	}
	
	/**
	 * Service Connection objects
	 */
	
=======
    private final static String LOG_TAG = SocietiesClientServicesController.class.getCanonicalName();
    //timeout for bind, start and stop all services
    private final static long TASK_TIMEOUT = 10000;

    private final static int NUM_SERVICES = 12;

    private final static int CIS_DIRECTORY_SERVICE 		= 0;
    private final static int CIS_MANAGER_SERVICE 		= 1;
    private final static int CIS_SUBSCRIBED_SERVICE 	= 2;
    private final static int CSS_DIRECTORY_SERVICE 		= 3;
    private final static int TRUST_SERVICE 				= 4;
    private final static int SLM_SERVICE_CONTROL_SERVICE= 5;
    private final static int PRIVACY_DATA_SERVICE 		= 6;
    private final static int PRIVACY_POLICY_SERVICE 	= 7;
    private final static int SNS_SOCIAL_DATA_SERVICE 	= 8;
    private final static int PERSONALISATION_SERVICE 	= 9;
    private final static int SLM_SERVICE_DISCO_SERVICE 	= 10;
    private final static int FRIENDS_MANAGER_SERVICE 	= 11;

    private Context context;
    private CountDownLatch servicesBinded;
    private CountDownLatch servicesStarted;
    private CountDownLatch servicesStopped;

    private BroadcastReceiver startupReceiver;
    private BroadcastReceiver shutdownReceiver;

    private boolean connectedToServices[];
    private ServiceConnection platformServiceConnections[];
    private Messenger allMessengers[];

    private IAndroidCssDirectory cssDirectoryService;
    private IServiceDiscovery slmServiceDisco;
    private IServiceControl slmServiceControl;
    private ISocialData snsConnectorService;
    private IFriendsManager friendMgrService;
    private IPrivacyPolicyManager privacyPolicyService;

    private long startTime;

    public SocietiesClientServicesController(Context context) {
        this.context = context;
        this.connectedToServices = new boolean[NUM_SERVICES];
        allMessengers = new Messenger[NUM_SERVICES];
        this.platformServiceConnections = new ServiceConnection[NUM_SERVICES];
        this.startupReceiver = null;
        this.shutdownReceiver = null;

    }

    /**
     * Bind to the app services. Assumes that login has already taken place
     */
    public void bindToServices(IMethodCallback callback) {
        //set up broadcast receiver for start/bind actions
        setupStartupBroadcastReceiver();

        InvokeBindAllServices invoker = new InvokeBindAllServices(callback);
        invoker.execute();
    }

    /**
     * Unbind from app services
     */
    public void unbindFromServices() {
        Log.d(LOG_TAG, "Unbind from Societies Platform Services");

        for (int i = 0; i < this.connectedToServices.length; i++) {
            if (this.connectedToServices[i]) {
                this.context.unbindService(this.platformServiceConnections[i]);
            }
        }
        //tear down broadcast receiver after stop/unbind actions
        this.teardownBroadcastReceiver(this.shutdownReceiver);
    }

    /**
    public void startAllServices(IMethodCallback callback) {
        InvokeStartAllServices invoker = new InvokeStartAllServices(callback);
        invoker.execute();
    }

    /**
     * Stop all Societies Client app services
     */
    public void stopAllServices(IMethodCallback callback) {
        //set up broadcast receiver for stop/unbind actions
        setupShutdownBroadcastReceiver();

        InvokeStopAllServices invoker = new InvokeStopAllServices(callback);
        invoker.execute();
    }

    /**
     * Service Connection objects
     */

>>>>>>> b8ca5af46f857705b0fc9d84f23fd641e908a161

    private ServiceConnection cisDirectoryConnection = new ServiceConnection() {
Solution content
 * for services that are considered essential and are dependencies of some or all services started in this class.
 *
 */
public class SocietiesClientServicesController {
	private final static String LOG_TAG = SocietiesClientServicesController.class.getName();
	//timeout for bind, start and stop all services
	private final static long TASK_TIMEOUT = 10000;
	
	private final static int NUM_SERVICES = 14;
	
	private final static int CIS_DIRECTORY_SERVICE 		= 0;
	private final static int CIS_MANAGER_SERVICE 		= 1;
	private final static int CIS_SUBSCRIBED_SERVICE 	= 2;
	private final static int CSS_DIRECTORY_SERVICE 		= 3;
	private final static int TRUST_SERVICE 				= 4;
	private final static int SLM_SERVICE_CONTROL_SERVICE= 5;
	private final static int PRIVACY_DATA_SERVICE 		= 6;
	private final static int PRIVACY_POLICY_SERVICE 	= 7;
	private final static int SNS_SOCIAL_DATA_SERVICE 	= 8;
	private final static int PERSONALISATION_SERVICE 	= 9;
	private final static int SLM_SERVICE_DISCO_SERVICE 	= 10;
	private final static int FRIENDS_MANAGER_SERVICE 	= 11;
	private final static int CONTEXT_SERVICE 			= 12;
	private final static int INTERNAL_TRUST_SERVICE 	= 13;
	
	private Context context;
	private CountDownLatch servicesBinded;
	private CountDownLatch servicesStarted;
	private CountDownLatch servicesStopped;

	private BroadcastReceiver startupReceiver;
	private BroadcastReceiver shutdownReceiver;
	
	private boolean connectedToServices[];
	private ServiceConnection platformServiceConnections [];
	private Messenger allMessengers [];
	
	private IAndroidCssDirectory cssDirectoryService;
	private IServiceDiscovery slmServiceDisco;
	private IServiceControl slmServiceControl;
	private ISocialData snsConnectorService;
	private IFriendsManager friendMgrService;
	private IPrivacyPolicyManager privacyPolicyService;
	private IInternalTrustClient internalTrustService;
	
	private long startTime;
	
	public SocietiesClientServicesController(Context context) {
		this.context = context;
		this.connectedToServices = new boolean[NUM_SERVICES];
		allMessengers = new Messenger[NUM_SERVICES];
		this.platformServiceConnections = new ServiceConnection[NUM_SERVICES];
		this.startupReceiver = null;
		this.shutdownReceiver = null;

	}
	
	/**
	 * Bind to the app services. Assumes that login has already taken place
	 * 
	 * @param IMethodCallback callback
	 */
	public void bindToServices(IMethodCallback callback) {
		//set up broadcast receiver for start/bind actions
		setupStartupBroadcastReceiver();

		InvokeBindAllServices invoker = new InvokeBindAllServices(callback);
		invoker.execute();
	}
	/**
	 * Unbind from app services
	 * 
	 */
	public void unbindFromServices() {
	   	Log.d(LOG_TAG, "Unbind from Societies Platform Services");
		
	   	for (int i = 0; i < this.connectedToServices.length; i++) {
			if (this.connectedToServices[i]) {
		        this.context.unbindService(this.platformServiceConnections[i]);
			}
	   	}
	   	//tear down broadcast receiver after stop/unbind actions
	   	this.teardownBroadcastReceiver(this.shutdownReceiver);
	}
	/**
	 * Start all Societies Client app services
	 * @param callback
	 */
	public void startAllServices(IMethodCallback callback) {
		InvokeStartAllServices invoker = new InvokeStartAllServices(callback);
		invoker.execute();
	}
	/**
	 * Stop all Societies Client app services
	 * @param callback
	 */
	public void stopAllServices(IMethodCallback callback) {
		//set up broadcast receiver for stop/unbind actions
		setupShutdownBroadcastReceiver();

		InvokeStopAllServices invoker = new InvokeStopAllServices(callback);
		invoker.execute();
	}
	
	/**
	 * Service Connection objects
	 */
	

    private ServiceConnection cisDirectoryConnection = new ServiceConnection() {
File
SocietiesClientServicesController.java
Developer's decision
Manual
Kind of conflict
Attribute
Comment
Method declaration
Method invocation
Chunk
Conflicting content
            SocietiesClientServicesController.this.servicesBinded.countDown();
        }
    };
<<<<<<< HEAD
    
	private ServiceConnection personalisationMgrConnection = new ServiceConnection() {
		
    	final static String SERVICE_NAME = "Platform Personalisation Manager";
		public void onServiceDisconnected(ComponentName name) {
	       	Log.d(LOG_TAG, "Disconnecting from " + SERVICE_NAME + " service");
			SocietiesClientServicesController.this.connectedToServices[PERSONALISATION_SERVICE] = false;
		}
		
		public void onServiceConnected(ComponentName name, IBinder service) {
        	Log.d(LOG_TAG, "Connecting to " + SERVICE_NAME + " service");
			
			SocietiesClientServicesController.this.connectedToServices[PERSONALISATION_SERVICE] = true;
			//get a remote binder
			SocietiesClientServicesController.this.allMessengers[PERSONALISATION_SERVICE] = new Messenger(service);
			      	
			SocietiesClientServicesController.this.platformServiceConnections[PERSONALISATION_SERVICE] = this;
			SocietiesClientServicesController.this.servicesBinded.countDown();
        	Log.d(LOG_TAG, "Time to bind to " + SERVICE_NAME + " service: " + Long.toString(System.currentTimeMillis() - SocietiesClientServicesController.this.startTime));
		}
	};

	private ServiceConnection friendsMgrConnection = new ServiceConnection() {
		
		public void onServiceDisconnected(ComponentName name) {
			Log.d(LOG_TAG, "Disconnecting from Platform Friends Manager service");
			SocietiesClientServicesController.this.connectedToServices[FRIENDS_MANAGER_SERVICE] = false;
		}
		
		public void onServiceConnected(ComponentName name, IBinder service) {
			Log.d(LOG_TAG, "Connecting to Platform Friends Manager service");
	
			SocietiesClientServicesController.this.connectedToServices[FRIENDS_MANAGER_SERVICE] = true;
				
			//Get a local binder
			LocalFriendsManagerBinder binder = (LocalFriendsManagerBinder) service;
			//Retrieve the local service API
			SocietiesClientServicesController.this.friendMgrService = (IFriendsManager) binder.getService();
        	SocietiesClientServicesController.this.platformServiceConnections[FRIENDS_MANAGER_SERVICE] = this;
			SocietiesClientServicesController.this.servicesBinded.countDown();
		}
	};
	
    private ServiceConnection contextConnection = new ServiceConnection() {

    	final static String SERVICE_NAME = "Platform Context";
        public void onServiceDisconnected(ComponentName name) {
           	Log.d(LOG_TAG, "Disconnecting from " + SERVICE_NAME + " service");
        	SocietiesClientServicesController.this.connectedToServices[CONTEXT_SERVICE] = false;
        }

        public void onServiceConnected(ComponentName name, IBinder service) {
        	Log.d(LOG_TAG, "Connecting to " + SERVICE_NAME + " service");

        	SocietiesClientServicesController.this.connectedToServices[CONTEXT_SERVICE] = true;
        	//get a remote binder
        	SocietiesClientServicesController.this.allMessengers[CONTEXT_SERVICE] = new Messenger(service);
        	
        	SocietiesClientServicesController.this.platformServiceConnections[CONTEXT_SERVICE] = this;
        	SocietiesClientServicesController.this.servicesBinded.countDown();
        	Log.d(LOG_TAG, "Time to bind to " + SERVICE_NAME + " service: " + Long.toString(System.currentTimeMillis() - SocietiesClientServicesController.this.startTime));
        }
    };
=======
>>>>>>> b8ca5af46f857705b0fc9d84f23fd641e908a161

//  private ServiceConnection ???Connection = new ServiceConnection() {
//
Solution content
        }
    };
    
	private ServiceConnection personalisationMgrConnection = new ServiceConnection() {
		
    	final static String SERVICE_NAME = "Platform Personalisation Manager";
		public void onServiceDisconnected(ComponentName name) {
	       	Log.d(LOG_TAG, "Disconnecting from " + SERVICE_NAME + " service");
			SocietiesClientServicesController.this.connectedToServices[PERSONALISATION_SERVICE] = false;
		}
		
		public void onServiceConnected(ComponentName name, IBinder service) {
        	Log.d(LOG_TAG, "Connecting to " + SERVICE_NAME + " service");
			
			SocietiesClientServicesController.this.connectedToServices[PERSONALISATION_SERVICE] = true;
			//get a remote binder
			SocietiesClientServicesController.this.allMessengers[PERSONALISATION_SERVICE] = new Messenger(service);
			      	
			SocietiesClientServicesController.this.platformServiceConnections[PERSONALISATION_SERVICE] = this;
			SocietiesClientServicesController.this.servicesBinded.countDown();
        	Log.d(LOG_TAG, "Time to bind to " + SERVICE_NAME + " service: " + Long.toString(System.currentTimeMillis() - SocietiesClientServicesController.this.startTime));
		}
	};

	private ServiceConnection friendsMgrConnection = new ServiceConnection() {
		
		public void onServiceDisconnected(ComponentName name) {
			Log.d(LOG_TAG, "Disconnecting from Platform Friends Manager service");
			SocietiesClientServicesController.this.connectedToServices[FRIENDS_MANAGER_SERVICE] = false;
		}
		
		public void onServiceConnected(ComponentName name, IBinder service) {
			Log.d(LOG_TAG, "Connecting to Platform Friends Manager service");
	
			SocietiesClientServicesController.this.connectedToServices[FRIENDS_MANAGER_SERVICE] = true;
				
			//Get a local binder
			LocalFriendsManagerBinder binder = (LocalFriendsManagerBinder) service;
			//Retrieve the local service API
			SocietiesClientServicesController.this.friendMgrService = (IFriendsManager) binder.getService();
        	SocietiesClientServicesController.this.platformServiceConnections[FRIENDS_MANAGER_SERVICE] = this;
			SocietiesClientServicesController.this.servicesBinded.countDown();
		}
	};
	
    private ServiceConnection contextConnection = new ServiceConnection() {

    	final static String SERVICE_NAME = "Platform Context";
        public void onServiceDisconnected(ComponentName name) {
           	Log.d(LOG_TAG, "Disconnecting from " + SERVICE_NAME + " service");
        	SocietiesClientServicesController.this.connectedToServices[CONTEXT_SERVICE] = false;
        }

        public void onServiceConnected(ComponentName name, IBinder service) {
        	Log.d(LOG_TAG, "Connecting to " + SERVICE_NAME + " service");

        	SocietiesClientServicesController.this.connectedToServices[CONTEXT_SERVICE] = true;
        	//get a remote binder
        	SocietiesClientServicesController.this.allMessengers[CONTEXT_SERVICE] = new Messenger(service);
        	
        	SocietiesClientServicesController.this.platformServiceConnections[CONTEXT_SERVICE] = this;
        	SocietiesClientServicesController.this.servicesBinded.countDown();
        	Log.d(LOG_TAG, "Time to bind to " + SERVICE_NAME + " service: " + Long.toString(System.currentTimeMillis() - SocietiesClientServicesController.this.startTime));
        }
    };

//  private ServiceConnection ???Connection = new ServiceConnection() {
//
File
SocietiesClientServicesController.java
Developer's decision
Version 1
Kind of conflict
Attribute
Method invocation
Chunk
Conflicting content
        	}
        	
     */
    private class InvokeBindAllServices extends AsyncTask {

<<<<<<< HEAD
    	private final String LOCAL_LOG_TAG = InvokeBindAllServices.class.getName();
    	private IMethodCallback callback;
   	 /**
   	 * Default Constructor
   	 * @param IMethodCallback callback
   	 */
    	public InvokeBindAllServices(IMethodCallback callback) {
    		this.callback = callback;
    	}

    	protected Void doInBackground(Void... args) {

    		SocietiesClientServicesController.this.servicesBinded = new CountDownLatch(NUM_SERVICES);
    		
    		SocietiesClientServicesController.this.startTime = System.currentTimeMillis();
    		
    		boolean retValue = false;
    		Intent serviceIntent = null;
    		
    		//Remote Platform services
        	Log.d(LOCAL_LOG_TAG, "Bind to Societies Android CIS Directory Service");
        	serviceIntent = new Intent(ICoreSocietiesServices.CIS_DIRECTORY_SERVICE_INTENT);
        	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, cisDirectoryConnection, Context.BIND_AUTO_CREATE);

        	if (retValue) {
            	Log.d(LOCAL_LOG_TAG, "Bind to Societies Android CIS Manager Service");
            	serviceIntent = new Intent(ICoreSocietiesServices.CIS_MANAGER_SERVICE_INTENT);
            	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, cisManagerConnection, Context.BIND_AUTO_CREATE);
        	} else {
        		Log.e(LOCAL_LOG_TAG, "CIS Directory Service does not exist");
        	}

        	if (retValue) {
	        	Log.d(LOCAL_LOG_TAG, "Bind to Societies Android CIS Subscribed Service");
	        	serviceIntent = new Intent(ICoreSocietiesServices.CIS_SUBSCRIBED_SERVICE_INTENT);
	        	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, cisSubscribedConnection, Context.BIND_AUTO_CREATE);
           	} else {
        		Log.e(LOCAL_LOG_TAG, "CIS Manager Service does not exist");
        	}

        	if (retValue) {
	        	Log.d(LOCAL_LOG_TAG, "Bind to Societies Trust Service");
	        	serviceIntent = new Intent(ICoreSocietiesServices.TRUST_CLIENT_SERVICE_INTENT);
	        	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, trustConnection, Context.BIND_AUTO_CREATE);
           	} else {
        		Log.e(LOCAL_LOG_TAG, "CIS Subscribed Service does not exist");
        	}

        	if (retValue) {
	        	Log.d(LOCAL_LOG_TAG, "Bind to Societies Context Service");
	        	serviceIntent = new Intent(ICoreSocietiesServices.CONTEXT_SERVICE_INTENT);
        /**
	        	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, contextConnection, Context.BIND_AUTO_CREATE);
           	} else {
        		Log.e(LOCAL_LOG_TAG, "Trust Service does not exist");
        	}

        	//LOCAL PLATFORM SERVICES
        	if (retValue) {
	        	Log.d(LOCAL_LOG_TAG, "Bind to Societies Android CSS Directory Service");
	        	serviceIntent = new Intent(SocietiesClientServicesController.this.context, LocalCssDirectoryService.class);
	        	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, cssDirectoryConnection, Context.BIND_AUTO_CREATE);
           	} else {
        		Log.e(LOCAL_LOG_TAG, "Context Service does not exist");
        	}

        	if (retValue) {
	        	Log.d(LOCAL_LOG_TAG, "Bind to Societies Android SLM Service Discovery Service");
	        	serviceIntent = new Intent(SocietiesClientServicesController.this.context, ServiceManagementLocal.class);
	        	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, slmDiscoConnection, Context.BIND_AUTO_CREATE);
           	} else {
        		Log.e(LOCAL_LOG_TAG, "CSS Directory Service does not exist");
        	if (retValue) {
	        	Log.d(LOCAL_LOG_TAG, "Bind to Societies Android SLM Service Control Service");
	        	serviceIntent = new Intent(SocietiesClientServicesController.this.context, ServiceManagementLocal.class);
	        	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, slmControlConnection, Context.BIND_AUTO_CREATE);
           	} else {
        		Log.e(LOCAL_LOG_TAG, "SLM Service Discovery Service does not exist");
        	}

        	if (retValue) {
	        	Log.d(LOCAL_LOG_TAG, "Bind to Societies Android SNS Connectors Service");
	        	serviceIntent = new Intent(SocietiesClientServicesController.this.context, SocialData.class);
	        	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, snsSocialDataConnection, Context.BIND_AUTO_CREATE);
           	} else {
        		Log.e(LOCAL_LOG_TAG, "SLM Service Control Service does not exist");
        	}
        	
        	if (retValue) {
	        	Log.d(LOCAL_LOG_TAG, "Bind to Societies Friends Manager Service");
	        	serviceIntent = new Intent(SocietiesClientServicesController.this.context, FriendsManagerLocal.class);
	        	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, friendsMgrConnection, Context.BIND_AUTO_CREATE);
           	} else {
        		Log.e(LOCAL_LOG_TAG, "SNS Connectors Service does not exist");
        	}
        	
        	if (retValue) {
	        	Log.d(LOCAL_LOG_TAG, "Bind to Societies Privacy Policy Service");
	        	serviceIntent = new Intent(SocietiesClientServicesController.this.context, PrivacyPolicyManagerLocalService.class);
	        	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, privacyPolicyConnection, Context.BIND_AUTO_CREATE);
           	} else {
        		Log.e(LOCAL_LOG_TAG, "Friends Manager Service does not exist");
        	}
        	
        	if (retValue) {
	        	Log.d(LOCAL_LOG_TAG, "Bind to Societies Internal Trust Service");
	        	serviceIntent = new Intent(SocietiesClientServicesController.this.context, TrustClientLocal.class);
	        	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, internalTrustConnection, Context.BIND_AUTO_CREATE);
           	} else {
        		Log.e(LOCAL_LOG_TAG, "Privacy Policy Service does not exist");
        	}
        	
        	if (!retValue) {
        		Log.e(LOCAL_LOG_TAG, "Internal Trust Service does not exist");
        	}
        	
        	try {
        		//To prevent hanging this latch uses a timeout
        		SocietiesClientServicesController.this.servicesBinded.await(TASK_TIMEOUT, TimeUnit.MILLISECONDS);
    			callback.returnAction(retValue);
    		} catch (InterruptedException e) {
    			retValue = false;
    			e.printStackTrace();
    			callback.returnException(e.getMessage());
    		}
    		return null;
    	}
=======
        private final String LOCAL_LOG_TAG = InvokeBindAllServices.class.getCanonicalName();
        private IMethodCallback callback;

         * Default Constructor
         */
        public InvokeBindAllServices(IMethodCallback callback) {
            this.callback = callback;
        }

        @Override
        protected Void doInBackground(Void... args) {

            SocietiesClientServicesController.this.servicesBinded = new CountDownLatch(NUM_SERVICES);

            SocietiesClientServicesController.this.startTime = System.currentTimeMillis();

            boolean retValue = false;
            Intent serviceIntent = null;

            //Remote Platform services
            Log.d(LOCAL_LOG_TAG, "Bind to Societies Android CIS Directory Service");
            serviceIntent = new Intent(ICoreSocietiesServices.CIS_DIRECTORY_SERVICE_INTENT);
            retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, cisDirectoryConnection, Context.BIND_AUTO_CREATE);

            if (retValue) {
                Log.d(LOCAL_LOG_TAG, "Bind to Societies Android CIS Manager Service");
                serviceIntent = new Intent(ICoreSocietiesServices.CIS_MANAGER_SERVICE_INTENT);
                retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, cisManagerConnection, Context.BIND_AUTO_CREATE);
            } else {
                Log.e(LOCAL_LOG_TAG, "CIS Manager Service does not exist");
            }

            if (retValue) {
                Log.d(LOCAL_LOG_TAG, "Bind to Societies Android CIS Subscribed Service");
                serviceIntent = new Intent(ICoreSocietiesServices.CIS_SUBSCRIBED_SERVICE_INTENT);
                retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, cisSubscribedConnection, Context.BIND_AUTO_CREATE);
            } else {
                Log.e(LOCAL_LOG_TAG, "CIS Subscribed Service does not exist");
            }

            if (retValue) {
                Log.d(LOCAL_LOG_TAG, "Bind to Societies Trust Service");
                serviceIntent = new Intent(ICoreSocietiesServices.TRUST_CLIENT_SERVICE_INTENT);
                retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, trustConnection, Context.BIND_AUTO_CREATE);
            } else {
                Log.e(LOCAL_LOG_TAG, "Trust Service does not exist");
            }

            //LOCAL PLATFORM SERVICES
            if (retValue) {
                Log.d(LOCAL_LOG_TAG, "Bind to Societies Android CSS Directory Service");
                serviceIntent = new Intent(SocietiesClientServicesController.this.context, LocalCssDirectoryService.class);
                retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, cssDirectoryConnection, Context.BIND_AUTO_CREATE);
            } else {
                Log.e(LOCAL_LOG_TAG, "CSS Directory Service does not exist");
            }

            if (retValue) {
                Log.d(LOCAL_LOG_TAG, "Bind to Societies Android SLM Service Discovery Service");
                serviceIntent = new Intent(SocietiesClientServicesController.this.context, ServiceManagementLocal.class);
                retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, slmDiscoConnection, Context.BIND_AUTO_CREATE);
            } else {
                Log.e(LOCAL_LOG_TAG, "SLM Service Discovery Service does not exist");
            }

            if (retValue) {
                Log.d(LOCAL_LOG_TAG, "Bind to Societies Android SLM Service Control Service");
                serviceIntent = new Intent(SocietiesClientServicesController.this.context, ServiceManagementLocal.class);
                retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, slmControlConnection, Context.BIND_AUTO_CREATE);
            } else {
                Log.e(LOCAL_LOG_TAG, "SLM Service Control Service does not exist");
            }

            if (retValue) {
                Log.d(LOCAL_LOG_TAG, "Bind to Societies Android SNS Connectors Service");
                serviceIntent = new Intent(SocietiesClientServicesController.this.context, SocialData.class);
                retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, snsSocialDataConnection, Context.BIND_AUTO_CREATE);
            } else {
                Log.e(LOCAL_LOG_TAG, "SNS Connectors Service does not exist");
            }
            if (retValue) {
                Log.d(LOCAL_LOG_TAG, "Bind to Societies Friends Manager Service");
                serviceIntent = new Intent(SocietiesClientServicesController.this.context, FriendsManagerLocal.class);
                retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, friendsMgrConnection, Context.BIND_AUTO_CREATE);
            } else {
                Log.e(LOCAL_LOG_TAG, "Friends Manager Service does not exist");
            }

            if (retValue) {
                Log.d(LOCAL_LOG_TAG, "Bind to Societies Privacy Policy Service");
                serviceIntent = new Intent(SocietiesClientServicesController.this.context, PrivacyPolicyManagerLocalService.class);
                retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, privacyPolicyConnection, Context.BIND_AUTO_CREATE);
            } else {
                Log.e(LOCAL_LOG_TAG, "Privacy Policy Service does not exist");
            }


            try {
                //To prevent hanging this latch uses a timeout
                SocietiesClientServicesController.this.servicesBinded.await(TASK_TIMEOUT, TimeUnit.MILLISECONDS);
                callback.returnAction(retValue);
            } catch (InterruptedException e) {
                retValue = false;
                e.printStackTrace();
                callback.returnException(e.getMessage());
            }
            return null;
        }
>>>>>>> b8ca5af46f857705b0fc9d84f23fd641e908a161
    }

    /**
Solution content
     */
    private class InvokeBindAllServices extends AsyncTask {

    	private final String LOCAL_LOG_TAG = InvokeBindAllServices.class.getName();
    	private IMethodCallback callback;
   	 /**
   	 * Default Constructor
   	 * @param IMethodCallback callback
   	 */
    	public InvokeBindAllServices(IMethodCallback callback) {
    		this.callback = callback;
    	}

    	protected Void doInBackground(Void... args) {

    		SocietiesClientServicesController.this.servicesBinded = new CountDownLatch(NUM_SERVICES);
    		
    		SocietiesClientServicesController.this.startTime = System.currentTimeMillis();
    		
    		boolean retValue = false;
    		Intent serviceIntent = null;
    		
    		//Remote Platform services
        	}
        	Log.d(LOCAL_LOG_TAG, "Bind to Societies Android CIS Directory Service");
        	serviceIntent = new Intent(ICoreSocietiesServices.CIS_DIRECTORY_SERVICE_INTENT);
        	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, cisDirectoryConnection, Context.BIND_AUTO_CREATE);

        	if (retValue) {
            	Log.d(LOCAL_LOG_TAG, "Bind to Societies Android CIS Manager Service");
            	serviceIntent = new Intent(ICoreSocietiesServices.CIS_MANAGER_SERVICE_INTENT);
            	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, cisManagerConnection, Context.BIND_AUTO_CREATE);
        	} else {
        		Log.e(LOCAL_LOG_TAG, "CIS Directory Service does not exist");
        	}

        	if (retValue) {
	        	Log.d(LOCAL_LOG_TAG, "Bind to Societies Android CIS Subscribed Service");
	        	serviceIntent = new Intent(ICoreSocietiesServices.CIS_SUBSCRIBED_SERVICE_INTENT);
	        	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, cisSubscribedConnection, Context.BIND_AUTO_CREATE);
           	} else {
        		Log.e(LOCAL_LOG_TAG, "CIS Manager Service does not exist");
        	}

        	if (retValue) {
	        	Log.d(LOCAL_LOG_TAG, "Bind to Societies Trust Service");
	        	serviceIntent = new Intent(ICoreSocietiesServices.TRUST_CLIENT_SERVICE_INTENT);
	        	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, trustConnection, Context.BIND_AUTO_CREATE);
           	} else {
        		Log.e(LOCAL_LOG_TAG, "CIS Subscribed Service does not exist");
        	}

        	if (retValue) {
	        	Log.d(LOCAL_LOG_TAG, "Bind to Societies Context Service");
	        	serviceIntent = new Intent(ICoreSocietiesServices.CONTEXT_SERVICE_INTENT);
	        	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, contextConnection, Context.BIND_AUTO_CREATE);
           	} else {
        		Log.e(LOCAL_LOG_TAG, "Trust Service does not exist");
        	}

        	//LOCAL PLATFORM SERVICES
        	if (retValue) {
	        	Log.d(LOCAL_LOG_TAG, "Bind to Societies Android CSS Directory Service");
	        	serviceIntent = new Intent(SocietiesClientServicesController.this.context, LocalCssDirectoryService.class);
	        	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, cssDirectoryConnection, Context.BIND_AUTO_CREATE);
           	} else {
        		Log.e(LOCAL_LOG_TAG, "Context Service does not exist");
        	}

        	if (retValue) {
	        	Log.d(LOCAL_LOG_TAG, "Bind to Societies Android SLM Service Discovery Service");
	        	serviceIntent = new Intent(SocietiesClientServicesController.this.context, ServiceManagementLocal.class);
	        	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, slmDiscoConnection, Context.BIND_AUTO_CREATE);
           	} else {
        		Log.e(LOCAL_LOG_TAG, "CSS Directory Service does not exist");
        	}
        	
        	if (retValue) {
	        	Log.d(LOCAL_LOG_TAG, "Bind to Societies Android SLM Service Control Service");
	        	serviceIntent = new Intent(SocietiesClientServicesController.this.context, ServiceManagementLocal.class);
	        	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, slmControlConnection, Context.BIND_AUTO_CREATE);
           	} else {
        		Log.e(LOCAL_LOG_TAG, "SLM Service Discovery Service does not exist");
        	}

        	if (retValue) {
	        	Log.d(LOCAL_LOG_TAG, "Bind to Societies Android SNS Connectors Service");
	        	serviceIntent = new Intent(SocietiesClientServicesController.this.context, SocialData.class);
	        	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, snsSocialDataConnection, Context.BIND_AUTO_CREATE);
           	} else {
        		Log.e(LOCAL_LOG_TAG, "SLM Service Control Service does not exist");
        	}
        	
        	if (retValue) {
	        	Log.d(LOCAL_LOG_TAG, "Bind to Societies Friends Manager Service");
	        	serviceIntent = new Intent(SocietiesClientServicesController.this.context, FriendsManagerLocal.class);
	        	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, friendsMgrConnection, Context.BIND_AUTO_CREATE);
           	} else {
        		Log.e(LOCAL_LOG_TAG, "SNS Connectors Service does not exist");
        	
        	if (retValue) {
	        	Log.d(LOCAL_LOG_TAG, "Bind to Societies Privacy Policy Service");
	        	serviceIntent = new Intent(SocietiesClientServicesController.this.context, PrivacyPolicyManagerLocalService.class);
	        	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, privacyPolicyConnection, Context.BIND_AUTO_CREATE);
           	} else {
        		Log.e(LOCAL_LOG_TAG, "Friends Manager Service does not exist");
        	}
        	
        	if (retValue) {
	        	Log.d(LOCAL_LOG_TAG, "Bind to Societies Internal Trust Service");
	        	serviceIntent = new Intent(SocietiesClientServicesController.this.context, TrustClientLocal.class);
	        	retValue = SocietiesClientServicesController.this.context.bindService(serviceIntent, internalTrustConnection, Context.BIND_AUTO_CREATE);
           	} else {
        		Log.e(LOCAL_LOG_TAG, "Privacy Policy Service does not exist");
        	}
        	
        	if (!retValue) {
        		Log.e(LOCAL_LOG_TAG, "Internal Trust Service does not exist");
        	}
        	
        	try {
        		//To prevent hanging this latch uses a timeout
        		SocietiesClientServicesController.this.servicesBinded.await(TASK_TIMEOUT, TimeUnit.MILLISECONDS);
    			callback.returnAction(retValue);
    		} catch (InterruptedException e) {
    			retValue = false;
    			e.printStackTrace();
    			callback.returnException(e.getMessage());
    		}
    		return null;
    	}
    }
File
SocietiesClientServicesController.java
Developer's decision
Combination
Kind of conflict
Annotation
Attribute
Comment
Method declaration
Method invocation
Chunk
Conflicting content
        /**
     */
    private class InvokeStartAllServices extends AsyncTask {

<<<<<<< HEAD
    	private final String LOCAL_LOG_TAG = InvokeStartAllServices.class.getName();
    	private IMethodCallback callback;

   	 /**
   	 * Default Constructor
   	 * @param serviceMessenger
   	 */
    	public InvokeStartAllServices(IMethodCallback callback) {
    		this.callback = callback;
    	}

    	protected Void doInBackground(Void... args) {
    		SocietiesClientServicesController.this.servicesStarted = new CountDownLatch(NUM_SERVICES);
    		
    		SocietiesClientServicesController.this.startTime = System.currentTimeMillis();

    		boolean retValue = true;
    		//Start remote platform services
    		for (int i  = 0; i < SocietiesClientServicesController.this.allMessengers.length; i++) {
    			Log.d(LOCAL_LOG_TAG, "Starting service: " + i);
    			
    			if (null != SocietiesClientServicesController.this.allMessengers[i]) {
            		String targetMethod = IServiceManager.methodsArray[0];
            		android.os.Message outMessage = getRemoteMessage(targetMethod, i);
               		Bundle outBundle = new Bundle();
               		outMessage.setData(outBundle);
            		Log.d(LOCAL_LOG_TAG, "Call service start method: " + targetMethod);

            		try {
            			SocietiesClientServicesController.this.allMessengers[i].send(outMessage);
        			} catch (RemoteException e) {
        				Log.e(LOCAL_LOG_TAG, "Unable to start service, index: " + i, e);
        			}
    			}
     		}
    		//Start local platform services
    		SocietiesClientServicesController.this.cssDirectoryService.startService();
    		SocietiesClientServicesController.this.slmServiceDisco.startService();
    		SocietiesClientServicesController.this.slmServiceControl.startService();
    		SocietiesClientServicesController.this.snsConnectorService.startService();
    		SocietiesClientServicesController.this.friendMgrService.startService();
    		SocietiesClientServicesController.this.privacyPolicyService.startService();
    		SocietiesClientServicesController.this.internalTrustService.startService();
    		
    		//START "STARTED SERVICES"
        	//FRIENDS SERVICE
=======
        private final String LOCAL_LOG_TAG = InvokeStartAllServices.class.getCanonicalName();
        private IMethodCallback callback;

         * Default Constructor
         */
        public InvokeStartAllServices(IMethodCallback callback) {
            this.callback = callback;
        }

        @Override
        protected Void doInBackground(Void... args) {
            SocietiesClientServicesController.this.servicesStarted = new CountDownLatch(NUM_SERVICES);

            SocietiesClientServicesController.this.startTime = System.currentTimeMillis();

            boolean retValue = true;
            //Start remote platform services
            for (int i = 0; i < SocietiesClientServicesController.this.allMessengers.length; i++) {

                if (null != SocietiesClientServicesController.this.allMessengers[i]) {
                    String targetMethod = IServiceManager.methodsArray[0];
                    android.os.Message outMessage = getRemoteMessage(targetMethod, i);
                    Bundle outBundle = new Bundle();
                    outMessage.setData(outBundle);
                    Log.d(LOCAL_LOG_TAG, "Call service start method: " + targetMethod);

                    try {
                        SocietiesClientServicesController.this.allMessengers[i].send(outMessage);
                    } catch (RemoteException e) {
                        Log.e(LOCAL_LOG_TAG, "Unable to start service, index: " + i, e);
                    }
                }
            }
            //Start local platform services
            SocietiesClientServicesController.this.cssDirectoryService.startService();
            SocietiesClientServicesController.this.slmServiceDisco.startService();
            SocietiesClientServicesController.this.slmServiceControl.startService();
            SocietiesClientServicesController.this.snsConnectorService.startService();
            SocietiesClientServicesController.this.friendMgrService.startService();
            SocietiesClientServicesController.this.privacyPolicyService.startService();

            //START "STARTED SERVICES"
            //FRIENDS SERVICE
>>>>>>> b8ca5af46f857705b0fc9d84f23fd641e908a161
            Intent intentFriends = new Intent(SocietiesClientServicesController.this.context, EventService.class);
            SocietiesClientServicesController.this.context.startService(intentFriends);
            //USERFEEDBACK EVENT LISTENER
Solution content
     */
    private class InvokeStartAllServices extends AsyncTask {

    	private final String LOCAL_LOG_TAG = InvokeStartAllServices.class.getName();
    	private IMethodCallback callback;

   	 /**
   	 * Default Constructor
   	 * @param serviceMessenger
   	 */
    	public InvokeStartAllServices(IMethodCallback callback) {
    		this.callback = callback;
    	}

    	protected Void doInBackground(Void... args) {
    		SocietiesClientServicesController.this.servicesStarted = new CountDownLatch(NUM_SERVICES);
    		
    		SocietiesClientServicesController.this.startTime = System.currentTimeMillis();

    		boolean retValue = true;
    		//Start remote platform services
    		for (int i  = 0; i < SocietiesClientServicesController.this.allMessengers.length; i++) {
    			Log.d(LOCAL_LOG_TAG, "Starting service: " + i);
    			
    			if (null != SocietiesClientServicesController.this.allMessengers[i]) {
            		String targetMethod = IServiceManager.methodsArray[0];
            		android.os.Message outMessage = getRemoteMessage(targetMethod, i);
               		Bundle outBundle = new Bundle();
               		outMessage.setData(outBundle);
            		Log.d(LOCAL_LOG_TAG, "Call service start method: " + targetMethod);

            		try {
            			SocietiesClientServicesController.this.allMessengers[i].send(outMessage);
        			} catch (RemoteException e) {
        				Log.e(LOCAL_LOG_TAG, "Unable to start service, index: " + i, e);
        			}
    			}
     		}
    		//Start local platform services
    		SocietiesClientServicesController.this.cssDirectoryService.startService();
    		SocietiesClientServicesController.this.slmServiceDisco.startService();
    		SocietiesClientServicesController.this.slmServiceControl.startService();
    		SocietiesClientServicesController.this.snsConnectorService.startService();
    		SocietiesClientServicesController.this.friendMgrService.startService();
    		SocietiesClientServicesController.this.privacyPolicyService.startService();
    		SocietiesClientServicesController.this.internalTrustService.startService();
    		
    		//START "STARTED SERVICES"
        	//FRIENDS SERVICE
            Intent intentFriends = new Intent(SocietiesClientServicesController.this.context, EventService.class);
            SocietiesClientServicesController.this.context.startService(intentFriends);
            //USERFEEDBACK EVENT LISTENER
File
SocietiesClientServicesController.java
Developer's decision
Version 1
Kind of conflict
Annotation
Attribute
Comment
For statement
Method declaration
Method invocation
Method signature
Variable
Chunk
Conflicting content
     */
    private class InvokeStopAllServices extends AsyncTask {

<<<<<<< HEAD
    	private final String LOCAL_LOG_TAG = InvokeStopAllServices.class.getName();
    	private IMethodCallback callback;

   	 /**
   	 * Default Constructor
   	 * @param serviceMessenger
   	 */
    	public InvokeStopAllServices(IMethodCallback callback) {
    		this.callback = callback;
    	}

    	protected Void doInBackground(Void... args) {
    		SocietiesClientServicesController.this.servicesStopped = new CountDownLatch(NUM_SERVICES);
    		
    		SocietiesClientServicesController.this.startTime = System.currentTimeMillis();
    		
    		boolean retValue = true;
    		
    		//STOP REMOTE SERVICES
    		for (int i  = 0; i < SocietiesClientServicesController.this.allMessengers.length; i++) {
    			if (null != SocietiesClientServicesController.this.allMessengers[i]) {
            		String targetMethod = IServiceManager.methodsArray[1];
            		android.os.Message outMessage = getRemoteMessage(targetMethod, i);
               		Bundle outBundle = new Bundle();
               		outMessage.setData(outBundle);

            		Log.d(LOCAL_LOG_TAG, "Call service stop method: " + targetMethod);

            		try {
            			SocietiesClientServicesController.this.allMessengers[i].send(outMessage);
        			} catch (RemoteException e) {
        				Log.e(LOCAL_LOG_TAG, "Unable to stop service, index: " + i, e);
        			}
    			}
     		}

    		//STOP LOCAL SERVICES
    		SocietiesClientServicesController.this.cssDirectoryService.stopService();
    		SocietiesClientServicesController.this.slmServiceDisco.stopService();
    		SocietiesClientServicesController.this.slmServiceControl.stopService();
    		SocietiesClientServicesController.this.snsConnectorService.stopService();
    		SocietiesClientServicesController.this.friendMgrService.stopService();
    		SocietiesClientServicesController.this.privacyPolicyService.stopService();
    		SocietiesClientServicesController.this.internalTrustService.stopService();

    		//STOP "STARTED SERVICES"
        	//FRIENDS SERVICE
=======
        private final String LOCAL_LOG_TAG = InvokeStopAllServices.class.getCanonicalName();
        private IMethodCallback callback;

        /**
         * Default Constructor
         */
        public InvokeStopAllServices(IMethodCallback callback) {
            this.callback = callback;
        }

        @Override
        protected Void doInBackground(Void... args) {
            SocietiesClientServicesController.this.servicesStopped = new CountDownLatch(NUM_SERVICES);
            SocietiesClientServicesController.this.startTime = System.currentTimeMillis();

            boolean retValue = true;

            //STOP REMOTE SERVICES
            for (int i = 0; i < SocietiesClientServicesController.this.allMessengers.length; i++) {
                if (null != SocietiesClientServicesController.this.allMessengers[i]) {
                    String targetMethod = IServiceManager.methodsArray[1];
                    android.os.Message outMessage = getRemoteMessage(targetMethod, i);
                    Bundle outBundle = new Bundle();
                    outMessage.setData(outBundle);

                    Log.d(LOCAL_LOG_TAG, "Call service stop method: " + targetMethod);

                    try {
                        SocietiesClientServicesController.this.allMessengers[i].send(outMessage);
                    } catch (RemoteException e) {
                        Log.e(LOCAL_LOG_TAG, "Unable to stop service, index: " + i, e);
                    }
                }
            }

            //STOP LOCAL SERVICES
            SocietiesClientServicesController.this.cssDirectoryService.stopService();
            SocietiesClientServicesController.this.slmServiceDisco.stopService();
            SocietiesClientServicesController.this.slmServiceControl.stopService();
            SocietiesClientServicesController.this.snsConnectorService.stopService();
            SocietiesClientServicesController.this.friendMgrService.stopService();
            SocietiesClientServicesController.this.privacyPolicyService.stopService();

            //STOP "STARTED SERVICES"
            //FRIENDS SERVICE
>>>>>>> b8ca5af46f857705b0fc9d84f23fd641e908a161
            Intent intentFriends = new Intent(SocietiesClientServicesController.this.context, EventService.class);
            SocietiesClientServicesController.this.context.stopService(intentFriends);
            //USERFEEDBACK EVENT LISTENER
Solution content
     */
    private class InvokeStopAllServices extends AsyncTask {

    	private final String LOCAL_LOG_TAG = InvokeStopAllServices.class.getName();
    	private IMethodCallback callback;

   	 /**
   	 * Default Constructor
   	 * @param serviceMessenger
   	 */
    	public InvokeStopAllServices(IMethodCallback callback) {
    		this.callback = callback;
    	}

    	protected Void doInBackground(Void... args) {
    		SocietiesClientServicesController.this.servicesStopped = new CountDownLatch(NUM_SERVICES);
    		
    		SocietiesClientServicesController.this.startTime = System.currentTimeMillis();
    		
    		boolean retValue = true;
    		
    		//STOP REMOTE SERVICES
    		for (int i  = 0; i < SocietiesClientServicesController.this.allMessengers.length; i++) {
    			if (null != SocietiesClientServicesController.this.allMessengers[i]) {
            		String targetMethod = IServiceManager.methodsArray[1];
            		android.os.Message outMessage = getRemoteMessage(targetMethod, i);
               		Bundle outBundle = new Bundle();
               		outMessage.setData(outBundle);

            		Log.d(LOCAL_LOG_TAG, "Call service stop method: " + targetMethod);

            		try {
            			SocietiesClientServicesController.this.allMessengers[i].send(outMessage);
        			} catch (RemoteException e) {
        				Log.e(LOCAL_LOG_TAG, "Unable to stop service, index: " + i, e);
        			}
    			}
     		}

    		//STOP LOCAL SERVICES
    		SocietiesClientServicesController.this.cssDirectoryService.stopService();
    		SocietiesClientServicesController.this.slmServiceDisco.stopService();
    		SocietiesClientServicesController.this.slmServiceControl.stopService();
    		SocietiesClientServicesController.this.snsConnectorService.stopService();
    		SocietiesClientServicesController.this.friendMgrService.stopService();
    		SocietiesClientServicesController.this.privacyPolicyService.stopService();
    		SocietiesClientServicesController.this.internalTrustService.stopService();

    		//STOP "STARTED SERVICES"
        	//FRIENDS SERVICE
            Intent intentFriends = new Intent(SocietiesClientServicesController.this.context, EventService.class);
            SocietiesClientServicesController.this.context.stopService(intentFriends);
            //USERFEEDBACK EVENT LISTENER
File
SocietiesClientServicesController.java
Developer's decision
Version 1
Kind of conflict
Annotation
Attribute
Comment
For statement
Method declaration
Method invocation
Method signature
Variable
Chunk
Conflicting content
     * Create the correct message for remote method invocation
     */
    private android.os.Message getRemoteMessage(String targetMethod, int index) {
<<<<<<< HEAD
		android.os.Message retValue = null;
		
		switch (index) {
		case CIS_DIRECTORY_SERVICE:
			retValue = android.os.Message.obtain(null, ServiceMethodTranslator.getMethodIndex(ICisDirectory.methodsArray, targetMethod), 0, 0);
			break;
		case CIS_MANAGER_SERVICE:
			retValue = android.os.Message.obtain(null, ServiceMethodTranslator.getMethodIndex(ICisManager.methodsArray, targetMethod), 0, 0);
			break;
		case CIS_SUBSCRIBED_SERVICE:
			retValue = android.os.Message.obtain(null, ServiceMethodTranslator.getMethodIndex(ICisSubscribed.methodsArray, targetMethod), 0, 0);
			break;
		case TRUST_SERVICE:
			retValue = android.os.Message.obtain(null, ServiceMethodTranslator.getMethodIndex(IInternalTrustClient.methodsArray, targetMethod), 0, 0);
			break;
		case CONTEXT_SERVICE:
			retValue = android.os.Message.obtain(null, ServiceMethodTranslator.getMethodIndex(IInternalCtxClient.methodsArray, targetMethod), 0, 0);
			break;
=======
        android.os.Message retValue = null;
        switch (index) {
            case CIS_DIRECTORY_SERVICE:
                retValue = android.os.Message.obtain(null, ServiceMethodTranslator.getMethodIndex(ICisDirectory.methodsArray, targetMethod), 0, 0);
                break;
            case CIS_MANAGER_SERVICE:
                retValue = android.os.Message.obtain(null, ServiceMethodTranslator.getMethodIndex(ICisManager.methodsArray, targetMethod), 0, 0);
                break;
            case CIS_SUBSCRIBED_SERVICE:
                retValue = android.os.Message.obtain(null, ServiceMethodTranslator.getMethodIndex(ICisSubscribed.methodsArray, targetMethod), 0, 0);
                break;
            case TRUST_SERVICE:
                retValue = android.os.Message.obtain(null, ServiceMethodTranslator.getMethodIndex(IInternalTrustClient.methodsArray, targetMethod), 0, 0);
                break;
>>>>>>> b8ca5af46f857705b0fc9d84f23fd641e908a161
//			case ???_SERVICE:
//			retValue = android.os.Message.obtain(null, ServiceMethodTranslator.getMethodIndex(???.methodsArray, targetMethod), 0, 0);
//			break;
Solution content
     * Create the correct message for remote method invocation
     * 
     * @param targetMethod
     * @param index
     * @return android.os.Message
     */
    private android.os.Message getRemoteMessage(String targetMethod, int index) {
		android.os.Message retValue = null;
		
		switch (index) {
		case CIS_DIRECTORY_SERVICE:
			retValue = android.os.Message.obtain(null, ServiceMethodTranslator.getMethodIndex(ICisDirectory.methodsArray, targetMethod), 0, 0);
			break;
		case CIS_MANAGER_SERVICE:
			retValue = android.os.Message.obtain(null, ServiceMethodTranslator.getMethodIndex(ICisManager.methodsArray, targetMethod), 0, 0);
			break;
		case CIS_SUBSCRIBED_SERVICE:
			retValue = android.os.Message.obtain(null, ServiceMethodTranslator.getMethodIndex(ICisSubscribed.methodsArray, targetMethod), 0, 0);
			break;
		case TRUST_SERVICE:
			retValue = android.os.Message.obtain(null, ServiceMethodTranslator.getMethodIndex(IInternalTrustClient.methodsArray, targetMethod), 0, 0);
			break;
		case CONTEXT_SERVICE:
			retValue = android.os.Message.obtain(null, ServiceMethodTranslator.getMethodIndex(IInternalCtxClient.methodsArray, targetMethod), 0, 0);
			break;
//			case ???_SERVICE:
//			retValue = android.os.Message.obtain(null, ServiceMethodTranslator.getMethodIndex(???.methodsArray, targetMethod), 0, 0);
//			break;
File
SocietiesClientServicesController.java
Developer's decision
Manual
Kind of conflict
Break statement
Case statement
Method invocation
Switch statement
Variable