1/**
2 * Copyright (C) 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy
6 * of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations
14 * under the License.
15 */
16package android.content.pm;
17
18import android.os.Parcel;
19import android.os.Parcelable;
20
21/**
22 * A set of features that can be requested by an application. This corresponds
23 * to information collected from the
24 * AndroidManifest.xml's {@code <feature-group>} tag.
25 */
26public final class FeatureGroupInfo implements Parcelable {
27
28    /**
29     * The list of features that are required by this group.
30     *
31     * @see FeatureInfo#FLAG_REQUIRED
32     */
33    public FeatureInfo[] features;
34
35    public FeatureGroupInfo() {
36    }
37
38    public FeatureGroupInfo(FeatureGroupInfo other) {
39        features = other.features;
40    }
41
42    @Override
43    public int describeContents() {
44        return 0;
45    }
46
47    @Override
48    public void writeToParcel(Parcel dest, int flags) {
49        dest.writeTypedArray(features, flags);
50    }
51
52    public static final Creator<FeatureGroupInfo> CREATOR = new Creator<FeatureGroupInfo>() {
53        @Override
54        public FeatureGroupInfo createFromParcel(Parcel source) {
55            FeatureGroupInfo group = new FeatureGroupInfo();
56            group.features = source.createTypedArray(FeatureInfo.CREATOR);
57            return group;
58        }
59
60        @Override
61        public FeatureGroupInfo[] newArray(int size) {
62            return new FeatureGroupInfo[size];
63        }
64    };
65}
66