use of android.content.pm.ConfigurationInfo in project android_frameworks_base by ParanoidAndroid.
the class ActivityManagerService method getDeviceConfigurationInfo.
// =========================================================
// CONFIGURATION
// =========================================================
public ConfigurationInfo getDeviceConfigurationInfo() {
ConfigurationInfo config = new ConfigurationInfo();
synchronized (this) {
config.reqTouchScreen = mConfiguration.touchscreen;
config.reqKeyboardType = mConfiguration.keyboard;
config.reqNavigation = mConfiguration.navigation;
if (mConfiguration.navigation == Configuration.NAVIGATION_DPAD || mConfiguration.navigation == Configuration.NAVIGATION_TRACKBALL) {
config.reqInputFeatures |= ConfigurationInfo.INPUT_FEATURE_FIVE_WAY_NAV;
}
if (mConfiguration.keyboard != Configuration.KEYBOARD_UNDEFINED && mConfiguration.keyboard != Configuration.KEYBOARD_NOKEYS) {
config.reqInputFeatures |= ConfigurationInfo.INPUT_FEATURE_HARD_KEYBOARD;
}
config.reqGlEsVersion = GL_ES_VERSION;
}
return config;
}
use of android.content.pm.ConfigurationInfo in project android_frameworks_base by ParanoidAndroid.
the class ActivityManagerTest method testGetDeviceConfigurationInfo.
@SmallTest
public void testGetDeviceConfigurationInfo() throws Exception {
ConfigurationInfo config = mActivityManager.getDeviceConfigurationInfo();
assertNotNull(config);
// Validate values against configuration retrieved from resources
Configuration vconfig = mContext.getResources().getConfiguration();
assertNotNull(vconfig);
assertEquals(config.reqKeyboardType, vconfig.keyboard);
assertEquals(config.reqTouchScreen, vconfig.touchscreen);
assertEquals(config.reqNavigation, vconfig.navigation);
if (vconfig.navigation == Configuration.NAVIGATION_NONAV) {
assertNotNull(config.reqInputFeatures & ConfigurationInfo.INPUT_FEATURE_FIVE_WAY_NAV);
}
if (vconfig.keyboard != Configuration.KEYBOARD_UNDEFINED) {
assertNotNull(config.reqInputFeatures & ConfigurationInfo.INPUT_FEATURE_HARD_KEYBOARD);
}
}
use of android.content.pm.ConfigurationInfo in project android-gpuimage by CyberAgent.
the class GPUImage method supportsOpenGLES2.
/**
* Checks if OpenGL ES 2.0 is supported on the current device.
*
* @param context the context
* @return true, if successful
*/
private boolean supportsOpenGLES2(final Context context) {
final ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
return configurationInfo.reqGlEsVersion >= 0x20000;
}
use of android.content.pm.ConfigurationInfo in project StickerCamera by Skykai521.
the class GPUImage method supportsOpenGLES2.
/**
* Checks if OpenGL ES 2.0 is supported on the current device.
*
* @param context the context
* @return true, if successful
*/
private boolean supportsOpenGLES2(final Context context) {
final ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
return configurationInfo.reqGlEsVersion >= 0x20000;
}
use of android.content.pm.ConfigurationInfo in project android_frameworks_base by DirtyUnicorns.
the class MffContext method getPlatformSupportsGLES2.
private static boolean getPlatformSupportsGLES2(Context context) {
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
ConfigurationInfo configurationInfo = am.getDeviceConfigurationInfo();
return configurationInfo.reqGlEsVersion >= 0x20000;
}
Aggregations