Remove the hasImage API until we have the rest of the required traits available.

b/19435491

Change-Id: I2533aa2c980f6aaa16bbef508d0fc83528bd1cfd
diff --git a/compat/api/current.txt b/compat/api/current.txt
index 0b99a33..4fb3b60 100644
--- a/compat/api/current.txt
+++ b/compat/api/current.txt
@@ -1665,7 +1665,6 @@
     method public java.lang.String getViewIdResourceName();
     method public android.support.v4.view.accessibility.AccessibilityWindowInfoCompat getWindow();
     method public int getWindowId();
-    method public boolean hasImage();
     method public boolean isAccessibilityFocused();
     method public boolean isCheckable();
     method public boolean isChecked();
@@ -1711,7 +1710,6 @@
     method public void setError(java.lang.CharSequence);
     method public void setFocusable(boolean);
     method public void setFocused(boolean);
-    method public void setHasImage(boolean);
     method public void setInputType(int);
     method public void setLabelFor(android.view.View);
     method public void setLabelFor(android.view.View, int);
diff --git a/compat/ics/android/support/v4/view/accessibility/AccessibilityNodeInfoCompatIcs.java b/compat/ics/android/support/v4/view/accessibility/AccessibilityNodeInfoCompatIcs.java
index a3428f4..d7d0556 100644
--- a/compat/ics/android/support/v4/view/accessibility/AccessibilityNodeInfoCompatIcs.java
+++ b/compat/ics/android/support/v4/view/accessibility/AccessibilityNodeInfoCompatIcs.java
@@ -98,13 +98,6 @@
         return ((AccessibilityNodeInfo) info).getWindowId();
     }
 
-    public static boolean hasImage(Object info) {
-        CharSequence className = getClassName(info);
-        return (!TextUtils.isEmpty(className) &&
-                (className.equals("android.widget.ImageButton") ||
-                 className.equals("android.widget.ImageView")));
-    }
-
     public static boolean isCheckable(Object info) {
         return ((AccessibilityNodeInfo) info).isCheckable();
     }
diff --git a/compat/java/android/support/v4/view/accessibility/AccessibilityNodeInfoCompat.java b/compat/java/android/support/v4/view/accessibility/AccessibilityNodeInfoCompat.java
index 858ebde..b894ad8 100644
--- a/compat/java/android/support/v4/view/accessibility/AccessibilityNodeInfoCompat.java
+++ b/compat/java/android/support/v4/view/accessibility/AccessibilityNodeInfoCompat.java
@@ -520,8 +520,6 @@
         public void setBoundsInParent(Object info, Rect bounds);
         public void getBoundsInScreen(Object info, Rect outBounds);
         public void setBoundsInScreen(Object info, Rect bounds);
-        public boolean hasImage(Object info);
-        public void setHasImage(Object info, boolean hasImage);
         public boolean isCheckable(Object info);
         public void setCheckable(Object info, boolean checkable);
         public boolean isChecked(Object info);
@@ -750,16 +748,6 @@
         }
 
         @Override
-        public boolean hasImage(Object info) {
-            return false;
-        }
-
-        @Override
-        public void setHasImage(Object info, boolean hasImage) {
-
-        }
-
-        @Override
         public boolean isCheckable(Object info) {
             return false;
         }
@@ -1328,11 +1316,6 @@
         }
 
         @Override
-        public boolean hasImage(Object info) {
-            return AccessibilityNodeInfoCompatIcs.hasImage(info);
-        }
-
-        @Override
         public boolean isCheckable(Object info) {
             return AccessibilityNodeInfoCompatIcs.isCheckable(info);
         }
@@ -1398,10 +1381,6 @@
         }
 
         @Override
-        public void setHasImage(Object info, boolean hasImage) {
-        }
-
-        @Override
         public void setCheckable(Object info, boolean checkable) {
             AccessibilityNodeInfoCompatIcs.setCheckable(info, checkable);
         }
@@ -1768,16 +1747,6 @@
         }
 
         @Override
-        public boolean hasImage(Object info) {
-            return AccessibilityNodeInfoCompatKitKat.hasImage(info);
-        }
-
-        @Override
-        public void setHasImage(Object info, boolean hasImage) {
-            AccessibilityNodeInfoCompatKitKat.setHasImage(info, hasImage);
-        }
-
-        @Override
         public boolean isDismissable(Object info) {
             return AccessibilityNodeInfoCompatKitKat.isDismissable(info);
         }
@@ -2766,38 +2735,6 @@
     }
 
     /**
-     * Gets whether this node is has an image.
-     *
-     * If the platform support this trait natively, it will always return the
-     * value from the node.
-     * If it's not supported natively and the platform is KitKat or higher,
-     * it will return the value that was explicitely set.
-     * If the platform is pre-KitKat or the value has not been explicitely set,
-     * the value will be derived based on whether the classname is a framework
-     * class that is derived from android.widget.ImageView.
-     *
-     * @return True if the node has an image.
-     */
-    public boolean hasImage() {
-        return IMPL.hasImage(mInfo);
-    }
-
-    /**
-     * Sets whether this node has an image.
-     * <p>
-     * <strong>Note:</strong> Cannot be called from an
-     * {@link android.accessibilityservice.AccessibilityService}. This class is
-     * made immutable before being delivered to an AccessibilityService.
-     * </p>
-     *
-     * @param hasImage True if the node has an image.
-     * @throws IllegalStateException If called from an AccessibilityService.
-     */
-    public void setHasImage(boolean hasImage) {
-        IMPL.setHasImage(mInfo, hasImage);
-    }
-
-    /**
      * Gets whether this node is checkable.
      *
      * @return True if the node is checkable.
@@ -3935,7 +3872,6 @@
         builder.append("; contentDescription: ").append(getContentDescription());
         builder.append("; viewId: ").append(getViewIdResourceName());
 
-        builder.append("; hasImage: ").append(hasImage());
         builder.append("; checkable: ").append(isCheckable());
         builder.append("; checked: ").append(isChecked());
         builder.append("; focusable: ").append(isFocusable());
diff --git a/compat/kitkat/android/support/v4/view/accessibility/AccessibilityNodeInfoCompatKitKat.java b/compat/kitkat/android/support/v4/view/accessibility/AccessibilityNodeInfoCompatKitKat.java
index f8f37fd..3bb827e 100644
--- a/compat/kitkat/android/support/v4/view/accessibility/AccessibilityNodeInfoCompatKitKat.java
+++ b/compat/kitkat/android/support/v4/view/accessibility/AccessibilityNodeInfoCompatKitKat.java
@@ -113,19 +113,6 @@
         ((AccessibilityNodeInfo) info).setInputType(inputType);
     }
 
-    public static boolean hasImage(Object info) {
-        long traits = getTraits(info);
-        if (traits == TRAIT_UNSET) {
-            return AccessibilityNodeInfoCompatIcs.hasImage(info);
-        } else {
-            return (traits & TRAIT_HAS_IMAGE) != 0;
-        }
-    }
-
-    public static void setHasImage(Object info, boolean hasImage) {
-        setTrait(info, TRAIT_HAS_IMAGE);
-    }
-
     public static boolean isDismissable(Object info) {
         return ((AccessibilityNodeInfo) info).isDismissable();
     }