Java Code Examples for android.content.pm.FeatureInfo#GL_ES_VERSION_UNDEFINED

The following examples show how to use android.content.pm.FeatureInfo#GL_ES_VERSION_UNDEFINED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DeviceInfo.java    From COCOFramework with Apache License 2.0 6 votes vote down vote up
private String getOpenGLVersion() {
    Context context = getActivity();
    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 String.valueOf((featureInfo.reqGlEsVersion & 0xFFFF0000) >> 16) + "." + String.valueOf((featureInfo.reqGlEsVersion & 0x0000FFFF));
                } else {
                    return "1.0"; // Lack of property means OpenGL ES version 1
                }
            }
        }
    }
    return "1.0";
}