Snap for 10900817 from 8cb73037aaf2e293f72651939f999b375a06498f to sdk-release

Change-Id: If75546b04507207b9f1c1a3292a11ffc0c5906ab
diff --git a/suspend/1.0/default/SuspendSepolicyTests.sh b/suspend/1.0/default/SuspendSepolicyTests.sh
index b40f798..0dd2a3e 100755
--- a/suspend/1.0/default/SuspendSepolicyTests.sh
+++ b/suspend/1.0/default/SuspendSepolicyTests.sh
@@ -49,13 +49,15 @@
 
 get_unlabeled_wakeup_paths() {
     for path in ${wakeup_paths[@]}; do
+        wakeup_path="$path"
+        has_wakeup_attr "$wakeup_path" && continue
+
         # If there exists a common wakeup parent directory, label that instead
         # of each wakeupN directory
-        wakeup_path="$path"
         dir_path="$(dirname $path)"
         [ "$(basename $dir_path)" == "wakeup" ] && wakeup_path="$dir_path"
-        has_wakeup_attr "$wakeup_path" || check_wakeup_dup $wakeup_path \
-            || unlabeled_paths+=( $wakeup_path )
+
+        check_wakeup_dup $wakeup_path || unlabeled_paths+=( $wakeup_path )
     done
 }
 
diff --git a/suspend/1.0/default/WakeLockEntryList.cpp b/suspend/1.0/default/WakeLockEntryList.cpp
index a5b1de5..3c7fa3b 100644
--- a/suspend/1.0/default/WakeLockEntryList.cpp
+++ b/suspend/1.0/default/WakeLockEntryList.cpp
@@ -247,6 +247,7 @@
                 TEMP_FAILURE_RETRY(openat(wakelockFd, statName.c_str(), O_CLOEXEC | O_RDONLY))};
             if (statFd < 0) {
                 PLOG(ERROR) << "Error opening " << statName << " for " << kwlId;
+                continue;
             }
 
             std::string valStr;