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

Commit 91306bcc authored by Adam Lesinski's avatar Adam Lesinski Committed by Android (Google) Code Review
Browse files

Merge "Add FeatureGroup to PackageInfo" into lmp-dev

parents 3e3b251f d3edfde5
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -8526,6 +8526,15 @@ package android.content.pm {
    field public int reqTouchScreen;
  }
  public final class FeatureGroupInfo implements android.os.Parcelable {
    ctor public FeatureGroupInfo();
    ctor public FeatureGroupInfo(android.content.pm.FeatureGroupInfo);
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator CREATOR;
    field public android.content.pm.FeatureInfo[] features;
  }
  public class FeatureInfo implements android.os.Parcelable {
    ctor public FeatureInfo();
    ctor public FeatureInfo(android.content.pm.FeatureInfo);
@@ -8617,6 +8626,7 @@ package android.content.pm {
    field public android.content.pm.ActivityInfo[] activities;
    field public android.content.pm.ApplicationInfo applicationInfo;
    field public android.content.pm.ConfigurationInfo[] configPreferences;
    field public android.content.pm.FeatureGroupInfo[] featureGroups;
    field public long firstInstallTime;
    field public int[] gids;
    field public int installLocation;
+65 −0
Original line number Diff line number Diff line
/**
 * Copyright (C) 2014 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 android.content.pm;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * A set of features that can be requested by an application. This corresponds
 * to information collected from the
 * AndroidManifest.xml's {@code <feature-group>} tag.
 */
public final class FeatureGroupInfo implements Parcelable {

    /**
     * The list of features that are required by this group.
     *
     * @see FeatureInfo#FLAG_REQUIRED
     */
    public FeatureInfo[] features;

    public FeatureGroupInfo() {
    }

    public FeatureGroupInfo(FeatureGroupInfo other) {
        features = other.features;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeTypedArray(features, flags);
    }

    public static final Creator<FeatureGroupInfo> CREATOR = new Creator<FeatureGroupInfo>() {
        @Override
        public FeatureGroupInfo createFromParcel(Parcel source) {
            FeatureGroupInfo group = new FeatureGroupInfo();
            group.features = source.createTypedArray(FeatureInfo.CREATOR);
            return group;
        }

        @Override
        public FeatureGroupInfo[] newArray(int size) {
            return new FeatureGroupInfo[size];
        }
    };
}
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ import android.os.Parcelable;
/**
 * A single feature that can be requested by an application. This corresponds
 * to information collected from the
 * AndroidManifest.xml's &lt;uses-feature&gt; tag.
 * AndroidManifest.xml's {@code <uses-feature>} tag.
 */
public class FeatureInfo implements Parcelable {
    /**
+13 −1
Original line number Diff line number Diff line
@@ -191,6 +191,16 @@ public class PackageInfo implements Parcelable {
     */
    public FeatureInfo[] reqFeatures;

    /**
     * Groups of features that this application has requested.
     * Each group contains a set of features that are required.
     * A device must match the features listed in {@link #reqFeatures} and one
     * or more FeatureGroups in order to have satisfied the feature requirement.
     *
     * @see FeatureInfo#FLAG_REQUIRED
     */
    public FeatureGroupInfo[] featureGroups;

    /**
     * Constant corresponding to <code>auto</code> in
     * the {@link android.R.attr#installLocation} attribute.
@@ -300,6 +310,7 @@ public class PackageInfo implements Parcelable {
        dest.writeTypedArray(signatures, parcelableFlags);
        dest.writeTypedArray(configPreferences, parcelableFlags);
        dest.writeTypedArray(reqFeatures, parcelableFlags);
        dest.writeTypedArray(featureGroups, parcelableFlags);
        dest.writeInt(installLocation);
        dest.writeInt(requiredForAllUsers ? 1 : 0);
        dest.writeInt(requiredForProfile);
@@ -344,6 +355,7 @@ public class PackageInfo implements Parcelable {
        signatures = source.createTypedArray(Signature.CREATOR);
        configPreferences = source.createTypedArray(ConfigurationInfo.CREATOR);
        reqFeatures = source.createTypedArray(FeatureInfo.CREATOR);
        featureGroups = source.createTypedArray(FeatureGroupInfo.CREATOR);
        installLocation = source.readInt();
        requiredForAllUsers = source.readInt() != 0;
        requiredForProfile = source.readInt();
+3 −3
Original line number Diff line number Diff line
@@ -177,9 +177,9 @@ public abstract class PackageManager {
    /**
     * {@link PackageInfo} flag: return information about
     * hardware preferences in
     * {@link PackageInfo#configPreferences PackageInfo.configPreferences} and
     * requested features in {@link PackageInfo#reqFeatures
     * PackageInfo.reqFeatures}.
     * {@link PackageInfo#configPreferences PackageInfo.configPreferences},
     * and requested features in {@link PackageInfo#reqFeatures} and
     * {@link PackageInfo#featureGroups}.
     */
    public static final int GET_CONFIGURATIONS = 0x00004000;

Loading