AETHER-1126 Actively check the connection state than sleeping

Change-Id: I1cd8cb7cc4a28e43928e51c52454e459648aaf6b
diff --git a/edge-monitoring/agent_adb/edge_monitoring_agent_adb.py b/edge-monitoring/agent_adb/edge_monitoring_agent_adb.py
index 86c05d5..b0b258f 100755
--- a/edge-monitoring/agent_adb/edge_monitoring_agent_adb.py
+++ b/edge-monitoring/agent_adb/edge_monitoring_agent_adb.py
@@ -108,16 +108,17 @@
         if not success:
             return State.error, result
 
-    # additional wait for UE to fully attach
-    time.sleep(3)
-
     # get connection state
     state = State.connecting.value
-    while state == State.connecting.value:
+    retry_count = 10
+    while retry_count > 0:
         success, result = _run_adb_shell(adb, ADB_GET_COMMANDS['lte_state'])
         if not success or result is None:
-            return State.error, result
+            continue
         state = result.split("=")[1]
+        if state == State.connected.value:
+            break
+        retry_count -= 1
 
     if not State.has_value(state):
         return State.error, None