Commit 2243c0f4 authored by vince-bourgmayer's avatar vince-bourgmayer
Browse files

use CommonUtils.setServiceUncaughtException(Service) in concerned service

parent 8d53d57d
......@@ -68,11 +68,7 @@ public class InitializerService extends Service implements OnRemoteOperationList
@Override
public int onStartCommand( Intent intent, int flags, int startId ) {
Log.i(TAG, "onStartCommand(...)");
if(Thread.getDefaultUncaughtExceptionHandler().getClass().getSimpleName().equals(ServiceExceptionHandler.class.getSimpleName())){
Log.d("ObserverService", "ServiceExceptionHandler already set!");
}else{
Thread.setDefaultUncaughtExceptionHandler(new ServiceExceptionHandler(this));
}
CommonUtils.setServiceUnCaughtExceptionHandler(this);
//Get account
SharedPreferences prefs = this.getSharedPreferences( AppConstants.SHARED_PREFERENCE_NAME, Context.MODE_PRIVATE );
......
......@@ -80,11 +80,9 @@ public class ObserverService extends Service implements OnRemoteOperationListene
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Log.i(TAG, "onStartCommand("+startId+")");
if(Thread.getDefaultUncaughtExceptionHandler().getClass().getSimpleName().equals(ServiceExceptionHandler.class.getSimpleName())){
Log.d("ObserverService", "ServiceExceptionHandler already set!");
}else{
Thread.setDefaultUncaughtExceptionHandler(new ServiceExceptionHandler(this));
}
CommonUtils.setServiceUnCaughtExceptionHandler(this);
SharedPreferences prefs = this.getSharedPreferences(AppConstants.SHARED_PREFERENCE_NAME, Context.MODE_PRIVATE);
String accountName = prefs.getString(AccountManager.KEY_ACCOUNT_NAME, "");
String accountType = prefs.getString(AccountManager.KEY_ACCOUNT_TYPE, "");
......
......@@ -239,11 +239,8 @@ public class OperationManagerService extends Service implements OnRemoteOperatio
public int onStartCommand(Intent intent, int flags, int startId) {
Log.i(TAG, "onStartCommand()");
if(Thread.getDefaultUncaughtExceptionHandler().getClass().getSimpleName().equals(ServiceExceptionHandler.class.getSimpleName())){
Log.d("ObserverService", "ServiceExceptionHandler already set!");
}else{
Thread.setDefaultUncaughtExceptionHandler(new ServiceExceptionHandler(this));
}
CommonUtils.setServiceUnCaughtExceptionHandler(this);
Bundle extras = intent.getExtras();
Log.d(TAG, "OperationManagerService recieved "+(extras == null ? "null extras": extras.size()+" operations to perform") );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment