Loading src/main/java/com/nextcloud/android/sso/AccountImporter.java +4 −5 Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ public class AccountImporter { public static final int CHOOSE_ACCOUNT_SSO = 4242; public static final int REQUEST_AUTH_TOKEN_SSO = 4243; public static boolean AccountsToImportAvailable(Context context) { public static boolean accountsToImportAvailable(Context context) { return findAccounts(context).size() > 0; } Loading Loading @@ -96,7 +96,7 @@ public class AccountImporter { List<Account> accountsAvailable = new ArrayList<>(); for (final Account account : accounts) { if (account.type.equals("nextcloud")) { if ("nextcloud".equals(account.type)) { accountsAvailable.add(account); } } Loading Loading @@ -131,10 +131,9 @@ public class AccountImporter { try { return SingleSignOnAccount.fromString(mPrefs.getString(prefKey, null)); } catch (ClassNotFoundException e) { Log.e(TAG, "This should never happen!"); e.printStackTrace(); Log.e(TAG, "[getSingleSignOnAccount] ClassNotFound", e); } catch (IOException e) { e.printStackTrace(); Log.e(TAG, "[getSingleSignOnAccount]", e); } } throw new NextcloudFilesAppAccountNotFoundException(); Loading src/main/java/com/nextcloud/android/sso/aidl/ParcelFileDescriptorUtil.java +5 −4 Original line number Diff line number Diff line Loading @@ -28,6 +28,8 @@ import java.io.OutputStream; public class ParcelFileDescriptorUtil { private ParcelFileDescriptorUtil() { } public static ParcelFileDescriptor pipeFrom(InputStream inputStream, IThreadListener listener) throws IOException { ParcelFileDescriptor[] pipe = ParcelFileDescriptor.createPipe(); Loading Loading @@ -80,18 +82,17 @@ public class ParcelFileDescriptorUtil { } mOut.flush(); // just to be safe } catch (IOException e) { Log.e("TransferThread", "writing failed"); e.printStackTrace(); Log.e("TransferThread", "writing failed", e); } finally { try { mIn.close(); } catch (IOException e) { e.printStackTrace(); Log.e("TransferThread", "closing 'in' failed", e); } try { mOut.close(); } catch (IOException e) { e.printStackTrace(); Log.e("TransferThread", "closing 'out' failed", e); } } if (mListener != null) Loading src/main/java/com/nextcloud/android/sso/api/NextcloudRetrofitServiceMethod.java +0 −2 Original line number Diff line number Diff line Loading @@ -21,10 +21,8 @@ import java.lang.reflect.Type; import java.security.InvalidParameterException; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; Loading src/main/java/com/nextcloud/android/sso/helper/AsyncTaskHelper.java +8 −2 Original line number Diff line number Diff line Loading @@ -27,14 +27,16 @@ import java.util.concurrent.Callable; public class AsyncTaskHelper { private AsyncTaskHelper() { } @RequiresApi(api = Build.VERSION_CODES.HONEYCOMB) public static <T> T ExecuteBlockingRequest(Callable<T> callable) throws Exception { GenericAsyncTaskWithCallable<T> at = new GenericAsyncTaskWithCallable<>(callable); T result = at.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR).get(); if (at.exception != null) { throw at.exception; if (at.getException() != null) { throw at.getException(); } return result; Loading @@ -58,6 +60,10 @@ public class AsyncTaskHelper { return null; } } private Exception getException() { return exception; } } } src/main/java/com/nextcloud/android/sso/helper/Okhttp3Helper.java +0 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ public final class Okhttp3Helper { return ResponseBody.create(null, 0, new BufferedSourceSSO(os)); } catch (Exception e) { Log.e(TAG, "[getResponseBodyFromRequest] encountered a problem", e); e.printStackTrace(); } return ResponseBody.create(null, ""); } Loading Loading
src/main/java/com/nextcloud/android/sso/AccountImporter.java +4 −5 Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ public class AccountImporter { public static final int CHOOSE_ACCOUNT_SSO = 4242; public static final int REQUEST_AUTH_TOKEN_SSO = 4243; public static boolean AccountsToImportAvailable(Context context) { public static boolean accountsToImportAvailable(Context context) { return findAccounts(context).size() > 0; } Loading Loading @@ -96,7 +96,7 @@ public class AccountImporter { List<Account> accountsAvailable = new ArrayList<>(); for (final Account account : accounts) { if (account.type.equals("nextcloud")) { if ("nextcloud".equals(account.type)) { accountsAvailable.add(account); } } Loading Loading @@ -131,10 +131,9 @@ public class AccountImporter { try { return SingleSignOnAccount.fromString(mPrefs.getString(prefKey, null)); } catch (ClassNotFoundException e) { Log.e(TAG, "This should never happen!"); e.printStackTrace(); Log.e(TAG, "[getSingleSignOnAccount] ClassNotFound", e); } catch (IOException e) { e.printStackTrace(); Log.e(TAG, "[getSingleSignOnAccount]", e); } } throw new NextcloudFilesAppAccountNotFoundException(); Loading
src/main/java/com/nextcloud/android/sso/aidl/ParcelFileDescriptorUtil.java +5 −4 Original line number Diff line number Diff line Loading @@ -28,6 +28,8 @@ import java.io.OutputStream; public class ParcelFileDescriptorUtil { private ParcelFileDescriptorUtil() { } public static ParcelFileDescriptor pipeFrom(InputStream inputStream, IThreadListener listener) throws IOException { ParcelFileDescriptor[] pipe = ParcelFileDescriptor.createPipe(); Loading Loading @@ -80,18 +82,17 @@ public class ParcelFileDescriptorUtil { } mOut.flush(); // just to be safe } catch (IOException e) { Log.e("TransferThread", "writing failed"); e.printStackTrace(); Log.e("TransferThread", "writing failed", e); } finally { try { mIn.close(); } catch (IOException e) { e.printStackTrace(); Log.e("TransferThread", "closing 'in' failed", e); } try { mOut.close(); } catch (IOException e) { e.printStackTrace(); Log.e("TransferThread", "closing 'out' failed", e); } } if (mListener != null) Loading
src/main/java/com/nextcloud/android/sso/api/NextcloudRetrofitServiceMethod.java +0 −2 Original line number Diff line number Diff line Loading @@ -21,10 +21,8 @@ import java.lang.reflect.Type; import java.security.InvalidParameterException; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; Loading
src/main/java/com/nextcloud/android/sso/helper/AsyncTaskHelper.java +8 −2 Original line number Diff line number Diff line Loading @@ -27,14 +27,16 @@ import java.util.concurrent.Callable; public class AsyncTaskHelper { private AsyncTaskHelper() { } @RequiresApi(api = Build.VERSION_CODES.HONEYCOMB) public static <T> T ExecuteBlockingRequest(Callable<T> callable) throws Exception { GenericAsyncTaskWithCallable<T> at = new GenericAsyncTaskWithCallable<>(callable); T result = at.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR).get(); if (at.exception != null) { throw at.exception; if (at.getException() != null) { throw at.getException(); } return result; Loading @@ -58,6 +60,10 @@ public class AsyncTaskHelper { return null; } } private Exception getException() { return exception; } } }
src/main/java/com/nextcloud/android/sso/helper/Okhttp3Helper.java +0 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ public final class Okhttp3Helper { return ResponseBody.create(null, 0, new BufferedSourceSSO(os)); } catch (Exception e) { Log.e(TAG, "[getResponseBodyFromRequest] encountered a problem", e); e.printStackTrace(); } return ResponseBody.create(null, ""); } Loading