Commit d8719a63 authored by vince-bourgmayer's avatar vince-bourgmayer
Browse files

use method from commonUtils to set the UEH

parent 6af28da3
......@@ -66,11 +66,7 @@ public class InitializerService extends Service implements OnRemoteOperationList
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,8 @@ public class ObserverService extends Service implements OnRemoteOperationListene
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, "");
......
......@@ -227,11 +227,9 @@ public class OperationManagerService extends Service implements OnRemoteOperatio
@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);
Bundle extras = intent.getExtras();
Log.d(TAG, "OperationManagerService recieved "+(extras == null ? "null extras": extras.size()+" operations to perform") );
......@@ -284,11 +282,9 @@ public class OperationManagerService extends Service implements OnRemoteOperatio
}else{
Log.w(TAG, "Intent's extras is null.");
}
return super.onStartCommand(intent, flags, startId);
}
@Nullable
@Override
public IBinder onBind(Intent intent) {
......
Markdown is supported
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