163498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann/*
263498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann * Copyright (C) 2016 The Android Open Source Project
363498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann *
463498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann * Licensed under the Apache License, Version 2.0 (the "License");
563498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann * you may not use this file except in compliance with the License.
663498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann * You may obtain a copy of the License at
763498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann *
863498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann *      http://www.apache.org/licenses/LICENSE-2.0
963498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann *
1063498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann * Unless required by applicable law or agreed to in writing, software
1163498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann * distributed under the License is distributed on an "AS IS" BASIS,
1263498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1363498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann * See the License for the specific language governing permissions and
1463498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann * limitations under the License.
1563498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann */
1663498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmannpackage com.android.printservice.recommendation.plugin.xerox;
1763498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann
1863498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmannimport android.content.res.Resources;
1963498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann
2063498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmannimport java.util.Arrays;
2163498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann
2263498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmannfinal class VendorInfo {
2363498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann
2463498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann    public final String mPackageName;
2563498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann    public final String mVendorID;
2663498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann    public final String[] mDNSValues;
2763498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann    public final int mID;
2863498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann
2963498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann    public VendorInfo(Resources resources, int vendor_info_id) {
3063498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann        mID = vendor_info_id;
3163498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann        String[] data = resources.getStringArray(vendor_info_id);
3263498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann        if ((data == null) || (data.length < 2)) {
3363498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann            data = new String[]{null, null};
3463498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann        }
3563498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann        mPackageName = data[0];
3663498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann        mVendorID = data[1];
3763498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann        mDNSValues = (data.length > 2) ? Arrays.copyOfRange(data, 2, data.length) : new String[]{};
3863498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann    }
3963498afff8079a5b70d763688d634ecdf7086f72Philip P. Moltmann}
40