// Path: src/edu/bupt/calendar/AsyncQueryServiceHelper.java
// protected static class OperationInfo implements Delayed{
//     public int token; // Used for cancel
//     public int op;
//     public ContentResolver resolver;
//     public Uri uri;
//     public String authority;
//     public Handler handler;
//     public String[] projection;
//     public String selection;
//     public String[] selectionArgs;
//     public String orderBy;
//     public Object result;
//     public Object cookie;
//     public ContentValues values;
//     public ArrayList<ContentProviderOperation> cpo;
// 
//     /**
//      * delayMillis is relative time e.g. 10,000 milliseconds
//      */
//     public long delayMillis;
// 
//     /**
//      * scheduleTimeMillis is the time scheduled for this to be processed.
//      * e.g. SystemClock.elapsedRealtime() + 10,000 milliseconds Based on
//      * {@link android.os.SystemClock#elapsedRealtime }
//      */
//     private long mScheduledTimeMillis = 0;
// 
//     // @VisibleForTesting
//     void calculateScheduledTime() {
//         mScheduledTimeMillis = SystemClock.elapsedRealtime() + delayMillis;
//     }
// 
//     // @Override // Uncomment with Java6
//     public long getDelay(TimeUnit unit) {
//         return unit.convert(mScheduledTimeMillis - SystemClock.elapsedRealtime(),
//                 TimeUnit.MILLISECONDS);
//     }
// 
//     // @Override // Uncomment with Java6
//     public int compareTo(Delayed another) {
//         OperationInfo anotherArgs = (OperationInfo) another;
//         if (this.mScheduledTimeMillis == anotherArgs.mScheduledTimeMillis) {
//             return 0;
//         } else if (this.mScheduledTimeMillis < anotherArgs.mScheduledTimeMillis) {
//             return -1;
//         } else {
//             return 1;
//         }
//     }
// 
//     @Override
//     public String toString() {
//         StringBuilder builder = new StringBuilder();
//         builder.append("OperationInfo [\n\t token= ");
//         builder.append(token);
//         builder.append(",\n\t op= ");
//         builder.append(Operation.opToChar(op));
//         builder.append(",\n\t uri= ");
//         builder.append(uri);
//         builder.append(",\n\t authority= ");
//         builder.append(authority);
//         builder.append(",\n\t delayMillis= ");
//         builder.append(delayMillis);
//         builder.append(",\n\t mScheduledTimeMillis= ");
//         builder.append(mScheduledTimeMillis);
//         builder.append(",\n\t resolver= ");
//         builder.append(resolver);
//         builder.append(",\n\t handler= ");
//         builder.append(handler);
//         builder.append(",\n\t projection= ");
//         builder.append(Arrays.toString(projection));
//         builder.append(",\n\t selection= ");
//         builder.append(selection);
//         builder.append(",\n\t selectionArgs= ");
//         builder.append(Arrays.toString(selectionArgs));
//         builder.append(",\n\t orderBy= ");
//         builder.append(orderBy);
//         builder.append(",\n\t result= ");
//         builder.append(result);
//         builder.append(",\n\t cookie= ");
//         builder.append(cookie);
//         builder.append(",\n\t values= ");
//         builder.append(values);
//         builder.append(",\n\t cpo= ");
//         builder.append(cpo);
//         builder.append("\n]");
//         return builder.toString();
//     }
// 
//     /**
//      * Compares an user-visible operation to this private OperationInfo
//      * object
//      *
//      * @param o operation to be compared
//      * @return true if logically equivalent
//      */
//     public boolean equivalent(Operation o) {
//         return o.token == this.token && o.op == this.op;
//     }
// }


import java.util.concurrent.atomic.AtomicInteger;
import edu.bupt.calendar.AsyncQueryServiceHelper.OperationInfo;
import android.content.ContentProviderOperation;
import android.content.ContentProviderResult;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import java.util.ArrayList;
     */
    public final int cancelOperation(int token) {
        return AsyncQueryServiceHelper.cancelOperation(token);
    }

    /**
     * This method begins an asynchronous query. When the query is done
     * {@link #onQueryComplete} is called.
     *
     * @param token A token passed into {@link #onQueryComplete} to identify the
     *            query.
     * @param cookie An object that gets passed into {@link #onQueryComplete}
     * @param uri The URI, using the content:// scheme, for the content to
     *            retrieve.
     * @param projection A list of which columns to return. Passing null will
     *            return all columns, which is discouraged to prevent reading
     *            data from storage that isn't going to be used.
     * @param selection A filter declaring which rows to return, formatted as an
     *            SQL WHERE clause (excluding the WHERE itself). Passing null
     *            will return all rows for the given URI.
     * @param selectionArgs You may include ?s in selection, which will be
     *            replaced by the values from selectionArgs, in the order that
     *            they appear in the selection. The values will be bound as
     *            Strings.
     * @param orderBy How to order the rows, formatted as an SQL ORDER BY clause
     *            (excluding the ORDER BY itself). Passing null will use the
     *            default sort order, which may be unordered.
     */
    public void startQuery(int token, Object cookie, Uri uri, String[] projection,
            String selection, String[] selectionArgs, String orderBy) {
// Path: src/edu/bupt/calendar/AsyncQueryServiceHelper.java
// protected static class OperationInfo implements Delayed{
//     public int token; // Used for cancel
//     public int op;
//     public ContentResolver resolver;
//     public Uri uri;
//     public String authority;
//     public Handler handler;
//     public String[] projection;
//     public String selection;
//     public String[] selectionArgs;
//     public String orderBy;
//     public Object result;
//     public Object cookie;
//     public ContentValues values;
//     public ArrayList<ContentProviderOperation> cpo;
// 
//     /**
//      * delayMillis is relative time e.g. 10,000 milliseconds
//      */
//     public long delayMillis;
// 
//     /**
//      * scheduleTimeMillis is the time scheduled for this to be processed.
//      * e.g. SystemClock.elapsedRealtime() + 10,000 milliseconds Based on
//      * {@link android.os.SystemClock#elapsedRealtime }
//      */
//     private long mScheduledTimeMillis = 0;
// 
//     // @VisibleForTesting
//     void calculateScheduledTime() {
//         mScheduledTimeMillis = SystemClock.elapsedRealtime() + delayMillis;
//     }
// 
//     // @Override // Uncomment with Java6
//     public long getDelay(TimeUnit unit) {
//         return unit.convert(mScheduledTimeMillis - SystemClock.elapsedRealtime(),
//                 TimeUnit.MILLISECONDS);
//     }
// 
//     // @Override // Uncomment with Java6
//     public int compareTo(Delayed another) {
//         OperationInfo anotherArgs = (OperationInfo) another;
//         if (this.mScheduledTimeMillis == anotherArgs.mScheduledTimeMillis) {
//             return 0;
//         } else if (this.mScheduledTimeMillis < anotherArgs.mScheduledTimeMillis) {
//             return -1;
//         } else {
//             return 1;
//         }
//     }
// 
//     @Override
//     public String toString() {
//         StringBuilder builder = new StringBuilder();
//         builder.append("OperationInfo [\n\t token= ");
//         builder.append(token);
//         builder.append(",\n\t op= ");
//         builder.append(Operation.opToChar(op));
//         builder.append(",\n\t uri= ");
//         builder.append(uri);
//         builder.append(",\n\t authority= ");
//         builder.append(authority);
//         builder.append(",\n\t delayMillis= ");
//         builder.append(delayMillis);
//         builder.append(",\n\t mScheduledTimeMillis= ");
//         builder.append(mScheduledTimeMillis);
//         builder.append(",\n\t resolver= ");
//         builder.append(resolver);
//         builder.append(",\n\t handler= ");
//         builder.append(handler);
//         builder.append(",\n\t projection= ");
//         builder.append(Arrays.toString(projection));
//         builder.append(",\n\t selection= ");
//         builder.append(selection);
//         builder.append(",\n\t selectionArgs= ");
//         builder.append(Arrays.toString(selectionArgs));
//         builder.append(",\n\t orderBy= ");
//         builder.append(orderBy);
//         builder.append(",\n\t result= ");
//         builder.append(result);
//         builder.append(",\n\t cookie= ");
//         builder.append(cookie);
//         builder.append(",\n\t values= ");
//         builder.append(values);
//         builder.append(",\n\t cpo= ");
//         builder.append(cpo);
//         builder.append("\n]");
//         return builder.toString();
//     }
// 
//     /**
//      * Compares an user-visible operation to this private OperationInfo
//      * object
//      *
//      * @param o operation to be compared
//      * @return true if logically equivalent
//      */
//     public boolean equivalent(Operation o) {
//         return o.token == this.token && o.op == this.op;
//     }
// }


// Path: src/edu/bupt/calendar/AsyncQueryService.java
import java.util.concurrent.atomic.AtomicInteger;
import edu.bupt.calendar.AsyncQueryServiceHelper.OperationInfo;
import android.content.ContentProviderOperation;
import android.content.ContentProviderResult;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import java.util.ArrayList;

     */
    public final int cancelOperation(int token) {
        return AsyncQueryServiceHelper.cancelOperation(token);
    }

    /**
     * This method begins an asynchronous query. When the query is done
     * {@link #onQueryComplete} is called.
     *
     * @param token A token passed into {@link #onQueryComplete} to identify the
     *            query.
     * @param cookie An object that gets passed into {@link #onQueryComplete}
     * @param uri The URI, using the content:// scheme, for the content to
     *            retrieve.
     * @param projection A list of which columns to return. Passing null will
     *            return all columns, which is discouraged to prevent reading
     *            data from storage that isn't going to be used.
     * @param selection A filter declaring which rows to return, formatted as an
     *            SQL WHERE clause (excluding the WHERE itself). Passing null
     *            will return all rows for the given URI.
     * @param selectionArgs You may include ?s in selection, which will be
     *            replaced by the values from selectionArgs, in the order that
     *            they appear in the selection. The values will be bound as
     *            Strings.
     * @param orderBy How to order the rows, formatted as an SQL ORDER BY clause
     *            (excluding the ORDER BY itself). Passing null will use the
     *            default sort order, which may be unordered.
     */
    public void startQuery(int token, Object cookie, Uri uri, String[] projection,
            String selection, String[] selectionArgs, String orderBy) {
        OperationInfo info = new OperationInfo();