1cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn/*
2cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * Copyright (C) 2011 The Android Open Source Project
3cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn *
4cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * Licensed under the Apache License, Version 2.0 (the "License");
5cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * you may not use this file except in compliance with the License.
6cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * You may obtain a copy of the License at
7cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn *
8cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn *      http://www.apache.org/licenses/LICENSE-2.0
9cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn *
10cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * Unless required by applicable law or agreed to in writing, software
11cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * distributed under the License is distributed on an "AS IS" BASIS,
12cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * See the License for the specific language governing permissions and
14cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * limitations under the License.
15cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn */
16cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
17cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackbornpackage android.support.v4.content;
18cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
19220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brownimport android.content.ContentResolver;
20cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackbornimport android.content.Context;
21cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackbornimport android.database.Cursor;
22cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackbornimport android.net.Uri;
23220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brownimport android.support.v4.os.CancellationSignal;
24220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brownimport android.support.v4.os.OperationCanceledException;
25cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
26cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackbornimport java.io.FileDescriptor;
27cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackbornimport java.io.PrintWriter;
28cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackbornimport java.util.Arrays;
29cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
30cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn/**
31cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * Static library support version of the framework's {@link android.content.CursorLoader}.
32cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * Used to write apps that run on platforms prior to Android 3.0.  When running
33cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * on Android 3.0 or above, this implementation is still used; it does not try
34cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * to switch to the framework's implementation.  See the framework SDK
35cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn * documentation for a class overview.
36cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn */
37cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackbornpublic class CursorLoader extends AsyncTaskLoader<Cursor> {
38cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    final ForceLoadContentObserver mObserver;
39cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
40cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    Uri mUri;
41cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    String[] mProjection;
42cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    String mSelection;
43cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    String[] mSelectionArgs;
44cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    String mSortOrder;
45cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
46cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    Cursor mCursor;
47220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown    CancellationSignal mCancellationSignal;
48cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
49cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    /* Runs on a worker thread */
50cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    @Override
51cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    public Cursor loadInBackground() {
52220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown        synchronized (this) {
53220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown            if (isLoadInBackgroundCanceled()) {
54220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown                throw new OperationCanceledException();
55220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown            }
56220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown            mCancellationSignal = new CancellationSignal();
57220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown        }
58220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown        try {
59220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown            Cursor cursor = ContentResolverCompat.query(getContext().getContentResolver(),
60220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown                    mUri, mProjection, mSelection, mSelectionArgs, mSortOrder,
61220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown                    mCancellationSignal);
62220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown            if (cursor != null) {
63220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown                try {
64220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown                    // Ensure the cursor window is filled.
65220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown                    cursor.getCount();
66220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown                    cursor.registerContentObserver(mObserver);
67220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown                } catch (RuntimeException ex) {
68220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown                    cursor.close();
69220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown                    throw ex;
70220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown                }
71220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown            }
72220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown            return cursor;
73220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown        } finally {
74220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown            synchronized (this) {
75220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown                mCancellationSignal = null;
76220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown            }
77220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown        }
78220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown    }
79220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown
80220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown    @Override
81220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown    public void cancelLoadInBackground() {
82220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown        super.cancelLoadInBackground();
83220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown
84220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown        synchronized (this) {
85220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown            if (mCancellationSignal != null) {
86220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown                mCancellationSignal.cancel();
87220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown            }
88cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        }
89cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    }
90cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
91cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    /* Runs on the UI thread */
92cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    @Override
93cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    public void deliverResult(Cursor cursor) {
94cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        if (isReset()) {
95cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn            // An async query came in while the loader is stopped
96cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn            if (cursor != null) {
97c286d5c93640e82c649888b7e5045801581e4d6cDianne Hackborn                cursor.close();
98cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn            }
99cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn            return;
100cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        }
101cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        Cursor oldCursor = mCursor;
102cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        mCursor = cursor;
103cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
104cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        if (isStarted()) {
105cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn            super.deliverResult(cursor);
106cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        }
107cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
108cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        if (oldCursor != null && oldCursor != cursor && !oldCursor.isClosed()) {
109c286d5c93640e82c649888b7e5045801581e4d6cDianne Hackborn            oldCursor.close();
110cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        }
111cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    }
112cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
113cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    /**
114cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     * Creates an empty unspecified CursorLoader.  You must follow this with
115cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     * calls to {@link #setUri(Uri)}, {@link #setSelection(String)}, etc
116cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     * to specify the query to perform.
117cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     */
118cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    public CursorLoader(Context context) {
119cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        super(context);
120cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        mObserver = new ForceLoadContentObserver();
121cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    }
122cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
123cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    /**
124cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     * Creates a fully-specified CursorLoader.  See
125220dc21ab5a2a5b3f8b6532105121750770a69f4Jeff Brown     * {@link ContentResolver#query(Uri, String[], String, String[], String)
126cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     * ContentResolver.query()} for documentation on the meaning of the
127cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     * parameters.  These will be passed as-is to that call.
128cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     */
129cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    public CursorLoader(Context context, Uri uri, String[] projection, String selection,
130cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn            String[] selectionArgs, String sortOrder) {
131cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        super(context);
132cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        mObserver = new ForceLoadContentObserver();
133cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        mUri = uri;
134cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        mProjection = projection;
135cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        mSelection = selection;
136cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        mSelectionArgs = selectionArgs;
137cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        mSortOrder = sortOrder;
138cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    }
139cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
140cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    /**
141cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     * Starts an asynchronous load of the contacts list data. When the result is ready the callbacks
142cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     * will be called on the UI thread. If a previous load has been completed and is still valid
143cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     * the result may be passed to the callbacks immediately.
144cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     *
145cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     * Must be called from the UI thread
146cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     */
147cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    @Override
148cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    protected void onStartLoading() {
149cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        if (mCursor != null) {
150cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn            deliverResult(mCursor);
151cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        }
152cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        if (takeContentChanged() || mCursor == null) {
153cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn            forceLoad();
154cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        }
155cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    }
156cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
157cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    /**
158cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     * Must be called from the UI thread
159cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn     */
160cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    @Override
161cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    protected void onStopLoading() {
162cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        // Attempt to cancel the current load task if possible.
163cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        cancelLoad();
164cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    }
165cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
166cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    @Override
167cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    public void onCanceled(Cursor cursor) {
168cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        if (cursor != null && !cursor.isClosed()) {
169c286d5c93640e82c649888b7e5045801581e4d6cDianne Hackborn            cursor.close();
170cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        }
171cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    }
172cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
173cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    @Override
174cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    protected void onReset() {
175cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        super.onReset();
176cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
177cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        // Ensure the loader is stopped
178cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        onStopLoading();
179cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
180cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        if (mCursor != null && !mCursor.isClosed()) {
181c286d5c93640e82c649888b7e5045801581e4d6cDianne Hackborn            mCursor.close();
182cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        }
183cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        mCursor = null;
184cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    }
185cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
186cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    public Uri getUri() {
187cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        return mUri;
188cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    }
189cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
190cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    public void setUri(Uri uri) {
191cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        mUri = uri;
192cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    }
193cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
194cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    public String[] getProjection() {
195cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        return mProjection;
196cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    }
197cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
198cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    public void setProjection(String[] projection) {
199cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        mProjection = projection;
200cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    }
201cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
202cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    public String getSelection() {
203cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        return mSelection;
204cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    }
205cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
206cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    public void setSelection(String selection) {
207cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        mSelection = selection;
208cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    }
209cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
210cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    public String[] getSelectionArgs() {
211cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        return mSelectionArgs;
212cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    }
213cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
214cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    public void setSelectionArgs(String[] selectionArgs) {
215cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        mSelectionArgs = selectionArgs;
216cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    }
217cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
218cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    public String getSortOrder() {
219cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        return mSortOrder;
220cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    }
221cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
222cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    public void setSortOrder(String sortOrder) {
223cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        mSortOrder = sortOrder;
224cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    }
225cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn
226cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    @Override
227cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) {
228cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        super.dump(prefix, fd, writer, args);
229cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        writer.print(prefix); writer.print("mUri="); writer.println(mUri);
230cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        writer.print(prefix); writer.print("mProjection=");
231cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn                writer.println(Arrays.toString(mProjection));
232cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        writer.print(prefix); writer.print("mSelection="); writer.println(mSelection);
233cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        writer.print(prefix); writer.print("mSelectionArgs=");
234cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn                writer.println(Arrays.toString(mSelectionArgs));
235cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        writer.print(prefix); writer.print("mSortOrder="); writer.println(mSortOrder);
236cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        writer.print(prefix); writer.print("mCursor="); writer.println(mCursor);
237cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn        writer.print(prefix); writer.print("mContentChanged="); writer.println(mContentChanged);
238cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn    }
239cba2e2c881e8e16ea5025b564c94320174d65f01Dianne Hackborn}
240