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

Commit d25f3189 authored by Makoto Onuki's avatar Makoto Onuki Committed by Android (Google) Code Review
Browse files

Merge "EditSchema parser for ExternalAccountType"

parents c9eafc62 dcf751d7
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.provider.ContactsContract.CommonDataKinds.StructuredPostal;
import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.Data;
import android.provider.ContactsContract.RawContacts;
import android.util.Log;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;

@@ -82,6 +83,14 @@ public abstract class AccountType {
     */
    private HashMap<String, DataKind> mMimeKinds = Maps.newHashMap();

    /**
     * Whether this account type was able to be fully initialized.  This may be false if
     * (for example) the package name associated with the account type could not be found.
     */
    public boolean isInitialized() {
        return true;
    }

    public boolean isExtension() {
        return false;
    }
@@ -234,10 +243,6 @@ public abstract class AccountType {
     */
    abstract public boolean isGroupMembershipEditable();

    abstract public int getHeaderColor(Context context);

    abstract public int getSideBarColor(Context context);

    /**
     * {@link Comparator} to sort by {@link DataKind#weight}.
     */
@@ -270,6 +275,11 @@ public abstract class AccountType {
     * Add given {@link DataKind} to list of those provided by this source.
     */
    public DataKind addKind(DataKind kind) {
        if (mMimeKinds.get(kind.mimeType) != null) {
            // TODO Make it exception.
            Log.w(TAG, "mime type '" + kind.mimeType + "' is already registered");
        }

        kind.resPackageName = this.resPackageName;
        this.mKinds.add(kind);
        this.mMimeKinds.put(kind.mimeType, kind);
@@ -351,7 +361,7 @@ public abstract class AccountType {
     * {@link Phone#NUMBER}. Includes flags to apply to an {@link EditText}, and
     * the column where this field is stored.
     */
    public static class EditField {
    public static final class EditField {
        public String column;
        public int titleRes;
        public int inputType;
+1 −1
Original line number Diff line number Diff line
@@ -411,7 +411,7 @@ class AccountTypeManagerImpl extends AccountTypeManager
                    Log.d(TAG, "Registering external account type=" + type
                            + ", packageName=" + auth.packageName);
                    accountType = new ExternalAccountType(mContext, auth.packageName, false);
                    if (!((ExternalAccountType) accountType).isInitialized()) {
                    if (!accountType.isInitialized()) {
                        // Skip external account types that couldn't be initialized.
                        continue;
                    }
+910 −24

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ import java.util.List;
 * {@link Data} rows of this kind, including the possible {@link EditType}
 * labels and editable {@link EditField}.
 */
public class DataKind {
public final class DataKind {

    public static final String PSEUDO_MIME_TYPE_DISPLAY_NAME = "#displayName";
    public static final String PSEUDO_MIME_TYPE_PHONETIC_NAME = "#phoneticName";
+0 −10
Original line number Diff line number Diff line
@@ -322,16 +322,6 @@ public class ExchangeAccountType extends BaseAccountType {
        return kind;
    }

    @Override
    public int getHeaderColor(Context context) {
        return 0xffd5ba96;
    }

    @Override
    public int getSideBarColor(Context context) {
        return 0xffb58e59;
    }

    @Override
    public boolean isGroupMembershipEditable() {
        return true;
Loading