package org.robolectric.shadows;

import android.graphics.Bitmap;
import android.graphics.drawable.Icon;
import android.net.Uri;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
import org.robolectric.annotation.RealObject;

import static org.robolectric.internal.Shadow.directlyOn;

/**
 * Shadow for {@link android.graphics.drawable.Icon}.
 */
@SuppressWarnings({"UnusedDeclaration"})
@Implements(Icon.class)
public class ShadowIcon {

  @RealObject
  private Icon realIcon;

  @Implementation
  public int getType() {
    return directlyOn(realIcon, Icon.class, "getType");
  }

  @Implementation
  public int getResId() {
    return directlyOn(realIcon, Icon.class, "getResId");
  }

  @Implementation
  public Bitmap getBitmap() {
    return directlyOn(realIcon, Icon.class, "getBitmap");
  }

  @Implementation
  public Uri getUri() {
    return directlyOn(realIcon, Icon.class, "getUri");
  }

  @Implementation
  public int getDataLength() {
    return directlyOn(realIcon, Icon.class, "getDataLength");
  }

  @Implementation
  public int getDataOffset() {
    return directlyOn(realIcon, Icon.class, "getDataOffset");
  }

  @Implementation
  public byte[] getDataBytes() {
    return directlyOn(realIcon, Icon.class, "getDataBytes");
  }
}

@@ -122,16 +122,41 @@
 et.Uri;%0A
+import android.os.Build;%0A
 import o
@@ -193,24 +193,24 @@
 ementation;%0A
-
 import org.r
@@ -290,16 +290,64 @@
 bject;%0A%0A
+import static android.os.Build.VERSION_CODES.M;%0A
 import s
@@ -512,16 +512,24 @@
 lements(
+value = 
 Icon.cla
@@ -530,16 +530,28 @@
 on.class
+, minSdk = M
 )%0Apublic

Add minSdk to ShadowIcon.