blob: 045dde45d848d8f304be5059bf7eb33023f1321c [file] [log] [blame]
package test.pkg;
import android.annotation.TargetApi;
import android.graphics.Bitmap;
import android.os.Build;
public class TargetApiTest {
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
public static String getCompressFormatMimeType(Bitmap.CompressFormat format) {
switch (format) {
case JPEG:
return "image/jpeg";
case PNG:
return "image/png";
case WEBP:
return "image/webp";
}
// Unreachable
throw new IllegalArgumentException("Unexpected CompressFormat: " + format);
}
}