diff options
| -rw-r--r-- | src/org/thialfihar/android/apg/utils/ApgCon.java | 37 | 
1 files changed, 8 insertions, 29 deletions
diff --git a/src/org/thialfihar/android/apg/utils/ApgCon.java b/src/org/thialfihar/android/apg/utils/ApgCon.java index 5572dcdb5..3e0b75524 100644 --- a/src/org/thialfihar/android/apg/utils/ApgCon.java +++ b/src/org/thialfihar/android/apg/utils/ApgCon.java @@ -34,11 +34,6 @@ import org.thialfihar.android.apg.IApgService;   */  public class ApgCon { -    /** -     * Put stacktraces into the log? -     */ -    private final static boolean stacktraces = true; -      private class call_async extends AsyncTask<String, Void, Void> {          @Override @@ -61,21 +56,15 @@ public class ApgCon {                      }                      Log.d(TAG, "Callback executed");                  } catch (NoSuchMethodException e) { -                    if (stacktraces) -                        e.printStackTrace(); -                    Log.w(TAG, "Exception in callback: Method '" + callback_method + "' not found"); +                    Log.w(TAG, "Exception in callback: Method '" + callback_method + "' not found", e);                      warning_list.add("(LOCAL) Could not execute callback, method '" + callback_method + "()' not found");                  } catch (InvocationTargetException e) { -                    if (stacktraces) -                        e.printStackTrace();                      Throwable orig = e.getTargetException(); -                    Log.w(TAG, "Exception of type '" + orig.getClass() + "' in callback's method '" + callback_method + "()':" + orig.getMessage()); +                    Log.w(TAG, "Exception of type '" + orig.getClass() + "' in callback's method '" + callback_method + "()':" + orig.getMessage(), orig);                      warning_list.add("(LOCAL) Exception of type '" + orig.getClass() + "' in callback's method '" + callback_method + "()':"                              + orig.getMessage());                  } catch (Exception e) { -                    if (stacktraces) -                        e.printStackTrace(); -                    Log.w(TAG, "Exception on callback: (" + e.getClass() + ") " + e.getMessage()); +                    Log.w(TAG, "Exception on callback: (" + e.getClass() + ") " + e.getMessage(), e);                      warning_list.add("(LOCAL) Could not execute callback (" + e.getClass() + "): " + e.getMessage());                  }              } @@ -211,9 +200,7 @@ public class ApgCon {                  }              }          } catch (PackageManager.NameNotFoundException e) { -            if (stacktraces) -                e.printStackTrace(); -            Log.e(TAG, "Could not find APG, is it installed?"); +            Log.e(TAG, "Could not find APG, is it installed?", e);              error_list.add("(LOCAL) Could not find APG, is it installed?");              result.putInt(ret.ERROR.name(), error.APG_NOT_FOUND.ordinal());              tmp_connection_status = error.APG_NOT_FOUND; @@ -234,9 +221,7 @@ public class ApgCon {          try {              mContext.bindService(new Intent(IApgService.class.getName()), apgConnection, Context.BIND_AUTO_CREATE);          } catch (Exception e) { -            if (stacktraces) -                e.printStackTrace(); -            Log.v(TAG, "could not bind APG service"); +            Log.e(TAG, "could not bind APG service", e);              return false;          } @@ -365,23 +350,17 @@ public class ApgCon {              warning_list.addAll(pReturn.getStringArrayList(ret.WARNINGS.name()));              return success;          } catch (NoSuchMethodException e) { -            if (stacktraces) -                e.printStackTrace(); -            Log.e(TAG, "Remote call not known (" + function + "): " + e.getMessage()); +            Log.e(TAG, "Remote call not known (" + function + "): " + e.getMessage(), e);              error_list.add("(LOCAL) Remote call not known (" + function + "): " + e.getMessage());              result.putInt(ret.ERROR.name(), error.CALL_NOT_KNOWN.ordinal());              return false;          } catch (InvocationTargetException e) { -            if (stacktraces) -                e.printStackTrace();              Throwable orig = e.getTargetException(); -            Log.w(TAG, "Exception of type '" + orig.getClass() + "' on AIDL call '" + function + "': " + orig.getMessage()); +            Log.w(TAG, "Exception of type '" + orig.getClass() + "' on AIDL call '" + function + "': " + orig.getMessage(), orig);              error_list.add("(LOCAL) Exception of type '" + orig.getClass() + "' on AIDL call '" + function + "': " + orig.getMessage());              return false;          } catch (Exception e) { -            if (stacktraces) -                e.printStackTrace(); -            Log.e(TAG, "Generic error (" + e.getClass() + "): " + e.getMessage()); +            Log.e(TAG, "Generic error (" + e.getClass() + "): " + e.getMessage(), e);              error_list.add("(LOCAL) Generic error (" + e.getClass() + "): " + e.getMessage());              result.putInt(ret.ERROR.name(), error.GENERIC.ordinal());              return false;  | 
