diff options
12 files changed, 24 insertions, 20 deletions
diff --git a/src/com/android/contacts/ContactsDrawerActivity.java b/src/com/android/contacts/ContactsDrawerActivity.java index 293b06a1e..2c1874412 100644 --- a/src/com/android/contacts/ContactsDrawerActivity.java +++ b/src/com/android/contacts/ContactsDrawerActivity.java @@ -499,9 +499,11 @@ public abstract class ContactsDrawerActivity extends AppCompatContactsActivity i return true; } }); - menuItem.setIcon(displayableAccount.getIcon()); - // Get rid of the default menu item overlay and show original account icons. - menuItem.getIcon().setColorFilter(Color.TRANSPARENT, PorterDuff.Mode.SRC_ATOP); + if (displayableAccount.getIcon() != null) { + menuItem.setIcon(displayableAccount.getIcon()); + // Get rid of the default menu item overlay and show original account icons. + menuItem.getIcon().setColorFilter(Color.TRANSPARENT, PorterDuff.Mode.SRC_ATOP); + } // Create a dummy action view to attach extra hidden content description to the menuItem // for Talkback. We want Talkback to read out the account type but not have it be part // of the menuItem title. diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml index 65c04bc21..87f9a8ace 100644 --- a/tests/AndroidManifest.xml +++ b/tests/AndroidManifest.xml @@ -69,6 +69,17 @@ android:name="android.accounts.AccountAuthenticator" android:resource="@xml/test_basic_authenticator" /> </service> + <service android:name=".testauth.TestSyncService$Basic" android:exported="true" > + <intent-filter> + <action android:name="android.content.SyncAdapter"/> + </intent-filter> + <meta-data + android:name="android.content.SyncAdapter" + android:resource="@xml/test_basic_syncadapter" /> + <meta-data + android:name="android.provider.CONTACTS_STRUCTURE" + android:resource="@xml/contacts_fallback" /> + </service> <service android:name=".QueryService" /> <service android:name=".PhoneNumberTestService" /> diff --git a/tests/res/drawable/ic_contact_picture.png b/tests/res/drawable/ic_contact_picture.png Binary files differdeleted file mode 100644 index 68767774f..000000000 --- a/tests/res/drawable/ic_contact_picture.png +++ /dev/null diff --git a/tests/res/values/donottranslate_strings.xml b/tests/res/values/donottranslate_strings.xml index 152811277..76cf4e479 100644 --- a/tests/res/values/donottranslate_strings.xml +++ b/tests/res/values/donottranslate_strings.xml @@ -104,7 +104,5 @@ <string name="attribution_flicker">Flicker</string> <string name="attribution_twitter">Twitter</string> - <string name="authenticator_basic_label">Test adapter</string> - <string name="test_string">TEST STRING</string> </resources> diff --git a/tests/res/xml/test_basic_authenticator.xml b/tests/res/xml/test_basic_authenticator.xml index ecd100a74..efcdadfed 100644 --- a/tests/res/xml/test_basic_authenticator.xml +++ b/tests/res/xml/test_basic_authenticator.xml @@ -18,8 +18,6 @@ --> <account-authenticator xmlns:android="http://schemas.android.com/apk/res/android" - android:accountType="com.android.contacts.tests.authtest.basic" - android:icon="@drawable/ic_contact_picture" - android:smallIcon="@drawable/ic_contact_picture" - android:label="@string/authenticator_basic_label" + android:accountType="com.android.contacts.tests.testauth.basic" + android:label="@string/applicationLabel" /> diff --git a/tests/res/xml/test_basic_syncadapter.xml b/tests/res/xml/test_basic_syncadapter.xml index fecc0eb16..b897185db 100644 --- a/tests/res/xml/test_basic_syncadapter.xml +++ b/tests/res/xml/test_basic_syncadapter.xml @@ -19,7 +19,7 @@ <sync-adapter xmlns:android="http://schemas.android.com/apk/res/android" android:contentAuthority="com.android.contacts" - android:accountType="com.android.contacts.tests.authtest.basic" + android:accountType="com.android.contacts.tests.testauth.basic" android:supportsUploading="true" android:userVisible="true" /> diff --git a/tests/src/com/android/contacts/tests/FakeDeviceAccountTypeFactory.java b/tests/src/com/android/contacts/tests/FakeDeviceAccountTypeFactory.java index 6a500ec0f..65f8014eb 100644 --- a/tests/src/com/android/contacts/tests/FakeDeviceAccountTypeFactory.java +++ b/tests/src/com/android/contacts/tests/FakeDeviceAccountTypeFactory.java @@ -16,12 +16,10 @@ package com.android.contacts.tests; import com.android.contacts.common.model.account.AccountType; -import com.android.contacts.common.model.account.FallbackAccountType; import com.android.contacts.common.util.DeviceLocalAccountTypeFactory; import java.util.HashMap; import java.util.Map; -import java.util.Set; public class FakeDeviceAccountTypeFactory implements DeviceLocalAccountTypeFactory { diff --git a/tests/src/com/android/contacts/common/tests/testauth/TestAuthenticationService.java b/tests/src/com/android/contacts/tests/testauth/TestAuthenticationService.java index 93d1f4a90..84f3f0f80 100644 --- a/tests/src/com/android/contacts/common/tests/testauth/TestAuthenticationService.java +++ b/tests/src/com/android/contacts/tests/testauth/TestAuthenticationService.java @@ -14,7 +14,7 @@ * the License. */ -package com.android.contacts.common.tests.testauth; +package com.android.contacts.tests.testauth; import android.app.Service; import android.content.Intent; diff --git a/tests/src/com/android/contacts/common/tests/testauth/TestAuthenticator.java b/tests/src/com/android/contacts/tests/testauth/TestAuthenticator.java index 2f676c70b..97e2e4d18 100644 --- a/tests/src/com/android/contacts/common/tests/testauth/TestAuthenticator.java +++ b/tests/src/com/android/contacts/tests/testauth/TestAuthenticator.java @@ -14,7 +14,7 @@ * the License. */ -package com.android.contacts.common.tests.testauth; +package com.android.contacts.tests.testauth; import android.accounts.AbstractAccountAuthenticator; import android.accounts.Account; diff --git a/tests/src/com/android/contacts/common/tests/testauth/TestSyncAdapter.java b/tests/src/com/android/contacts/tests/testauth/TestSyncAdapter.java index a7c0f83c4..feef8ec30 100644 --- a/tests/src/com/android/contacts/common/tests/testauth/TestSyncAdapter.java +++ b/tests/src/com/android/contacts/tests/testauth/TestSyncAdapter.java @@ -13,10 +13,9 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.android.contacts.common.tests.testauth; +package com.android.contacts.tests.testauth; import android.accounts.Account; -import android.accounts.AccountManager; import android.content.AbstractThreadedSyncAdapter; import android.content.ContentProviderClient; import android.content.ContentResolver; @@ -32,14 +31,12 @@ import android.util.Log; * */ public class TestSyncAdapter extends AbstractThreadedSyncAdapter { - private final AccountManager mAccountManager; private final Context mContext; public TestSyncAdapter(Context context, boolean autoInitialize) { super(context, autoInitialize); mContext = context.getApplicationContext(); - mAccountManager = AccountManager.get(mContext); } /** diff --git a/tests/src/com/android/contacts/common/tests/testauth/TestSyncService.java b/tests/src/com/android/contacts/tests/testauth/TestSyncService.java index 3354cb4e1..99287771c 100644 --- a/tests/src/com/android/contacts/common/tests/testauth/TestSyncService.java +++ b/tests/src/com/android/contacts/tests/testauth/TestSyncService.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.android.contacts.common.tests.testauth; +package com.android.contacts.tests.testauth; import android.app.Service; import android.content.Intent; diff --git a/tests/src/com/android/contacts/common/tests/testauth/TestauthConstants.java b/tests/src/com/android/contacts/tests/testauth/TestauthConstants.java index 3ce7f5abe..717ed354a 100644 --- a/tests/src/com/android/contacts/common/tests/testauth/TestauthConstants.java +++ b/tests/src/com/android/contacts/tests/testauth/TestauthConstants.java @@ -14,7 +14,7 @@ * the License. */ -package com.android.contacts.common.tests.testauth; +package com.android.contacts.tests.testauth; class TestauthConstants { public static final String LOG_TAG = "Testauth"; |