Merge "Adding "@" to google.com email check"
diff --git a/src/main/java/com/android/vts/servlet/ShowGreenReleaseServlet.java b/src/main/java/com/android/vts/servlet/ShowGreenReleaseServlet.java
index 8d03224..b4c3a09 100644
--- a/src/main/java/com/android/vts/servlet/ShowGreenReleaseServlet.java
+++ b/src/main/java/com/android/vts/servlet/ShowGreenReleaseServlet.java
@@ -244,7 +244,6 @@
                     {{
                         put("branch", new String[]{branchKey});
                         put("device", new String[]{deviceBuildInfo.getDeviceBuildTarget()});
-                        put("nonpassing", new String[]{"0"});
                     }};
 
                     Calendar cal = Calendar.getInstance();
@@ -252,9 +251,6 @@
                     Long startTime = cal.getTime().getTime() * 1000;
                     Long endTime = Calendar.getInstance().getTime().getTime() * 1000;
 
-                    logger.log(Level.INFO, "startTime => " + startTime);
-                    logger.log(Level.INFO, "endTime => " + endTime);
-
                     SortDirection dir = SortDirection.DESCENDING;
 
                     boolean unfiltered = false;
@@ -294,12 +290,6 @@
                             testPlanRunEntityList
                         );
 
-                        // The passBuildIdList containing all passed buildId List for device
-                        List<String> passBuildIdList = testPlanRunEntityList.stream()
-                            .map(entity -> entity.testBuildId)
-                            .collect(Collectors.toList());
-                        allPassIdLists.add(passBuildIdList);
-
                         // The logic for candidate build ID is starting from here
                         Comparator<TestPlanRunEntity> byPassing = Comparator
                             .comparingLong(elemFirst -> elemFirst.passCount);
@@ -318,6 +308,13 @@
                             return entity.startTimestamp;
                         }).orElse(0L);
                         deviceBuildInfo.setCandidateBuildIdTimestamp(buildIdTimestamp);
+
+                        // The passBuildIdList containing all passed buildId List for device
+                        List<String> passBuildIdList = testPlanRunEntityList.stream()
+                            .filter(entity -> entity.failCount == 0L)
+                            .map(entity -> entity.testBuildId)
+                            .collect(Collectors.toList());
+                        allPassIdLists.add(passBuildIdList);
                         logger.log(Level.INFO, "passBuildIdList => " + passBuildIdList);
                     } else {
                         allPassIdLists.add(new ArrayList<>());