use of android.app.ActivityManager in project android_frameworks_base by ResurrectionRemix.
the class DocumentsApplication method onCreate.
@Override
public void onCreate() {
super.onCreate();
final ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
final int memoryClassBytes = am.getMemoryClass() * 1024 * 1024;
mRoots = new RootsCache(this);
mRoots.updateAsync(false);
mThumbnails = new ThumbnailCache(memoryClassBytes / 4);
final IntentFilter packageFilter = new IntentFilter();
packageFilter.addAction(Intent.ACTION_PACKAGE_ADDED);
packageFilter.addAction(Intent.ACTION_PACKAGE_CHANGED);
packageFilter.addAction(Intent.ACTION_PACKAGE_REMOVED);
packageFilter.addAction(Intent.ACTION_PACKAGE_DATA_CLEARED);
packageFilter.addDataScheme("package");
registerReceiver(mCacheReceiver, packageFilter);
final IntentFilter localeFilter = new IntentFilter();
localeFilter.addAction(Intent.ACTION_LOCALE_CHANGED);
registerReceiver(mCacheReceiver, localeFilter);
}
use of android.app.ActivityManager in project android_frameworks_base by ResurrectionRemix.
the class GLDepthTestActivity method detectOpenGLES20.
private boolean detectOpenGLES20() {
ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
ConfigurationInfo info = am.getDeviceConfigurationInfo();
return (info.reqGlEsVersion >= 0x20000);
}
use of android.app.ActivityManager in project android_frameworks_base by ResurrectionRemix.
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;
}
use of android.app.ActivityManager in project android_frameworks_base by ResurrectionRemix.
the class MemoryUsageTest method reportError.
private void reportError(String appName, String processName, Bundle results) {
ActivityManager am = (ActivityManager) getInstrumentation().getContext().getSystemService(Context.ACTIVITY_SERVICE);
List<ProcessErrorStateInfo> crashes = am.getProcessesInErrorState();
if (crashes != null) {
for (ProcessErrorStateInfo crash : crashes) {
if (!crash.processName.equals(processName))
continue;
Log.w(TAG, appName + " crashed: " + crash.shortMsg);
results.putString(mNameToResultKey.get(appName), crash.shortMsg);
return;
}
}
results.putString(mNameToResultKey.get(appName), "Crashed for unknown reason");
Log.w(TAG, appName + " not found in process list, most likely it is crashed");
}
use of android.app.ActivityManager in project android_frameworks_base by ResurrectionRemix.
the class LaunchActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_launch);
mBackgroundPolling = new Runnable() {
@Override
public void run() {
if (!mRunning) {
return;
}
ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
final int color = activityManager.getLockTaskModeState() != ActivityManager.LOCK_TASK_MODE_NONE ? 0xFFFFC0C0 : 0xFFFFFFFF;
findViewById(R.id.root_launch).setBackgroundColor(color);
mHandler.postDelayed(this, 1000);
}
};
mHandler = new Handler(Looper.getMainLooper());
}
Aggregations