Loading src/com/android/contacts/model/AccountTypeManager.java +11 −0 Original line number Diff line number Diff line Loading @@ -338,6 +338,17 @@ class AccountTypeManagerImpl extends AccountTypeManager // Skip external account types that couldn't be initialized. continue; } if (!accountType.hasContactsMetadata()) { Log.w(TAG, "Skipping extension package " + extensionPackage + " because" + " it doesn't have the CONTACTS_STRUCTURE metadata"); continue; } if (TextUtils.isEmpty(accountType.accountType)) { Log.w(TAG, "Skipping extension package " + extensionPackage + " because" + " the CONTACTS_STRUCTURE metadata doesn't have the accountType" + " attribute"); continue; } Log.d(TAG, "Registering extension package account type=" + accountType.accountType + ", dataSet=" + accountType.dataSet + ", packageName=" + extensionPackage); Loading src/com/android/contacts/model/ExternalAccountType.java +10 −3 Original line number Diff line number Diff line Loading @@ -22,11 +22,9 @@ import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import android.content.Context; import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; import android.content.res.Resources; import android.content.res.TypedArray; Loading @@ -46,7 +44,6 @@ import java.util.List; public class ExternalAccountType extends BaseAccountType { private static final String TAG = "ExternalAccountType"; private static final String ACTION_SYNC_ADAPTER = "android.content.SyncAdapter"; private static final String METADATA_CONTACTS = "android.provider.CONTACTS_STRUCTURE"; private static final String TAG_CONTACTS_SOURCE_LEGACY = "ContactsSource"; Loading Loading @@ -85,6 +82,7 @@ public class ExternalAccountType extends BaseAccountType { private String mAccountTypeLabelAttribute; private String mAccountTypeIconAttribute; private boolean mInitSuccessful; private boolean mHasContactsMetadata; public ExternalAccountType(Context context, String resPackageName) { this.resPackageName = resPackageName; Loading Loading @@ -137,6 +135,13 @@ public class ExternalAccountType extends BaseAccountType { return mInitSuccessful; } /** * Whether this account type has the android.provider.CONTACTS_STRUCTURE metadata xml. */ public boolean hasContactsMetadata() { return mHasContactsMetadata; } @Override public String getEditContactActivityClassName() { return mEditContactActivityClassName; Loading Loading @@ -207,6 +212,8 @@ public class ExternalAccountType extends BaseAccountType { + TAG_CONTACTS_ACCOUNT_TYPE + ", not " + rootTag); } mHasContactsMetadata = true; int attributeCount = parser.getAttributeCount(); for (int i = 0; i < attributeCount; i++) { String attr = parser.getAttributeName(i); Loading Loading
src/com/android/contacts/model/AccountTypeManager.java +11 −0 Original line number Diff line number Diff line Loading @@ -338,6 +338,17 @@ class AccountTypeManagerImpl extends AccountTypeManager // Skip external account types that couldn't be initialized. continue; } if (!accountType.hasContactsMetadata()) { Log.w(TAG, "Skipping extension package " + extensionPackage + " because" + " it doesn't have the CONTACTS_STRUCTURE metadata"); continue; } if (TextUtils.isEmpty(accountType.accountType)) { Log.w(TAG, "Skipping extension package " + extensionPackage + " because" + " the CONTACTS_STRUCTURE metadata doesn't have the accountType" + " attribute"); continue; } Log.d(TAG, "Registering extension package account type=" + accountType.accountType + ", dataSet=" + accountType.dataSet + ", packageName=" + extensionPackage); Loading
src/com/android/contacts/model/ExternalAccountType.java +10 −3 Original line number Diff line number Diff line Loading @@ -22,11 +22,9 @@ import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import android.content.Context; import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; import android.content.res.Resources; import android.content.res.TypedArray; Loading @@ -46,7 +44,6 @@ import java.util.List; public class ExternalAccountType extends BaseAccountType { private static final String TAG = "ExternalAccountType"; private static final String ACTION_SYNC_ADAPTER = "android.content.SyncAdapter"; private static final String METADATA_CONTACTS = "android.provider.CONTACTS_STRUCTURE"; private static final String TAG_CONTACTS_SOURCE_LEGACY = "ContactsSource"; Loading Loading @@ -85,6 +82,7 @@ public class ExternalAccountType extends BaseAccountType { private String mAccountTypeLabelAttribute; private String mAccountTypeIconAttribute; private boolean mInitSuccessful; private boolean mHasContactsMetadata; public ExternalAccountType(Context context, String resPackageName) { this.resPackageName = resPackageName; Loading Loading @@ -137,6 +135,13 @@ public class ExternalAccountType extends BaseAccountType { return mInitSuccessful; } /** * Whether this account type has the android.provider.CONTACTS_STRUCTURE metadata xml. */ public boolean hasContactsMetadata() { return mHasContactsMetadata; } @Override public String getEditContactActivityClassName() { return mEditContactActivityClassName; Loading Loading @@ -207,6 +212,8 @@ public class ExternalAccountType extends BaseAccountType { + TAG_CONTACTS_ACCOUNT_TYPE + ", not " + rootTag); } mHasContactsMetadata = true; int attributeCount = parser.getAttributeCount(); for (int i = 0; i < attributeCount; i++) { String attr = parser.getAttributeName(i); Loading