Search in sources :

Example 26 with MemoryInfo

use of android.app.ActivityManager.MemoryInfo in project android_frameworks_base by crdroidandroid.

the class SurfaceCompositionMeasuringActivity method updateSystemInfo.

private void updateSystemInfo(int pixelFormat) {
    int visibleCnt = 0;
    for (int i = 0; i < mViews.size(); ++i) {
        if (mViews.get(i).getVisibility() == View.VISIBLE) {
            ++visibleCnt;
        }
    }
    MemoryInfo memInfo = getMemoryInfo();
    String platformName = mAndromeda ? "Andromeda" : "Android";
    String info = platformName + ": available " + getReadableMemory(memInfo.availMem) + " from " + getReadableMemory(memInfo.totalMem) + ".\nVisible " + visibleCnt + " from " + mViews.size() + " " + getPixelFormatInfo(pixelFormat) + " surfaces.\n" + "View size: " + mWidth + "x" + mHeight + ". Refresh rate: " + DOUBLE_FORMAT.format(mRefreshRate) + ".";
    mSystemInfoView.setText(info);
}
Also used : MemoryInfo(android.app.ActivityManager.MemoryInfo)

Aggregations

MemoryInfo (android.app.ActivityManager.MemoryInfo)26 ActivityManager (android.app.ActivityManager)12 Point (android.graphics.Point)2 SuppressLint (android.annotation.SuppressLint)1 DisplayMetrics (android.util.DisplayMetrics)1 Display (android.view.Display)1 Timer (java.util.Timer)1 TimerTask (java.util.TimerTask)1