diff options
Diffstat (limited to 'java/com/android/dialer/app/dialpad/SmartDialCursorLoader.java')
-rw-r--r-- | java/com/android/dialer/app/dialpad/SmartDialCursorLoader.java | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/java/com/android/dialer/app/dialpad/SmartDialCursorLoader.java b/java/com/android/dialer/app/dialpad/SmartDialCursorLoader.java index f3a93f916..175360c2d 100644 --- a/java/com/android/dialer/app/dialpad/SmartDialCursorLoader.java +++ b/java/com/android/dialer/app/dialpad/SmartDialCursorLoader.java @@ -20,8 +20,8 @@ import android.content.AsyncTaskLoader; import android.content.Context; import android.database.Cursor; import android.database.MatrixCursor; -import android.util.Log; import com.android.contacts.common.list.PhoneNumberListAdapter.PhoneQuery; +import com.android.dialer.common.LogUtil; import com.android.dialer.database.Database; import com.android.dialer.database.DialerDatabaseHelper; import com.android.dialer.database.DialerDatabaseHelper.ContactNumber; @@ -43,8 +43,6 @@ public class SmartDialCursorLoader extends AsyncTaskLoader<Cursor> { private String mQuery; private SmartDialNameMatcher mNameMatcher; - private ForceLoadContentObserver mObserver; - private boolean mShowEmptyListForNullQuery = true; public SmartDialCursorLoader(Context context) { @@ -59,7 +57,7 @@ public class SmartDialCursorLoader extends AsyncTaskLoader<Cursor> { */ public void configureQuery(String query) { if (DEBUG) { - Log.v(TAG, "Configure new query to be " + query); + LogUtil.v(TAG, "Configure new query to be " + query); } mQuery = SmartDialNameMatcher.normalizeNumber(query, SmartDialPrefix.getMap()); @@ -76,7 +74,7 @@ public class SmartDialCursorLoader extends AsyncTaskLoader<Cursor> { @Override public Cursor loadInBackground() { if (DEBUG) { - Log.v(TAG, "Load in background " + mQuery); + LogUtil.v(TAG, "Load in background " + mQuery); } if (!PermissionsUtil.hasContactsPermissions(mContext)) { @@ -90,7 +88,7 @@ public class SmartDialCursorLoader extends AsyncTaskLoader<Cursor> { dialerDatabaseHelper.getLooseMatches(mQuery, mNameMatcher); if (DEBUG) { - Log.v(TAG, "Loaded matches " + String.valueOf(allMatches.size())); + LogUtil.v(TAG, "Loaded matches " + allMatches.size()); } /** Constructs a cursor for the returned array of results. */ @@ -121,13 +119,6 @@ public class SmartDialCursorLoader extends AsyncTaskLoader<Cursor> { Cursor oldCursor = mCursor; mCursor = cursor; - if (mObserver == null) { - mObserver = new ForceLoadContentObserver(); - mContext - .getContentResolver() - .registerContentObserver(DialerDatabaseHelper.SMART_DIAL_UPDATED_URI, true, mObserver); - } - if (isStarted()) { /** If the Loader is in a started state, deliver the results to the client. */ super.deliverResult(cursor); @@ -162,11 +153,6 @@ public class SmartDialCursorLoader extends AsyncTaskLoader<Cursor> { /** Ensure the loader has been stopped. */ onStopLoading(); - if (mObserver != null) { - mContext.getContentResolver().unregisterContentObserver(mObserver); - mObserver = null; - } - /** Release all previously saved query results. */ if (mCursor != null) { releaseResources(mCursor); @@ -178,11 +164,6 @@ public class SmartDialCursorLoader extends AsyncTaskLoader<Cursor> { public void onCanceled(Cursor cursor) { super.onCanceled(cursor); - if (mObserver != null) { - mContext.getContentResolver().unregisterContentObserver(mObserver); - mObserver = null; - } - /** The load has been canceled, so we should release the resources associated with 'data'. */ releaseResources(cursor); } |