Add a new error code for App Indexing Plugin

Add a new error code and the corresponding message.
and adjust one error code handling logic.

Test: NA
Change-Id: If98463bf57c9762ef457f538a7824144e88f7a82
(cherry picked from commit 623c02e1530771bc1f2ec8214393be792c86151d)
diff --git a/resources/messages/AppIndexingBundle.properties b/resources/messages/AppIndexingBundle.properties
index 73ac6e4..a063285 100644
--- a/resources/messages/AppIndexingBundle.properties
+++ b/resources/messages/AppIndexingBundle.properties
@@ -9,7 +9,7 @@
 app.indexing.fetch.as.google.test.error.NEED_SIGNIN=Please sign in
 app.indexing.fetch.as.google.test.error.NETWORK_ERROR=Network error. Please try again later.
 app.indexing.fetch.as.google.test.error.BACKEND_ERROR=Sorry, please try again later.  We’re currently unable to check for errors in your latest released apk version.
-app.indexing.fetch.as.google.test.error.NOT_FOUND=Data not found
+app.indexing.fetch.as.google.test.error.NOT_FOUND=No errors found
 app.indexing.fetch.as.google.test.error.RESOURCE_EXHAUSTED=Sorry, please try again later.  We’re currently unable to check for errors in your latest released apk version.
 app.indexing.fetch.as.google.test.error.URI_NOT_SUPPORTED=App URLs are not supported. Make sure your Android manifest uses HTTP URLs and intent filters to reach specific content inside your app
 app.indexing.fetch.as.google.test.error.UNKNOWN_URL=Google can't find your URL in the index. Check for correct formatting and provide at least one HTTP/HTTPS scheme URL
@@ -18,6 +18,7 @@
 app.indexing.fetch.as.google.test.error.EMPTY_PACKAGE_ID=Cannot get package ID, please make sure you selected the correct module.
 app.indexing.fetch.as.google.test.error.BLACKLISTED_URL=URL removed from index. We typically do this when users can't find what what they are looking for on your app page.
 app.indexing.fetch.as.google.test.error.URL_INDEX_ERROR=Google did not index the URL due to an error
+app.indexing.fetch.as.google.test.error.APP_OWNERSHIP_VERIFICATION_FAILED=We couldn't verify your ownership of this app. Check you're the owner of the app and your app is published to Google Play.
 app.indexing.fetch.as.google.test.error.USER_ACTION_LOGGING_ERROR=USER_ACTION_ME
 app.indexing.fetch.as.google.test.error.PERSONAL_CONTENT_INDEXING_ERROR=PERSONAL_CONTENT_ME
 app.indexing.fetch.as.google.test.error.OK=OK
diff --git a/src/com/google/appindexing/fetchasgoogle/FetchAsGoogleTask.java b/src/com/google/appindexing/fetchasgoogle/FetchAsGoogleTask.java
index 41853dc..972b933 100644
--- a/src/com/google/appindexing/fetchasgoogle/FetchAsGoogleTask.java
+++ b/src/com/google/appindexing/fetchasgoogle/FetchAsGoogleTask.java
@@ -118,6 +118,7 @@
     BACKEND_ERROR,
     RESOURCE_EXHAUSTED,
     NOT_FOUND,
+    APP_OWNERSHIP_VERIFICATION_FAILED,
     OK;
 
     private final String message;
diff --git a/src/com/google/appindexing/ui/AppIndexingResultPanel.java b/src/com/google/appindexing/ui/AppIndexingResultPanel.java
index 86b9953..9795db4 100644
--- a/src/com/google/appindexing/ui/AppIndexingResultPanel.java
+++ b/src/com/google/appindexing/ui/AppIndexingResultPanel.java
@@ -109,12 +109,15 @@
       case USER_ACTION_LOGGING_DEBUGGING:
       case PERSONAL_CONTENT_INDEXING_DEBUGGING:
         if (errorCode == null ||
-            errorCode.equals(FetchAsGoogleTask.ErrorCode.NOT_FOUND) ||
             errorCode.equals(FetchAsGoogleTask.ErrorCode.OK)) {
           handleAppIndexingStats();
         }
         else {
           switch (errorCode) {
+            case NOT_FOUND:
+              addCollapsablePanel(AllIcons.RunConfigurations.TestPassed, errorCode.name(), errorCode.getMessage());
+              break;
+            case APP_OWNERSHIP_VERIFICATION_FAILED:
             case BACKEND_ERROR:
             case RESOURCE_EXHAUSTED:
               addCollapsablePanel(AllIcons.RunConfigurations.TestError, errorCode.name(), errorCode.getMessage());
@@ -136,8 +139,8 @@
       return;
     }
     if (StringUtil.isEmpty(myTask.getFetchResponse().getAppVersion())) {
-      FetchAsGoogleTask.ErrorCode errorCode = FetchAsGoogleTask.ErrorCode.APK_NOT_FOUND;
-      addCollapsablePanel(AllIcons.RunConfigurations.TestError, errorCode.name(), errorCode.getMessage());
+      addCollapsablePanel(AllIcons.RunConfigurations.TestError, FetchAsGoogleTask.ErrorCode.APK_NOT_FOUND.name(),
+                          FetchAsGoogleTask.ErrorCode.APK_NOT_FOUND.getMessage());
       return;
     }
     List<AppIndexingStats> stats = myTask.getFetchResponse().getStats();