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

Commit 563c9965 authored by vince-bourgmayer's avatar vince-bourgmayer
Browse files

use CommonUtils.setServiceUncaughtException(Service) in concerned service

parent 46b51eb7
Loading
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -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 );
+3 −5
Original line number Diff line number Diff line
@@ -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, "");
+2 −5
Original line number Diff line number Diff line
@@ -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") );