Advertisement
natalia_a

Untitled

Jul 20th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1.  
  2. public List<String> getAppStateOnline() {
  3. List<String> logs = findLogLine(LineType.NETWORK_UNAVAILABLE);
  4. String str = "Change AppState to stOnline";
  5. for ( String log : logs )
  6. {
  7. if (!log.contains(str))
  8. {
  9. logs.remove(log);
  10. }
  11. }
  12. return logs;
  13. }
  14.  
  15. public boolean waitAppSateOnline(int currentSize) {
  16. try
  17. {
  18. Log.off();
  19. TimeChecker tc = new TimeChecker(20, "Wait for new record \"change appState to Online\"");
  20. while (!tc.isElapsed()) {
  21. int totalSize = getAppStateChange().size();
  22. if (totalSize > currentSize) {
  23. Log.on();
  24. return true;
  25. }
  26. }
  27. tc.stop();
  28. }
  29. catch (Exception e) {
  30. Log.write("Cannot get logs count\n", e);
  31. }
  32.  
  33. Log.on();
  34. Log.warning("After 20 seconds, log records not changed.");
  35. return false;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement