Exemple #1
0
  @Override
  protected String readValue() {
    ImsLboPcscf[] lboPcscfs = null;

    try {
      ImsConfig imsConfig = mImsManager.getConfigInterface();
      lboPcscfs = imsConfig.getMasterLboPcscfValue();
    } catch (ImsException e) {
      e.printStackTrace();
    }

    return lboPcscfs[mIndex].getLboPcscfAddress();
  }
Exemple #2
0
  @Override
  protected void writeValue(String value) {
    ImsLboPcscf[] values = null;

    try {
      ImsConfig imsConfig = mImsManager.getConfigInterface();
      values = imsConfig.getMasterLboPcscfValue();

      values[mIndex].setLboPcscfAddress(value);
      imsConfig.setProvisionedLboPcscfValue(values);
    } catch (ImsException e) {
      e.printStackTrace();
    }
  }
Exemple #3
0
  @Override
  public void configureDmTree(MdmTree tree) {
    ImsConfig imsConfig = null;
    try {
      imsConfig = mImsManager.getConfigInterface();
    } catch (ImsException e) {
      e.printStackTrace();
    }

    // Normal Nodes
    registerNodeIoHandler(
        tree, "P-CSCF_Address", ConfigConstants.IMS_MO_PCSCF, true, StringHandler.class);
    registerNodeIoHandler(
        tree, "Timer_T1", ConfigConstants.SIP_T1_TIMER, true, IntegerHandler.class);
    registerNodeIoHandler(
        tree, "Timer_T2", ConfigConstants.SIP_T2_TIMER, true, IntegerHandler.class);
    registerNodeIoHandler(
        tree, "Timer_T4", ConfigConstants.SIP_TF_TIMER, true, IntegerHandler.class);
    registerNodeIoHandler(
        tree, "Private_user_identity", ConfigConstants.IMS_MO_IMPI, false, StringHandler.class);
    registerNodeIoHandler(
        tree,
        "Home_network_domain_name",
        ConfigConstants.IMS_MO_DOMAIN,
        false,
        StringHandler.class);
    registerNodeIoHandler(
        tree,
        "Resource_Allocation_Mode",
        ConfigConstants.IMS_MO_RESOURCE,
        true,
        BooleanHandler.class);
    registerNodeIoHandler(
        tree,
        "Voice_Domain_Preference_E_UTRAN",
        ConfigConstants.IMS_MO_VOICE_E,
        true,
        IntegerHandler.class);
    registerNodeIoHandler(
        tree,
        "SMS_Over_IP_Networks_Indication",
        ConfigConstants.IMS_MO_SMS,
        true,
        BooleanHandler.class);
    registerNodeIoHandler(
        tree, "Keep_Alive_Enabled", ConfigConstants.IMS_MO_KEEPALIVE, true, BooleanHandler.class);
    registerNodeIoHandler(
        tree,
        "Voice_Domain_Preference_UTRAN",
        ConfigConstants.IMS_MO_VOICE_U,
        true,
        IntegerHandler.class);
    registerNodeIoHandler(
        tree,
        "Mobility_Management_IMS_Voice_Termination",
        ConfigConstants.IMS_MO_MOBILITY,
        true,
        BooleanHandler.class);
    registerNodeIoHandler(
        tree, "RegRetryBaseTime", ConfigConstants.IMS_MO_REG_BASE, true, IntegerHandler.class);
    registerNodeIoHandler(
        tree, "RegRetryMaxTime", ConfigConstants.IMS_MO_REG_MAX, true, IntegerHandler.class);
    // Public User Identity List
    try {
      // 1. clear old nodes
      for (String child : tree.listChildren(PUBLIC_USER_IDENTITY_LIST_PATH)) {
        tree.deleteNode(MdmTree.makeUri(PUBLIC_USER_IDENTITY_LIST_PATH, child));
      }
      // 2. create new nodes
      String[] publicUserIdentities =
          imsConfig.getMasterStringArrayValue(ConfigConstants.IMS_MO_IMPU);
      for (int i = 0; i < publicUserIdentities.length; ++i) {
        Log.d(TAG.NODEIOHANDLER, "publicUserIdentities[i] is " + publicUserIdentities[i]);
        if (publicUserIdentities[i] == null) {
          continue;
        }
        String nodeXId = Integer.toString(i + 1);
        tree.addInteriorChildNode(PUBLIC_USER_IDENTITY_LIST_PATH, nodeXId, null);
        String leafUri =
            MdmTree.makeUri(PUBLIC_USER_IDENTITY_LIST_PATH, nodeXId, "Public_user_identity");
        Utilities.addLeafNodeChecked(
            tree, leafUri, "chr", null, publicUserIdentities[i].getBytes());
        tree.replaceACL(leafUri, "Get=*");
      }
    } catch (MdmException e) {
      throw new Error(e);
    } catch (ImsException e) {
      throw new Error(e);
    }

    // ICSI List
    try {
      // 1. clear old nodes
      for (String child : tree.listChildren(ICSI_LIST_PATH)) {
        tree.deleteNode(MdmTree.makeUri(ICSI_LIST_PATH, child));
      }
      // 2. create new nodes & register handlers
      ImsIcsi[] icsiList = imsConfig.getMasterIcsiValue();
      for (int i = 0; i < icsiList.length; ++i) {
        if (icsiList[i] == null) {
          continue;
        }
        String nodeXId = Integer.toString(i + 1);
        tree.addInteriorChildNode(ICSI_LIST_PATH, nodeXId, null);
        String leafUri = MdmTree.makeUri(ICSI_LIST_PATH, nodeXId, "ICSI");
        String data = icsiList[i].getIcsi();
        Utilities.addLeafNodeChecked(
            tree, leafUri, "chr", null, (data == null ? null : data.getBytes()));
        tree.replaceACL(leafUri, "Get=*&Replace=*");
        tree.registerNodeIoHandler(leafUri, new ICSIHandler(leafUri, mImsManager, i));
        leafUri = MdmTree.makeUri(ICSI_LIST_PATH, nodeXId, "ICSI_Resource_Allocation_Mode");
        Utilities.addLeafNodeChecked(
            tree, leafUri, "bool", null, (icsiList[i].getIsAllocated() ? "1" : "0").getBytes());
        tree.replaceACL(leafUri, "Get=*&Replace=*");
        tree.registerNodeIoHandler(leafUri, new ICSIModeHandler(leafUri, mImsManager, i));
      }
    } catch (MdmException e) {
      throw new Error(e);
    } catch (ImsException e) {
      throw new Error(e);
    }

    // LBO P-CSCF Address
    try {
      // 1. clear old nodes
      for (String child : tree.listChildren(LBO_PCSCF_ADDRESS_PATH)) {
        tree.deleteNode(MdmTree.makeUri(LBO_PCSCF_ADDRESS_PATH, child));
      }
      // 2. create new nodes & register handlers
      ImsLboPcscf[] addressList = imsConfig.getMasterLboPcscfValue();
      for (int i = 0; i < addressList.length; ++i) {
        if (addressList[i] == null) {
          continue;
        }
        String nodeXId = Integer.toString(i + 1);
        tree.addInteriorChildNode(LBO_PCSCF_ADDRESS_PATH, nodeXId, null);
        String leafUri = MdmTree.makeUri(LBO_PCSCF_ADDRESS_PATH, nodeXId, "Address");
        String data = addressList[i].getLboPcscfAddress();
        Utilities.addLeafNodeChecked(
            tree, leafUri, "chr", null, (data == null ? null : data.getBytes()));
        tree.replaceACL(leafUri, "Get=*&Replace=*");
        tree.registerNodeIoHandler(leafUri, new PCSCFAddressHandler(leafUri, mImsManager, i));
        leafUri = MdmTree.makeUri(LBO_PCSCF_ADDRESS_PATH, nodeXId, "AddressType");
        data = addressList[i].getLboPcscfAddressType();
        Utilities.addLeafNodeChecked(
            tree, leafUri, "chr", null, (data == null ? null : data.getBytes()));
        tree.replaceACL(leafUri, "Get=*&Replace=*");
        tree.registerNodeIoHandler(leafUri, new PCSCFAddressTypeHandler(leafUri, mImsManager, i));
      }
    } catch (MdmException e) {
      throw new Error(e);
    } catch (ImsException e) {
      throw new Error(e);
    }

    // Phone Context List
    try {
      // 1. clear old nodes
      for (String child : tree.listChildren(PHONE_CONTEXT_LIST_PATH)) {
        tree.deleteNode(MdmTree.makeUri(PHONE_CONTEXT_LIST_PATH, child));
      }
      // 2. create new nodes & register handlers
      ImsPhoneCtx[] contextList = imsConfig.getMasterImsPhoneCtxValue();
      for (int i = 0; i < contextList.length; ++i) {
        if (contextList[i] == null) {
          continue;
        }
        String nodeXId = Integer.toString(i + 1);
        tree.addInteriorChildNode(PHONE_CONTEXT_LIST_PATH, nodeXId, null);
        String leafUri = MdmTree.makeUri(PHONE_CONTEXT_LIST_PATH, nodeXId, "PhoneContext");
        String data = contextList[i].getPhoneCtx();
        Utilities.addLeafNodeChecked(
            tree, leafUri, "chr", null, (data == null ? null : data.getBytes()));
        tree.replaceACL(leafUri, "Get=*&Replace=*");
        tree.registerNodeIoHandler(leafUri, new PhoneContextHandler(leafUri, mImsManager, i));
        leafUri = MdmTree.makeUri(PHONE_CONTEXT_LIST_PATH, nodeXId, "Public_user_identity");
        data = contextList[i].getPhoneCtxIpuis()[0];
        Utilities.addLeafNodeChecked(
            tree, leafUri, "chr", null, (data == null ? null : data.getBytes()));
        tree.replaceACL(leafUri, "Get=*&Replace=*");
        tree.registerNodeIoHandler(
            leafUri, new PhoneContextIdentityHandler(leafUri, mImsManager, i));
      }
    } catch (MdmException e) {
      throw new Error(e);
    } catch (ImsException e) {
      throw new Error(e);
    }

    // RCS-related
    try {
      String uri = MdmTree.makeUri(RCS_PATH, "AuthType");
      tree.registerNodeIoHandler(uri, new RCSAuthTypeHandler(uri, mImsManager));
      uri = MdmTree.makeUri(RCS_PATH, "Realm");
      tree.registerNodeIoHandler(uri, new RCSRealmHandler(uri, mImsManager));
      uri = MdmTree.makeUri(RCS_PATH, "UserName");
      tree.registerNodeIoHandler(uri, new RCSUserNameHandler(uri, mImsManager));
      uri = MdmTree.makeUri(RCS_PATH, "UserPwd");
      tree.registerNodeIoHandler(uri, new RCSUserPwdHandler(uri, mImsManager));
    } catch (MdmException e) {
      throw new Error(e);
    }

    // Write back
    try {
      tree.writeToPersistentStorage();
    } catch (MdmException e) {
      throw new Error(e);
    }
  }