From 7e05701abe7f295b17e99c272a042c0c4790a87f Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Thu, 21 Feb 2013 11:52:00 +0100 Subject: [PATCH] Add return value for RemoteProvisioning --- src/org/linphone/RemoteProvisioning.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/org/linphone/RemoteProvisioning.java b/src/org/linphone/RemoteProvisioning.java index 125dc5bcf..c44af7ad2 100644 --- a/src/org/linphone/RemoteProvisioning.java +++ b/src/org/linphone/RemoteProvisioning.java @@ -19,6 +19,7 @@ public class RemoteProvisioning { String mRPAddress; String mSchema; String mLocalLP; + boolean value; public RemoteProvisioningThread(final String RPAddress, final String LocalLP, final String schema) { this.mRPAddress = RPAddress; @@ -28,6 +29,7 @@ public class RemoteProvisioning { public void run() { try { + value = false; Log.i("Download remote provisioning file from " + mRPAddress); URL url = new URL(mRPAddress); URLConnection ucon = url.openConnection(); @@ -68,6 +70,7 @@ public class RemoteProvisioning { } else { lp.sync(); } + value = true; Log.i("Remote provisioning ok"); } catch (MalformedURLException e) { Log.e("Invalid remote provisioning url: " + e.getLocalizedMessage()); @@ -81,7 +84,7 @@ public class RemoteProvisioning { } }; - static void download(String address, String lpfile, boolean check) { + static boolean download(String address, String lpfile, boolean check) { try { String schema = null; if(check) { @@ -92,13 +95,15 @@ public class RemoteProvisioning { thread.start(); thread.wait(); } + return thread.value; } catch (InterruptedException e) { Log.e(e); } + return false; } - static void download(String address, String lpfile) { - download(address, lpfile, true); + static boolean download(String address, String lpfile) { + return download(address, lpfile, true); } static boolean isAvailable() {