Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98d41d71 authored by Walter Jang's avatar Walter Jang
Browse files

Fix the ContactsTest account type and sync adapter (1/2)

* Add TestSyncService$Basic to the AndroidManifest and give
  it the fallback account type unit test contacts.xml.

* Remove "common" from the testauth package name

* Change the test accountType to end with testauth.basic
  instead of authtest.basic since it's testauth
  everywhere else.

* UI changes
- Give the test account type the same name as the app
- Remove the ic_contact_picture test account type icon
  since it just looks like a black square and we can
  just use the default (after we add a guard against
  null icons in the DrawerActivity)

Test: manually add a user of the test account type and
  toggle sync, then add a contact of the test account
  type in the app.

Bug: 30759296
Bug: 31549157

Change-Id: I363fff8dfbce3d2d1b888e23abe6e20a40da2d1c
parent da3a453b
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -497,9 +497,11 @@ public abstract class ContactsDrawerActivity extends AppCompatContactsActivity i
                    return true;
                }
            });
            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.
+11 −0
Original line number Diff line number Diff line
@@ -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" />
−589 B
Loading image diff...
+0 −2
Original line number Diff line number Diff line
@@ -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>
+2 −4
Original line number Diff line number Diff line
@@ -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"
/>
Loading