// Path: app/src/main/java/com/murrayc/galaxyzoo/app/provider/Item.java
// public final class Item {
//     public static final String AUTHORITY =
//             "com.murrayc.galaxyzoo.app";
// 
//     /**
//      * The The content:// style URI for the list of all Items,
//      * or part of the URI for a single Item.
//      */
//     public static final Uri ITEMS_URI = Uri.parse("content://" +
//             AUTHORITY + "/" + ItemsContentProvider.URI_PART_ITEM);
// 
//     /**
//      * The URI for the list of all files,
//      * or part of the URI for a single file.
//      * Clients don't need to build a /file/ URI -
//      * they will get a /file/ URI from the Item.Columns.FILE_URI_COLUMN column
//      * in the result from a ITEMS_URI query.
//      */
//     public static final Uri FILE_URI = Uri.parse("content://" +
//             AUTHORITY + "/" + ItemsContentProvider.URI_PART_FILE);
//     public static final String ITEM_URI_PART = ItemsContentProvider.URI_PART_ITEM;
// 
//     public static final class Columns implements BaseColumns {
//         //The ID is BaseColumns._ID;
//         public static final String DONE = "done"; //Integer boolean (1 or 0)
//         public static final String UPLOADED = "uploaded"; //Integer boolean (1 or 0)
//         public static final String SUBJECT_ID = "subjectId";
//         public static final String ZOONIVERSE_ID = "zooniverseId";
//         public static final String GROUP_ID = "groupId";
//         public static final String LOCATION_STANDARD_URI_REMOTE = "locationStandardUriRemote";
//         public static final String LOCATION_STANDARD_URI = "locationStandardUri";
//         public static final String LOCATION_STANDARD_DOWNLOADED = "locationStandardDownloaded"; //Integer boolean (1 or 0)
//         public static final String LOCATION_THUMBNAIL_URI_REMOTE = "locationThumbnailUriRemote";
//         public static final String LOCATION_THUMBNAIL_URI = "locationThumbnailUri";
//         public static final String LOCATION_THUMBNAIL_DOWNLOADED = "locationThumbnailDownloaded"; //Integer boolean (1 or 0)
//         public static final String LOCATION_INVERTED_URI_REMOTE = "locationInvertedUriRemote";
//         public static final String LOCATION_INVERTED_URI = "locationInvertedUri";
//         public static final String LOCATION_INVERTED_DOWNLOADED = "locationInvertedDownloaded"; //Integer boolean (1 or 0)
//         public static final String FAVORITE = "favorite"; //Integer boolean (1 or 0)
//         public static final String DATETIME_DONE = "dateTimeDone"; //An ISO8601 string ("YYYY-MM-DD HH:MM:SS.SSS").
// 
//     }
// }


import android.text.TextUtils;
import com.murrayc.galaxyzoo.app.provider.Item;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.Context;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.test.mock.MockContentResolver;
            connected = true;
        }

        if (!connected) {
            return new NetworkConnected(false, false);
        }

        //Consider us not connected if we should use only wi-fi but don't have wi-fi:
        if (wifiOnly && (networkInfo.getType() != ConnectivityManager.TYPE_WIFI)) {
            return new NetworkConnected(false, true);
        }

        return new NetworkConnected(true, false);
    }

    @Nullable
    public static InputStream openAsset(final Context context, final String filename) {
        try {
            return context.getAssets().open(filename);
        } catch (final IOException e) {
            //Don't log this because we expect the file to not exist sometimes,
            //and the caller will just check for a null result to know that.
            return null;
        }
    }

    public static void abandonItem(final Context context, final String itemId) {
        Log.info("abandonItem(): Abandoning item with itemId=" + itemId);

        final Uri itemUri = ContentUris.withAppendedId(
// Path: app/src/main/java/com/murrayc/galaxyzoo/app/provider/Item.java
// public final class Item {
//     public static final String AUTHORITY =
//             "com.murrayc.galaxyzoo.app";
// 
//     /**
//      * The The content:// style URI for the list of all Items,
//      * or part of the URI for a single Item.
//      */
//     public static final Uri ITEMS_URI = Uri.parse("content://" +
//             AUTHORITY + "/" + ItemsContentProvider.URI_PART_ITEM);
// 
//     /**
//      * The URI for the list of all files,
//      * or part of the URI for a single file.
//      * Clients don't need to build a /file/ URI -
//      * they will get a /file/ URI from the Item.Columns.FILE_URI_COLUMN column
//      * in the result from a ITEMS_URI query.
//      */
//     public static final Uri FILE_URI = Uri.parse("content://" +
//             AUTHORITY + "/" + ItemsContentProvider.URI_PART_FILE);
//     public static final String ITEM_URI_PART = ItemsContentProvider.URI_PART_ITEM;
// 
//     public static final class Columns implements BaseColumns {
//         //The ID is BaseColumns._ID;
//         public static final String DONE = "done"; //Integer boolean (1 or 0)
//         public static final String UPLOADED = "uploaded"; //Integer boolean (1 or 0)
//         public static final String SUBJECT_ID = "subjectId";
//         public static final String ZOONIVERSE_ID = "zooniverseId";
//         public static final String GROUP_ID = "groupId";
//         public static final String LOCATION_STANDARD_URI_REMOTE = "locationStandardUriRemote";
//         public static final String LOCATION_STANDARD_URI = "locationStandardUri";
//         public static final String LOCATION_STANDARD_DOWNLOADED = "locationStandardDownloaded"; //Integer boolean (1 or 0)
//         public static final String LOCATION_THUMBNAIL_URI_REMOTE = "locationThumbnailUriRemote";
//         public static final String LOCATION_THUMBNAIL_URI = "locationThumbnailUri";
//         public static final String LOCATION_THUMBNAIL_DOWNLOADED = "locationThumbnailDownloaded"; //Integer boolean (1 or 0)
//         public static final String LOCATION_INVERTED_URI_REMOTE = "locationInvertedUriRemote";
//         public static final String LOCATION_INVERTED_URI = "locationInvertedUri";
//         public static final String LOCATION_INVERTED_DOWNLOADED = "locationInvertedDownloaded"; //Integer boolean (1 or 0)
//         public static final String FAVORITE = "favorite"; //Integer boolean (1 or 0)
//         public static final String DATETIME_DONE = "dateTimeDone"; //An ISO8601 string ("YYYY-MM-DD HH:MM:SS.SSS").
// 
//     }
// }


// Path: app/src/main/java/com/murrayc/galaxyzoo/app/Utils.java
import android.text.TextUtils;
import com.murrayc.galaxyzoo.app.provider.Item;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.Context;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.test.mock.MockContentResolver;

            connected = true;
        }

        if (!connected) {
            return new NetworkConnected(false, false);
        }

        //Consider us not connected if we should use only wi-fi but don't have wi-fi:
        if (wifiOnly && (networkInfo.getType() != ConnectivityManager.TYPE_WIFI)) {
            return new NetworkConnected(false, true);
        }

        return new NetworkConnected(true, false);
    }

    @Nullable
    public static InputStream openAsset(final Context context, final String filename) {
        try {
            return context.getAssets().open(filename);
        } catch (final IOException e) {
            //Don't log this because we expect the file to not exist sometimes,
            //and the caller will just check for a null result to know that.
            return null;
        }
    }

    public static void abandonItem(final Context context, final String itemId) {
        Log.info("abandonItem(): Abandoning item with itemId=" + itemId);

        final Uri itemUri = ContentUris.withAppendedId(
                Item.ITEMS_URI, Integer.parseInt(itemId));