package com.alexstyl.specialdates.images;

import android.annotation.TargetApi;
import android.content.ContentResolver;
import android.content.Context;
import android.net.Uri;
import android.os.Build;
import android.provider.ContactsContract;

import com.nostra13.universalimageloader.core.download.BaseImageDownloader;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class ImageDownloader extends BaseImageDownloader {

    public ImageDownloader(Context context) {
        super(context);
    }

    @Override
    public InputStream getStream(String imageUri, Object extra) throws IOException {
        // Collage example
        return super.getStream(imageUri, extra);
    }

    @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
    @Override
    protected InputStream getStreamFromContent(String imageUri, Object extra) throws FileNotFoundException {
        ContentResolver res = context.getContentResolver();
        Uri uri = Uri.parse(imageUri);

        if (imageUri.startsWith("content://com.android.contacts/")) {
            return ContactsContract.Contacts.openContactPhotoInputStream(res, uri, true);
        }

        return res.openInputStream(uri);

    }
}

package com.alexstyl.specialdates.images;

import android.content.ContentResolver;
import android.content.Context;
import android.net.Uri;
import android.provider.ContactsContract;

import com.nostra13.universalimageloader.core.download.BaseImageDownloader;

import java.io.FileNotFoundException;
import java.io.InputStream;

class ImageDownloader extends BaseImageDownloader {

    ImageDownloader(Context context) {
        super(context);
    }

    @Override
    protected InputStream getStreamFromContent(String imageUri, Object extra) throws FileNotFoundException {
        ContentResolver res = context.getContentResolver();
        Uri uri = Uri.parse(imageUri);

        if (imageUri.startsWith("content://com.android.contacts/")) {
            return ContactsContract.Contacts.openContactPhotoInputStream(res, uri, true);
        }

        return res.openInputStream(uri);

    }
}

Remove unused keywords