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

Commit 59c540e3 authored by Max Loh's avatar Max Loh
Browse files

asl updated fields part 2

Bug: b/329902686
Test: Unit tests
Flag: NONE (Command-line tool which doesn't affect Android functionality)
Change-Id: Ie8095b6413743685ba7a0a254d758e1844686bd9
parent b94acf5e
Loading
Loading
Loading
Loading
+21 −116
Original line number Diff line number Diff line
@@ -25,99 +25,42 @@ import java.util.List;

/** AppInfo representation */
public class AppInfo implements AslMarshallable {
    private final String mTitle;
    private final String mDescription;
    private final Boolean mContainsAds;
    private final Boolean mObeyAps;
    private final Boolean mAdsFingerprinting;
    private final Boolean mSecurityFingerprinting;
    private final Boolean mApsCompliant;
    private final String mPrivacyPolicy;
    private final List<String> mSecurityEndpoints;
    private final List<String> mFirstPartyEndpoints;
    private final List<String> mServiceProviderEndpoints;
    private final String mCategory;
    private final String mEmail;
    private final String mWebsite;

    public AppInfo(
            String title,
            String description,
            Boolean containsAds,
            Boolean obeyAps,
            Boolean adsFingerprinting,
            Boolean securityFingerprinting,
            Boolean apsCompliant,
            String privacyPolicy,
            List<String> securityEndpoints,
            List<String> firstPartyEndpoints,
            List<String> serviceProviderEndpoints,
            String category,
            String email,
            String website) {
        this.mTitle = title;
        this.mDescription = description;
        this.mContainsAds = containsAds;
        this.mObeyAps = obeyAps;
        this.mAdsFingerprinting = adsFingerprinting;
        this.mSecurityFingerprinting = securityFingerprinting;
            List<String> serviceProviderEndpoints) {
        this.mApsCompliant = apsCompliant;
        this.mPrivacyPolicy = privacyPolicy;
        this.mSecurityEndpoints = securityEndpoints;
        this.mFirstPartyEndpoints = firstPartyEndpoints;
        this.mServiceProviderEndpoints = serviceProviderEndpoints;
        this.mCategory = category;
        this.mEmail = email;
        this.mWebsite = website;
    }

    /** Creates an on-device DOM element from the {@link SafetyLabels}. */
    @Override
    public List<Element> toOdDomElements(Document doc) {
        Element appInfoEle = XmlUtils.createPbundleEleWithName(doc, XmlUtils.OD_NAME_APP_INFO);
        if (this.mTitle != null) {
            appInfoEle.appendChild(XmlUtils.createOdStringEle(doc, XmlUtils.OD_NAME_TITLE, mTitle));
        }
        if (this.mDescription != null) {
            appInfoEle.appendChild(
                    XmlUtils.createOdStringEle(doc, XmlUtils.OD_NAME_DESCRIPTION, mDescription));
        }
        if (this.mContainsAds != null) {
            appInfoEle.appendChild(
                    XmlUtils.createOdBooleanEle(doc, XmlUtils.OD_NAME_CONTAINS_ADS, mContainsAds));
        }
        if (this.mObeyAps != null) {
            appInfoEle.appendChild(
                    XmlUtils.createOdBooleanEle(doc, XmlUtils.OD_NAME_OBEY_APS, mObeyAps));
        }
        if (this.mAdsFingerprinting != null) {
        if (this.mApsCompliant != null) {
            appInfoEle.appendChild(
                    XmlUtils.createOdBooleanEle(
                            doc, XmlUtils.OD_NAME_ADS_FINGERPRINTING, mAdsFingerprinting));
        }
        if (this.mSecurityFingerprinting != null) {
            appInfoEle.appendChild(
                    XmlUtils.createOdBooleanEle(
                            doc,
                            XmlUtils.OD_NAME_SECURITY_FINGERPRINTING,
                            mSecurityFingerprinting));
                            doc, XmlUtils.OD_NAME_APS_COMPLIANT, mApsCompliant));
        }
        if (this.mPrivacyPolicy != null) {
            appInfoEle.appendChild(
                    XmlUtils.createOdStringEle(
                            doc, XmlUtils.OD_NAME_PRIVACY_POLICY, mPrivacyPolicy));
        }
        if (this.mSecurityEndpoints != null) {
            appInfoEle.appendChild(
                    XmlUtils.createOdArray(
                            doc,
                            XmlUtils.OD_TAG_STRING_ARRAY,
                            XmlUtils.OD_NAME_SECURITY_ENDPOINT,
                            mSecurityEndpoints));
        }
        if (this.mFirstPartyEndpoints != null) {
            appInfoEle.appendChild(
                    XmlUtils.createOdArray(
                            doc,
                            XmlUtils.OD_TAG_STRING_ARRAY,
                            XmlUtils.OD_NAME_FIRST_PARTY_ENDPOINT,
                            XmlUtils.OD_NAME_FIRST_PARTY_ENDPOINTS,
                            mFirstPartyEndpoints));
        }
        if (this.mServiceProviderEndpoints != null) {
@@ -125,21 +68,9 @@ public class AppInfo implements AslMarshallable {
                    XmlUtils.createOdArray(
                            doc,
                            XmlUtils.OD_TAG_STRING_ARRAY,
                            XmlUtils.OD_NAME_SERVICE_PROVIDER_ENDPOINT,
                            XmlUtils.OD_NAME_SERVICE_PROVIDER_ENDPOINTS,
                            mServiceProviderEndpoints));
        }
        if (this.mCategory != null) {
            appInfoEle.appendChild(
                    XmlUtils.createOdStringEle(doc, XmlUtils.OD_NAME_CATEGORY, this.mCategory));
        }
        if (this.mEmail != null) {
            appInfoEle.appendChild(
                    XmlUtils.createOdStringEle(doc, XmlUtils.OD_NAME_EMAIL, this.mEmail));
        }
        if (this.mWebsite != null) {
            appInfoEle.appendChild(
                    XmlUtils.createOdStringEle(doc, XmlUtils.OD_NAME_WEBSITE, this.mWebsite));
        }
        return XmlUtils.listOf(appInfoEle);
    }

@@ -147,54 +78,28 @@ public class AppInfo implements AslMarshallable {
    @Override
    public List<Element> toHrDomElements(Document doc) {
        Element appInfoEle = doc.createElement(XmlUtils.HR_TAG_APP_INFO);
        if (this.mTitle != null) {
            appInfoEle.setAttribute(XmlUtils.HR_ATTR_TITLE, this.mTitle);
        }
        if (this.mDescription != null) {
            appInfoEle.setAttribute(XmlUtils.HR_ATTR_DESCRIPTION, this.mDescription);
        }
        if (this.mContainsAds != null) {
            appInfoEle.setAttribute(
                    XmlUtils.HR_ATTR_CONTAINS_ADS, String.valueOf(this.mContainsAds));
        }
        if (this.mObeyAps != null) {
            appInfoEle.setAttribute(XmlUtils.HR_ATTR_OBEY_APS, String.valueOf(this.mObeyAps));
        }
        if (this.mAdsFingerprinting != null) {
        if (this.mApsCompliant != null) {
            appInfoEle.setAttribute(
                    XmlUtils.HR_ATTR_ADS_FINGERPRINTING, String.valueOf(this.mAdsFingerprinting));
        }
        if (this.mSecurityFingerprinting != null) {
            appInfoEle.setAttribute(
                    XmlUtils.HR_ATTR_SECURITY_FINGERPRINTING,
                    String.valueOf(this.mSecurityFingerprinting));
                    XmlUtils.HR_ATTR_APS_COMPLIANT, String.valueOf(this.mApsCompliant));
        }
        if (this.mPrivacyPolicy != null) {
            appInfoEle.setAttribute(XmlUtils.HR_ATTR_PRIVACY_POLICY, this.mPrivacyPolicy);
        }
        if (this.mSecurityEndpoints != null) {
            appInfoEle.setAttribute(
                    XmlUtils.HR_ATTR_SECURITY_ENDPOINTS, String.join("|", this.mSecurityEndpoints));
        }

        if (this.mFirstPartyEndpoints != null) {
            appInfoEle.setAttribute(
                    XmlUtils.HR_ATTR_FIRST_PARTY_ENDPOINTS,
                    String.join("|", this.mFirstPartyEndpoints));
            appInfoEle.appendChild(
                    XmlUtils.createHrArray(
                            doc, XmlUtils.HR_TAG_FIRST_PARTY_ENDPOINTS, mFirstPartyEndpoints));
        }

        if (this.mServiceProviderEndpoints != null) {
            appInfoEle.setAttribute(
                    XmlUtils.HR_ATTR_SERVICE_PROVIDER_ENDPOINTS,
                    String.join("|", this.mServiceProviderEndpoints));
        }
        if (this.mCategory != null) {
            appInfoEle.setAttribute(XmlUtils.HR_ATTR_CATEGORY, this.mCategory);
        }
        if (this.mEmail != null) {
            appInfoEle.setAttribute(XmlUtils.HR_ATTR_EMAIL, this.mEmail);
        }
        if (this.mWebsite != null) {
            appInfoEle.setAttribute(XmlUtils.HR_ATTR_WEBSITE, this.mWebsite);
            appInfoEle.appendChild(
                    XmlUtils.createHrArray(
                            doc,
                            XmlUtils.HR_TAG_SERVICE_PROVIDER_ENDPOINTS,
                            mServiceProviderEndpoints));
        }

        return XmlUtils.listOf(appInfoEle);
    }
}
+12 −61
Original line number Diff line number Diff line
@@ -35,43 +35,19 @@ public class AppInfoFactory implements AslMarshallableFactory<AppInfo> {
            return null;
        }

        String title = XmlUtils.getStringAttr(appInfoEle, XmlUtils.HR_ATTR_TITLE, true);
        String description = XmlUtils.getStringAttr(appInfoEle, XmlUtils.HR_ATTR_DESCRIPTION, true);
        Boolean containsAds = XmlUtils.getBoolAttr(appInfoEle, XmlUtils.HR_ATTR_CONTAINS_ADS, true);
        Boolean obeyAps = XmlUtils.getBoolAttr(appInfoEle, XmlUtils.HR_ATTR_OBEY_APS, true);
        Boolean adsFingerprinting =
                XmlUtils.getBoolAttr(appInfoEle, XmlUtils.HR_ATTR_ADS_FINGERPRINTING, true);
        Boolean securityFingerprinting =
                XmlUtils.getBoolAttr(appInfoEle, XmlUtils.HR_ATTR_SECURITY_FINGERPRINTING, true);
        Boolean apsCompliant =
                XmlUtils.getBoolAttr(appInfoEle, XmlUtils.HR_ATTR_APS_COMPLIANT, true);
        String privacyPolicy =
                XmlUtils.getStringAttr(appInfoEle, XmlUtils.HR_ATTR_PRIVACY_POLICY, true);
        List<String> securityEndpoints =
                XmlUtils.getPipelineSplitAttr(
                        appInfoEle, XmlUtils.HR_ATTR_SECURITY_ENDPOINTS, true);
        List<String> firstPartyEndpoints =
                XmlUtils.getPipelineSplitAttr(
                        appInfoEle, XmlUtils.HR_ATTR_FIRST_PARTY_ENDPOINTS, true);
                XmlUtils.getHrItemsAsStrings(
                        appInfoEle, XmlUtils.HR_TAG_FIRST_PARTY_ENDPOINTS, true);
        List<String> serviceProviderEndpoints =
                XmlUtils.getPipelineSplitAttr(
                        appInfoEle, XmlUtils.HR_ATTR_SERVICE_PROVIDER_ENDPOINTS, true);
        String category = XmlUtils.getStringAttr(appInfoEle, XmlUtils.HR_ATTR_CATEGORY, true);
        String email = XmlUtils.getStringAttr(appInfoEle, XmlUtils.HR_ATTR_EMAIL, true);
        String website = XmlUtils.getStringAttr(appInfoEle, XmlUtils.HR_ATTR_WEBSITE, false);
                XmlUtils.getHrItemsAsStrings(
                        appInfoEle, XmlUtils.HR_TAG_SERVICE_PROVIDER_ENDPOINTS, true);

        return new AppInfo(
                title,
                description,
                containsAds,
                obeyAps,
                adsFingerprinting,
                securityFingerprinting,
                privacyPolicy,
                securityEndpoints,
                firstPartyEndpoints,
                serviceProviderEndpoints,
                category,
                email,
                website);
                apsCompliant, privacyPolicy, firstPartyEndpoints, serviceProviderEndpoints);
    }

    /** Creates an {@link AslMarshallableFactory} from on-device DOM elements */
@@ -83,42 +59,17 @@ public class AppInfoFactory implements AslMarshallableFactory<AppInfo> {
            return null;
        }

        String title = XmlUtils.getOdStringEle(appInfoEle, XmlUtils.OD_NAME_TITLE, true);
        String description =
                XmlUtils.getOdStringEle(appInfoEle, XmlUtils.OD_NAME_DESCRIPTION, true);
        Boolean containsAds =
                XmlUtils.getOdBoolEle(appInfoEle, XmlUtils.OD_NAME_CONTAINS_ADS, true);
        Boolean obeyAps = XmlUtils.getOdBoolEle(appInfoEle, XmlUtils.OD_NAME_OBEY_APS, true);
        Boolean adsFingerprinting =
                XmlUtils.getOdBoolEle(appInfoEle, XmlUtils.OD_NAME_ADS_FINGERPRINTING, true);
        Boolean securityFingerprinting =
                XmlUtils.getOdBoolEle(appInfoEle, XmlUtils.OD_NAME_SECURITY_FINGERPRINTING, true);
        Boolean apsCompliant =
                XmlUtils.getOdBoolEle(appInfoEle, XmlUtils.OD_NAME_APS_COMPLIANT, true);
        String privacyPolicy =
                XmlUtils.getOdStringEle(appInfoEle, XmlUtils.OD_NAME_PRIVACY_POLICY, true);
        List<String> securityEndpoints =
                XmlUtils.getOdStringArray(appInfoEle, XmlUtils.OD_NAME_SECURITY_ENDPOINT, true);
        List<String> firstPartyEndpoints =
                XmlUtils.getOdStringArray(appInfoEle, XmlUtils.OD_NAME_FIRST_PARTY_ENDPOINT, true);
                XmlUtils.getOdStringArray(appInfoEle, XmlUtils.OD_NAME_FIRST_PARTY_ENDPOINTS, true);
        List<String> serviceProviderEndpoints =
                XmlUtils.getOdStringArray(
                        appInfoEle, XmlUtils.OD_NAME_SERVICE_PROVIDER_ENDPOINT, true);
        String category = XmlUtils.getOdStringEle(appInfoEle, XmlUtils.OD_NAME_CATEGORY, true);
        String email = XmlUtils.getOdStringEle(appInfoEle, XmlUtils.OD_NAME_EMAIL, true);
        String website = XmlUtils.getOdStringEle(appInfoEle, XmlUtils.OD_NAME_WEBSITE, false);
                        appInfoEle, XmlUtils.OD_NAME_SERVICE_PROVIDER_ENDPOINTS, true);

        return new AppInfo(
                title,
                description,
                containsAds,
                obeyAps,
                adsFingerprinting,
                securityFingerprinting,
                privacyPolicy,
                securityEndpoints,
                firstPartyEndpoints,
                serviceProviderEndpoints,
                category,
                email,
                website);
                apsCompliant, privacyPolicy, firstPartyEndpoints, serviceProviderEndpoints);
    }
}
+0 −173
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.asllib.marshallable;

import com.android.asllib.util.XmlUtils;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

import java.util.List;

/** DeveloperInfo representation */
public class DeveloperInfo implements AslMarshallable {
    public enum DeveloperRelationship {
        OEM(0),
        ODM(1),
        SOC(2),
        OTA(3),
        CARRIER(4),
        AOSP(5),
        OTHER(6);

        private final int mValue;

        DeveloperRelationship(int value) {
            this.mValue = value;
        }

        /** Get the int value associated with the DeveloperRelationship. */
        public int getValue() {
            return mValue;
        }

        /** Get the DeveloperRelationship associated with the int value. */
        public static DeveloperInfo.DeveloperRelationship forValue(int value) {
            for (DeveloperInfo.DeveloperRelationship e : values()) {
                if (e.getValue() == value) {
                    return e;
                }
            }
            throw new IllegalArgumentException("No DeveloperRelationship enum for value: " + value);
        }

        /** Get the DeveloperRelationship associated with the human-readable String. */
        public static DeveloperInfo.DeveloperRelationship forString(String s) {
            for (DeveloperInfo.DeveloperRelationship e : values()) {
                if (e.toString().equals(s)) {
                    return e;
                }
            }
            throw new IllegalArgumentException("No DeveloperRelationship enum for str: " + s);
        }

        /** Human-readable String representation of DeveloperRelationship. */
        public String toString() {
            return this.name().toLowerCase();
        }
    }

    private final String mName;
    private final String mEmail;
    private final String mAddress;
    private final String mCountryRegion;
    private final DeveloperRelationship mDeveloperRelationship;
    private final String mWebsite;
    private final String mAppDeveloperRegistryId;

    public DeveloperInfo(
            String name,
            String email,
            String address,
            String countryRegion,
            DeveloperRelationship developerRelationship,
            String website,
            String appDeveloperRegistryId) {
        this.mName = name;
        this.mEmail = email;
        this.mAddress = address;
        this.mCountryRegion = countryRegion;
        this.mDeveloperRelationship = developerRelationship;
        this.mWebsite = website;
        this.mAppDeveloperRegistryId = appDeveloperRegistryId;
    }

    /** Creates an on-device DOM element from the {@link SafetyLabels}. */
    @Override
    public List<Element> toOdDomElements(Document doc) {
        Element developerInfoEle =
                XmlUtils.createPbundleEleWithName(doc, XmlUtils.OD_NAME_DEVELOPER_INFO);
        if (mName != null) {
            developerInfoEle.appendChild(
                    XmlUtils.createOdStringEle(doc, XmlUtils.OD_NAME_NAME, mName));
        }
        if (mEmail != null) {
            developerInfoEle.appendChild(
                    XmlUtils.createOdStringEle(doc, XmlUtils.OD_NAME_EMAIL, mEmail));
        }
        if (mAddress != null) {
            developerInfoEle.appendChild(
                    XmlUtils.createOdStringEle(doc, XmlUtils.OD_NAME_ADDRESS, mAddress));
        }
        if (mCountryRegion != null) {
            developerInfoEle.appendChild(
                    XmlUtils.createOdStringEle(
                            doc, XmlUtils.OD_NAME_COUNTRY_REGION, mCountryRegion));
        }
        if (mDeveloperRelationship != null) {
            developerInfoEle.appendChild(
                    XmlUtils.createOdLongEle(
                            doc,
                            XmlUtils.OD_NAME_DEVELOPER_RELATIONSHIP,
                            mDeveloperRelationship.getValue()));
        }
        if (mWebsite != null) {
            developerInfoEle.appendChild(
                    XmlUtils.createOdStringEle(doc, XmlUtils.OD_NAME_WEBSITE, mWebsite));
        }
        if (mAppDeveloperRegistryId != null) {
            developerInfoEle.appendChild(
                    XmlUtils.createOdStringEle(
                            doc,
                            XmlUtils.OD_NAME_APP_DEVELOPER_REGISTRY_ID,
                            mAppDeveloperRegistryId));
        }

        return XmlUtils.listOf(developerInfoEle);
    }

    /** Creates the human-readable DOM elements from the AslMarshallable Java Object. */
    @Override
    public List<Element> toHrDomElements(Document doc) {
        Element developerInfoEle = doc.createElement(XmlUtils.HR_TAG_DEVELOPER_INFO);
        if (mName != null) {
            developerInfoEle.setAttribute(XmlUtils.HR_ATTR_NAME, mName);
        }
        if (mEmail != null) {
            developerInfoEle.setAttribute(XmlUtils.HR_ATTR_EMAIL, mEmail);
        }
        if (mAddress != null) {
            developerInfoEle.setAttribute(XmlUtils.HR_ATTR_ADDRESS, mAddress);
        }
        if (mCountryRegion != null) {
            developerInfoEle.setAttribute(XmlUtils.HR_ATTR_COUNTRY_REGION, mCountryRegion);
        }
        if (mDeveloperRelationship != null) {
            developerInfoEle.setAttribute(
                    XmlUtils.HR_ATTR_DEVELOPER_RELATIONSHIP, mDeveloperRelationship.toString());
        }
        if (mWebsite != null) {
            developerInfoEle.setAttribute(XmlUtils.HR_ATTR_WEBSITE, mWebsite);
        }
        if (mAppDeveloperRegistryId != null) {
            developerInfoEle.setAttribute(
                    XmlUtils.HR_ATTR_APP_DEVELOPER_REGISTRY_ID, mAppDeveloperRegistryId);
        }

        return XmlUtils.listOf(developerInfoEle);
    }
}
+0 −96
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.asllib.marshallable;

import com.android.asllib.util.AslgenUtil;
import com.android.asllib.util.MalformedXmlException;
import com.android.asllib.util.XmlUtils;

import org.w3c.dom.Element;

import java.util.List;

public class DeveloperInfoFactory implements AslMarshallableFactory<DeveloperInfo> {

    /** Creates a {@link DeveloperInfo} from the human-readable DOM element. */
    @Override
    public DeveloperInfo createFromHrElements(List<Element> elements) throws MalformedXmlException {
        Element developerInfoEle = XmlUtils.getSingleElement(elements);
        if (developerInfoEle == null) {
            AslgenUtil.logI("No DeveloperInfo found in hr format.");
            return null;
        }
        String name = XmlUtils.getStringAttr(developerInfoEle, XmlUtils.HR_ATTR_NAME, true);
        String email = XmlUtils.getStringAttr(developerInfoEle, XmlUtils.HR_ATTR_EMAIL, true);
        String address = XmlUtils.getStringAttr(developerInfoEle, XmlUtils.HR_ATTR_ADDRESS, true);
        String countryRegion =
                XmlUtils.getStringAttr(developerInfoEle, XmlUtils.HR_ATTR_COUNTRY_REGION, true);
        DeveloperInfo.DeveloperRelationship developerRelationship =
                DeveloperInfo.DeveloperRelationship.forString(
                        XmlUtils.getStringAttr(
                                developerInfoEle, XmlUtils.HR_ATTR_DEVELOPER_RELATIONSHIP, true));
        String website = XmlUtils.getStringAttr(developerInfoEle, XmlUtils.HR_ATTR_WEBSITE, false);
        String appDeveloperRegistryId =
                XmlUtils.getStringAttr(
                        developerInfoEle, XmlUtils.HR_ATTR_APP_DEVELOPER_REGISTRY_ID, false);

        return new DeveloperInfo(
                name,
                email,
                address,
                countryRegion,
                developerRelationship,
                website,
                appDeveloperRegistryId);
    }

    /** Creates an {@link AslMarshallableFactory} from on-device DOM elements */
    @Override
    public DeveloperInfo createFromOdElements(List<Element> elements) throws MalformedXmlException {
        Element developerInfoEle = XmlUtils.getSingleElement(elements);
        if (developerInfoEle == null) {
            AslgenUtil.logI("No DeveloperInfo found in od format.");
            return null;
        }
        String name = XmlUtils.getOdStringEle(developerInfoEle, XmlUtils.OD_NAME_NAME, true);
        String email = XmlUtils.getOdStringEle(developerInfoEle, XmlUtils.OD_NAME_EMAIL, true);
        String address = XmlUtils.getOdStringEle(developerInfoEle, XmlUtils.OD_NAME_ADDRESS, true);
        String countryRegion =
                XmlUtils.getOdStringEle(developerInfoEle, XmlUtils.OD_NAME_COUNTRY_REGION, true);
        DeveloperInfo.DeveloperRelationship developerRelationship =
                DeveloperInfo.DeveloperRelationship.forValue(
                        (int)
                                (long)
                                        XmlUtils.getOdLongEle(
                                                developerInfoEle,
                                                XmlUtils.OD_NAME_DEVELOPER_RELATIONSHIP,
                                                true));
        String website = XmlUtils.getOdStringEle(developerInfoEle, XmlUtils.OD_NAME_WEBSITE, false);
        String appDeveloperRegistryId =
                XmlUtils.getOdStringEle(
                        developerInfoEle, XmlUtils.OD_NAME_APP_DEVELOPER_REGISTRY_ID, false);

        return new DeveloperInfo(
                name,
                email,
                address,
                countryRegion,
                developerRelationship,
                website,
                appDeveloperRegistryId);
    }
}
+1 −32

File changed.

Preview size limit exceeded, changes collapsed.

Loading