From 5138233896b5f0e2d2c85129b4b13db143777001 Mon Sep 17 00:00:00 2001 From: Larry Sachs Date: Wed, 2 Nov 2016 12:19:07 -0700 Subject: [PATCH] Add delay before OcPlatform.startPresence(). Added a two second delay before calling OcPlatform.startPresence() on the server side. This gives the client side ample time to have the presence listener in place for expected good behavior. Change-Id: I0bc63b157c756abb510c3e2fb9651c3e14503b31 Signed-off-by: Larry Sachs Reviewed-on: https://gerrit.iotivity.org/gerrit/13971 Tested-by: jenkins-iotivity Reviewed-by: George Nash Reviewed-by: Rick Bell --- .../base/src/androidTest/java/org/iotivity/base/SmokeTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/android/android_api/base/src/androidTest/java/org/iotivity/base/SmokeTest.java b/android/android_api/base/src/androidTest/java/org/iotivity/base/SmokeTest.java index 0c26ab3..7668d77 100644 --- a/android/android_api/base/src/androidTest/java/org/iotivity/base/SmokeTest.java +++ b/android/android_api/base/src/androidTest/java/org/iotivity/base/SmokeTest.java @@ -186,6 +186,13 @@ public class SmokeTest extends InstrumentationTestCase { resourceFoundListener); //server + //wait 2 seconds for the client's resourceFoundListener to set the presenceListener. + //the presenceListener must be set before startPresence() is called to get notified. + try { + Thread.sleep(2000); + } catch (InterruptedException e) { + Log.e(TAG, e.getMessage()); + } OcPlatform.startPresence(OcPlatform.DEFAULT_PRESENCE_TTL); //wait for onPresence event -- 2.7.4