use of android.app.ActivityManager.MemoryInfo in project android_frameworks_base by DirtyUnicorns.
the class SurfaceCompositionMeasuringActivity method getMemoryInfo.
private MemoryInfo getMemoryInfo() {
ActivityManager activityManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
MemoryInfo memInfo = new MemoryInfo();
activityManager.getMemoryInfo(memInfo);
return memInfo;
}
use of android.app.ActivityManager.MemoryInfo in project android_frameworks_base by DirtyUnicorns.
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);
}
use of android.app.ActivityManager.MemoryInfo in project android_frameworks_base by ResurrectionRemix.
the class TaskManager method readAvailMem.
private long readAvailMem() {
MemoryInfo mi = new MemoryInfo();
mActivityManager.getMemoryInfo(mi);
long availableMem = mi.availMem;
return availableMem;
}
use of android.app.ActivityManager.MemoryInfo in project android_frameworks_base by ResurrectionRemix.
the class TaskManager method readTotalMem.
private long readTotalMem() {
MemoryInfo mi = new MemoryInfo();
mActivityManager.getMemoryInfo(mi);
long totalMem = mi.totalMem;
return totalMem;
}
use of android.app.ActivityManager.MemoryInfo in project android_frameworks_base by ResurrectionRemix.
the class RecentController method updateMemoryStatus.
public void updateMemoryStatus() {
if (mMemText.getVisibility() == View.GONE || mMemBar.getVisibility() == View.GONE)
return;
MemoryInfo memInfo = new MemoryInfo();
mAm.getMemoryInfo(memInfo);
int available = (int) (memInfo.availMem / 1048576L);
int max = (int) (getTotalMemory() / 1048576L);
mMemText.setText(String.format(mContext.getResources().getString(R.string.recents_free_ram), available));
mMemBar.setMax(max);
mMemBar.setProgress(available);
mMemBar.getProgressDrawable().setColorFilter(mMembarcolor == 0x00ffffff ? mContext.getResources().getColor(R.color.system_accent_color) : mMembarcolor, Mode.MULTIPLY);
mMemText.setTextColor(mMemtextcolor == 0x00ffffff ? mContext.getResources().getColor(R.color.recents_membar_text_color) : mMemtextcolor);
}
Aggregations