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

Commit 68a788ff authored by Michael W's avatar Michael W
Browse files

Dialer: Cleanup BaseAccountType

* Remove all messengers - they are deprecated - leaving only
  "custom" behind (like GoogleAccountType and deprecation notice also
  says to do)
* Align PhoneType and EmailType with Google as well -
  we also did that on Contacts already - see commit e0b9c83 and
  commit 573c7bc

Change-Id: I85bf768e138fdea250d3565e7592f7f803332a46
parent 06f20284
Loading
Loading
Loading
Loading
+5 −73
Original line number Diff line number Diff line
@@ -312,28 +312,17 @@ public abstract class BaseAccountType extends AccountType {
    kind.actionBody = new SimpleInflater(Phone.NUMBER);
    kind.typeColumn = Phone.TYPE;
    kind.typeList = new ArrayList<>();
    kind.typeList = new ArrayList<>();
    kind.typeList.add(buildPhoneType(Phone.TYPE_MOBILE));
    kind.typeList.add(buildPhoneType(Phone.TYPE_HOME));
    kind.typeList.add(buildPhoneType(Phone.TYPE_WORK));
    kind.typeList.add(buildPhoneType(Phone.TYPE_HOME));
    kind.typeList.add(buildPhoneType(Phone.TYPE_MAIN));
    kind.typeList.add(buildPhoneType(Phone.TYPE_FAX_WORK).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_FAX_HOME).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_PAGER).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_OTHER));
    kind.typeList.add(
            buildPhoneType(Phone.TYPE_CUSTOM).setSecondary(true).setCustomColumn(Phone.LABEL));
    kind.typeList.add(buildPhoneType(Phone.TYPE_CALLBACK).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_CAR).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_COMPANY_MAIN).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_ISDN).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_MAIN).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_OTHER_FAX).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_RADIO).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_TELEX).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_TTY_TDD).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_WORK_MOBILE).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_WORK_PAGER).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_ASSISTANT).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_MMS).setSecondary(true));

    kind.fieldList = new ArrayList<>();
    kind.fieldList.add(new EditField(Phone.NUMBER, R.string.phoneLabelsGroup, FLAGS_PHONE));
@@ -352,7 +341,6 @@ public abstract class BaseAccountType extends AccountType {
    kind.typeList.add(buildEmailType(Email.TYPE_HOME));
    kind.typeList.add(buildEmailType(Email.TYPE_WORK));
    kind.typeList.add(buildEmailType(Email.TYPE_OTHER));
    kind.typeList.add(buildEmailType(Email.TYPE_MOBILE));
    kind.typeList.add(
        buildEmailType(Email.TYPE_CUSTOM).setSecondary(true).setCustomColumn(Email.LABEL));

@@ -405,14 +393,6 @@ public abstract class BaseAccountType extends AccountType {

    kind.typeColumn = Im.PROTOCOL;
    kind.typeList = new ArrayList<>();
    kind.typeList.add(buildImType(Im.PROTOCOL_AIM));
    kind.typeList.add(buildImType(Im.PROTOCOL_MSN));
    kind.typeList.add(buildImType(Im.PROTOCOL_YAHOO));
    kind.typeList.add(buildImType(Im.PROTOCOL_SKYPE));
    kind.typeList.add(buildImType(Im.PROTOCOL_QQ));
    kind.typeList.add(buildImType(Im.PROTOCOL_GOOGLE_TALK));
    kind.typeList.add(buildImType(Im.PROTOCOL_ICQ));
    kind.typeList.add(buildImType(Im.PROTOCOL_JABBER));
    kind.typeList.add(
        buildImType(Im.PROTOCOL_CUSTOM).setSecondary(true).setCustomColumn(Im.CUSTOM_PROTOCOL));

@@ -769,33 +749,9 @@ public abstract class BaseAccountType extends AccountType {

    @Override
    protected int getTypeLabelResource(Integer type) {
      if (type == null) {
        return R.string.chat;
      }
      switch (type) {
        case Im.PROTOCOL_AIM:
          return R.string.chat_aim;
        case Im.PROTOCOL_MSN:
          return R.string.chat_msn;
        case Im.PROTOCOL_YAHOO:
          return R.string.chat_yahoo;
        case Im.PROTOCOL_SKYPE:
          return R.string.chat_skype;
        case Im.PROTOCOL_QQ:
          return R.string.chat_qq;
        case Im.PROTOCOL_GOOGLE_TALK:
          return R.string.chat_gtalk;
        case Im.PROTOCOL_ICQ:
          return R.string.chat_icq;
        case Im.PROTOCOL_JABBER:
          return R.string.chat_jabber;
        case Im.PROTOCOL_NETMEETING:
          return R.string.chat;
        default:
      return R.string.chat;
    }
  }
  }

  // TODO Extract it to its own class, and move all KindBuilders to it as well.
  private static class KindParser {
@@ -1479,30 +1435,6 @@ public abstract class BaseAccountType extends AccountType {

    @Override
    protected EditType buildEditTypeForTypeTag(AttributeSet attrs, String type) {
      if ("aim".equals(type)) {
        return buildImType(Im.PROTOCOL_AIM);
      }
      if ("msn".equals(type)) {
        return buildImType(Im.PROTOCOL_MSN);
      }
      if ("yahoo".equals(type)) {
        return buildImType(Im.PROTOCOL_YAHOO);
      }
      if ("skype".equals(type)) {
        return buildImType(Im.PROTOCOL_SKYPE);
      }
      if ("qq".equals(type)) {
        return buildImType(Im.PROTOCOL_QQ);
      }
      if ("google_talk".equals(type)) {
        return buildImType(Im.PROTOCOL_GOOGLE_TALK);
      }
      if ("icq".equals(type)) {
        return buildImType(Im.PROTOCOL_ICQ);
      }
      if ("jabber".equals(type)) {
        return buildImType(Im.PROTOCOL_JABBER);
      }
      if ("custom".equals(type)) {
        return buildImType(Im.PROTOCOL_CUSTOM)
            .setSecondary(true)