Search in sources :

Example 36 with FeatureInfo

use of android.content.pm.FeatureInfo in project android_frameworks_base by ResurrectionRemix.

the class SystemConfig method addFeature.

private void addFeature(String name, int version) {
    FeatureInfo fi = mAvailableFeatures.get(name);
    if (fi == null) {
        fi = new FeatureInfo();
        fi.name = name;
        fi.version = version;
        mAvailableFeatures.put(name, fi);
    } else {
        fi.version = Math.max(fi.version, version);
    }
}
Also used : FeatureInfo(android.content.pm.FeatureInfo)

Example 37 with FeatureInfo

use of android.content.pm.FeatureInfo in project android_frameworks_base by ResurrectionRemix.

the class CameraBinderTestUtils method isFeatureAvailable.

public static final boolean isFeatureAvailable(Context context, String feature) {
    final PackageManager packageManager = context.getPackageManager();
    final FeatureInfo[] featuresList = packageManager.getSystemAvailableFeatures();
    for (FeatureInfo f : featuresList) {
        if (f.name != null && f.name.equals(feature)) {
            return true;
        }
    }
    return false;
}
Also used : PackageManager(android.content.pm.PackageManager) FeatureInfo(android.content.pm.FeatureInfo)

Example 38 with FeatureInfo

use of android.content.pm.FeatureInfo in project android_frameworks_base by crdroidandroid.

the class CameraBinderTestUtils method isFeatureAvailable.

public static final boolean isFeatureAvailable(Context context, String feature) {
    final PackageManager packageManager = context.getPackageManager();
    final FeatureInfo[] featuresList = packageManager.getSystemAvailableFeatures();
    for (FeatureInfo f : featuresList) {
        if (f.name != null && f.name.equals(feature)) {
            return true;
        }
    }
    return false;
}
Also used : PackageManager(android.content.pm.PackageManager) FeatureInfo(android.content.pm.FeatureInfo)

Example 39 with FeatureInfo

use of android.content.pm.FeatureInfo in project android_frameworks_base by crdroidandroid.

the class SystemConfig method addFeature.

private void addFeature(String name, int version) {
    FeatureInfo fi = mAvailableFeatures.get(name);
    if (fi == null) {
        fi = new FeatureInfo();
        fi.name = name;
        fi.version = version;
        mAvailableFeatures.put(name, fi);
    } else {
        fi.version = Math.max(fi.version, version);
    }
}
Also used : FeatureInfo(android.content.pm.FeatureInfo)

Example 40 with FeatureInfo

use of android.content.pm.FeatureInfo in project countly-sdk-android by Countly.

the class CrashDetails method getOpenGL.

/**
 * Returns the current device openGL version.
 */
static String getOpenGL(Context context) {
    PackageManager packageManager = context.getPackageManager();
    FeatureInfo[] featureInfos = packageManager.getSystemAvailableFeatures();
    if (featureInfos != null && featureInfos.length > 0) {
        for (FeatureInfo featureInfo : featureInfos) {
            // Null feature name means this feature is the open gl es version feature.
            if (featureInfo.name == null) {
                if (featureInfo.reqGlEsVersion != FeatureInfo.GL_ES_VERSION_UNDEFINED) {
                    return Integer.toString((featureInfo.reqGlEsVersion & 0xffff0000) >> 16);
                } else {
                    // Lack of property means OpenGL ES version 1
                    return "1";
                }
            }
        }
    }
    return "1";
}
Also used : PackageManager(android.content.pm.PackageManager) FeatureInfo(android.content.pm.FeatureInfo)

Aggregations

FeatureInfo (android.content.pm.FeatureInfo)42 PackageManager (android.content.pm.PackageManager)23 PrintWriter (java.io.PrintWriter)4 ArrayList (java.util.ArrayList)4 FileReader (java.io.FileReader)3 IOException (java.io.IOException)3 NonNull (android.annotation.NonNull)2 IntentFilterVerificationInfo (android.content.pm.IntentFilterVerificationInfo)2 PackageParser (android.content.pm.PackageParser)2 ParceledListSlice (android.content.pm.ParceledListSlice)2 ArrayMap (android.util.ArrayMap)2 FastXmlSerializer (com.android.internal.util.FastXmlSerializer)2 IndentingPrintWriter (com.android.internal.util.IndentingPrintWriter)2 BufferedOutputStream (java.io.BufferedOutputStream)2 BufferedReader (java.io.BufferedReader)2 FileOutputStream (java.io.FileOutputStream)2 Map (java.util.Map)2 XmlSerializer (org.xmlpull.v1.XmlSerializer)2 RemoteException (android.os.RemoteException)1 NonNull (android.support.annotation.NonNull)1