UiSelector support for resource-id wasn't quite right

Change-Id: If97edcbdfc9593977860c9ee1b086adfdf0a49c3
diff --git a/uiautomator/library/core-src/com/android/uiautomator/core/UiSelector.java b/uiautomator/library/core-src/com/android/uiautomator/core/UiSelector.java
index d16aff7..c1ddb32 100644
--- a/uiautomator/library/core-src/com/android/uiautomator/core/UiSelector.java
+++ b/uiautomator/library/core-src/com/android/uiautomator/core/UiSelector.java
@@ -772,7 +772,8 @@
                 }
                 break;
             case UiSelector.SELECTOR_RESOURCE_ID:
-                if (node.getViewIdResourceName() != getString(criterion)) {
+                s = node.getViewIdResourceName();
+                if (s == null || !s.toString().contentEquals(getString(criterion))) {
                     return false;
                 }
                 break;