// FIXME: It looks like outInfo.lowMemory does not work well as we expected.
// after run command: adb shell fillup -p 100, outInfo.lowMemory is still false.
private static boolean isLowMemory(Context context) {
if (null == context) {
return false;
}
ActivityManager am = (ActivityManager)
context.getSystemService(Context.ACTIVITY_SERVICE);
ActivityManager.MemoryInfo outInfo = new ActivityManager.MemoryInfo();
am.getMemoryInfo(outInfo);
return outInfo.lowMemory;
}