Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public List<String> getAppStateOnline() {
- List<String> logs = findLogLine(LineType.NETWORK_UNAVAILABLE);
- String str = "Change AppState to stOnline";
- for ( String log : logs )
- {
- if (!log.contains(str))
- {
- logs.remove(log);
- }
- }
- return logs;
- }
- public boolean waitAppSateOnline(int currentSize) {
- try
- {
- Log.off();
- TimeChecker tc = new TimeChecker(20, "Wait for new record \"change appState to Online\"");
- while (!tc.isElapsed()) {
- int totalSize = getAppStateChange().size();
- if (totalSize > currentSize) {
- Log.on();
- return true;
- }
- }
- tc.stop();
- }
- catch (Exception e) {
- Log.write("Cannot get logs count\n", e);
- }
- Log.on();
- Log.warning("After 20 seconds, log records not changed.");
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement