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

Commit 3c4d041b authored by Brian Attwell's avatar Brian Attwell
Browse files

Use new definitions of ProviderStatus

And rebundle Contacts again.

Bug: 21090207
Change-Id: I7e93e36ad0c0d667ac56983c76acb1b97bd8755c
parent 83056011
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -36,6 +36,8 @@ LOCAL_PRIVILEGED_MODULE := true

LOCAL_PROGUARD_FLAG_FILES := proguard.flags

LOCAL_SDK_VERSION := current

include $(BUILD_PACKAGE)

# Use the folloing include to make our test apk.
+0 −3
Original line number Diff line number Diff line
@@ -415,9 +415,6 @@
    <!-- An option in the 'Contact photo' dialog, if there is already a photo [CHAR LIMIT=50] -->
    <string name="pick_new_photo">Select new photo</string>

    <!-- Text shown in the contacts app while the background process updates contacts after a locale change [CHAR LIMIT=300] -->
    <string name="locale_change_in_progress">Contact list is being updated to reflect the change of language.</string>

    <!-- Text shown in the contacts app while the background process updates contacts after a system upgrade [CHAR LIMIT=300] -->
    <string name="upgrade_in_progress">Contact list is being updated.</string>

+3 −13
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ public class ContactsUnavailableFragment extends Fragment implements OnClickList
            return;
        }
        switch (providerStatus) {
            case ProviderStatus.STATUS_NO_ACCOUNTS_NO_CONTACTS:
            case ProviderStatus.STATUS_EMPTY:
                setMessageText(mNoContactsMsgResId, mNSecNoContactsMsgResId);
                mCreateContactButton.setVisibility(View.VISIBLE);
                mAddAccountButton.setVisibility(View.VISIBLE);
@@ -96,17 +96,7 @@ public class ContactsUnavailableFragment extends Fragment implements OnClickList
                mProgress.setVisibility(View.GONE);
                break;

            case ProviderStatus.STATUS_CHANGING_LOCALE:
                mMessageView.setText(R.string.locale_change_in_progress);
                mMessageView.setGravity(Gravity.CENTER_HORIZONTAL);
                mMessageView.setVisibility(View.VISIBLE);
                mCreateContactButton.setVisibility(View.GONE);
                mAddAccountButton.setVisibility(View.GONE);
                mImportContactsButton.setVisibility(View.GONE);
                mProgress.setVisibility(View.VISIBLE);
                break;

            case ProviderStatus.STATUS_UPGRADING:
            case ProviderStatus.STATUS_BUSY:
                mMessageView.setText(R.string.upgrade_in_progress);
                mMessageView.setGravity(Gravity.CENTER_HORIZONTAL);
                mMessageView.setVisibility(View.VISIBLE);
@@ -144,7 +134,7 @@ public class ContactsUnavailableFragment extends Fragment implements OnClickList
        mNoContactsMsgResId = resId;
        mNSecNoContactsMsgResId = secResId;
        if ((mMessageView != null) && (mProviderStatus != null) &&
                (mProviderStatus.equals(ProviderStatus.STATUS_NO_ACCOUNTS_NO_CONTACTS))) {
                (mProviderStatus.equals(ProviderStatus.STATUS_EMPTY))) {
            if (resId != -1) {
                mMessageView.setText(mNoContactsMsgResId);
                mMessageView.setGravity(Gravity.CENTER_HORIZONTAL);
+3 −3
Original line number Diff line number Diff line
@@ -167,16 +167,16 @@ public class ProviderStatusWatcher extends ContentObserver {
     * provider?) this may still cause ANRs.
     *
     * In order to avoid that, if we can't load the status within {@link #LOAD_WAIT_TIMEOUT_MS},
     * we'll give up and just returns {@link ProviderStatus#STATUS_UPGRADING} in order to unblock
     * we'll give up and just returns {@link ProviderStatus#STATUS_BUSY} in order to unblock
     * the UI thread.  The actual result will be delivered later via {@link ProviderStatusListener}.
     * (If {@link ProviderStatus#STATUS_UPGRADING} is returned, the app (should) shows an according
     * (If {@link ProviderStatus#STATUS_BUSY} is returned, the app (should) shows an according
     * message, like "contacts are being updated".)
     */
    public int getProviderStatus() {
        waitForLoaded();

        if (mProviderStatus == null) {
            return ProviderStatus.STATUS_UPGRADING;
            return ProviderStatus.STATUS_BUSY;
        }

        return mProviderStatus;