diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 374c32592..14cbb02d4 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -86,12 +86,12 @@ - + - + diff --git a/src/org/linphone/LinphoneService.java b/src/org/linphone/LinphoneService.java index b94896780..161c6e1fe 100644 --- a/src/org/linphone/LinphoneService.java +++ b/src/org/linphone/LinphoneService.java @@ -69,7 +69,12 @@ public final class LinphoneService extends Service implements LinphoneServiceLis private Handler mHandler = new Handler(); private static LinphoneService instance; - public static boolean isReady() { return (instance!=null); } +// private static boolean mTestDelayElapsed; // add a timer for testing + private static boolean mTestDelayElapsed = true; // no timer + + public static boolean isReady() { + return mTestDelayElapsed && instance!=null; + } /** * @throws RuntimeException service not instantiated @@ -147,6 +152,15 @@ public final class LinphoneService extends Service implements LinphoneServiceLis } startForegroundCompat(NOTIF_ID, mNotif); + + if (!mTestDelayElapsed) { + // Only used when testing. Simulates a 5 seconds delay for launching service + mHandler.postDelayed(new Runnable() { + @Override public void run() { + mTestDelayElapsed = true; + } + }, 5000); + } }