Use AccountManager for details, handle INSERT cases.
Connected Sources to use AccountManager and inflate details
through registered sync adapters. Each ContactsSource now
has a "level" of inflation, since deeper levels aren't
always needed right away. Several places we're making
blocking calls into other processes that are tied to the UI
thread. (This would take a large effort to fix.)
Turned most background Edit activity operations into
WeakAsyncTask, which helps finish background tasks while
preventing leaked Contexts. This allows us to hold the UI
thread while saving, but release it just before ANR,
allowing the background operation to complete.
Enabled INSERT case, both from overall list and when already
editing an aggregate. Finally, cleaned up the manifest
intent-filters to directly match authorities.
diff --git a/src/com/android/contacts/ShowOrCreateActivity.java b/src/com/android/contacts/ShowOrCreateActivity.java
index 6ba2315..27fce18 100755
--- a/src/com/android/contacts/ShowOrCreateActivity.java
+++ b/src/com/android/contacts/ShowOrCreateActivity.java
@@ -16,14 +16,13 @@
package com.android.contacts;
-import com.android.contacts.NotifyingAsyncQueryHandler.AsyncQueryListener;
import com.android.contacts.ui.FastTrackWindow;
+import com.android.contacts.util.NotifyingAsyncQueryHandler;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.ComponentName;
import android.content.ContentUris;
-import android.content.Context;
import android.content.DialogInterface;
import android.content.EntityIterator;
import android.content.Intent;
@@ -31,12 +30,10 @@
import android.graphics.Rect;
import android.net.Uri;
import android.os.Bundle;
-import android.os.IBinder;
-import android.provider.ContactsContract.Intents;
import android.provider.ContactsContract.Contacts;
-import android.provider.ContactsContract.RawContacts;
+import android.provider.ContactsContract.Intents;
import android.provider.ContactsContract.PhoneLookup;
-import android.view.View;
+import android.provider.ContactsContract.RawContacts;
/**
* Handle several edge cases around showing or possibly creating contacts in
@@ -54,8 +51,8 @@
* {@link Intent#ACTION_SEARCH}.
* </ul>
*/
-public final class ShowOrCreateActivity extends Activity implements AsyncQueryListener,
- FastTrackWindow.OnDismissListener {
+public final class ShowOrCreateActivity extends Activity implements
+ NotifyingAsyncQueryHandler.AsyncQueryListener, FastTrackWindow.OnDismissListener {
static final String TAG = "ShowOrCreateActivity";
static final boolean LOGD = false;
@@ -180,6 +177,7 @@
finish();
}
+ /** {@inheritDoc} */
public void onQueryComplete(int token, Object cookie, Cursor cursor) {
if (cursor == null) {
return;
@@ -243,6 +241,11 @@
}
}
+ /** {@inheritDoc} */
+ public void onQueryEntitiesComplete(int token, Object cookie, EntityIterator iterator) {
+ // No actions
+ }
+
/**
* Listener for {@link DialogInterface} that launches a given {@link Intent}
* when clicked. When clicked, this also closes the parent using
@@ -268,8 +271,4 @@
mParent.finish();
}
}
-
- public void onQueryEntitiesComplete(int token, Object cookie, EntityIterator iterator) {
- // Empty
- }
}