From 948a9396d4034560c8d16e04197bc24d040440b8 Mon Sep 17 00:00:00 2001 From: henry Date: Wed, 4 Oct 2017 22:04:42 -0400 Subject: [PATCH] network and internet permission minor fixed in generators response --- app/src/main/AndroidManifest.xml | 2 ++ .../crystalwallet/apigenerator/GrapheneApiGenerator.java | 8 +++++++- .../crystalwallet/manager/BitsharesAccountManager.java | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index dd7ab54..053e50d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,6 +1,8 @@ + + 0) { if (list.get(0).getClass() == AccountProperties.class) { request.getListener().success(list.get(0),request.getId()); + return; //TODO answer a crystal model } } } + System.out.println("ERROR : " + response.result); request.getListener().fail(request.getId()); } @@ -63,6 +65,7 @@ public class GrapheneApiGenerator { })); Thread thread = new Thread(){ public void run(){ + android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_BACKGROUND); try { webSocket.connect(); } catch (WebSocketException e) { @@ -108,6 +111,7 @@ public class GrapheneApiGenerator { })); Thread thread = new Thread(){ public void run(){ + android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_BACKGROUND); try { webSocket.connect(); } catch (WebSocketException e) { @@ -150,6 +154,7 @@ public class GrapheneApiGenerator { })); Thread thread = new Thread(){ public void run(){ + android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_BACKGROUND); try { webSocket.connect(); } catch (WebSocketException e) { @@ -179,7 +184,7 @@ public class GrapheneApiGenerator { @Override public void onSuccess(WitnessResponse response) { AccountProperties accountProperties = ((WitnessResponse) response).result; - if(accountProperties != null){ + if(accountProperties == null){ request.getListener().success(null,request.getId()); }else{ request.getListener().success(accountProperties.id,request.getId()); @@ -193,6 +198,7 @@ public class GrapheneApiGenerator { })); Thread thread = new Thread(){ public void run(){ + android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_BACKGROUND); try { webSocket.connect(); } catch (WebSocketException e) { diff --git a/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java b/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java index 9b6698a..d7890e8 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java +++ b/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java @@ -34,6 +34,7 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI @Override public void onNewRequest(CryptoNetInfoRequest request) { if (request instanceof ValidateImportBitsharesAccountRequest){ + final ValidateImportBitsharesAccountRequest importRequest = (ValidateImportBitsharesAccountRequest) request; ApiRequest checkAccountName = new ApiRequest(0, new ApiRequestListener() { @Override