Bug 867360 - Add onTrimMemory handler to sutagent; r=jmaher

This commit is contained in:
Geoff Brown 2013-05-28 08:43:28 -06:00
Родитель 232007da3f
Коммит 2ac6fe10bf
1 изменённых файлов: 17 добавлений и 5 удалений

Просмотреть файл

@ -395,14 +395,12 @@ public class SUTAgentAndroid extends Activity
}
}
@Override
public void onLowMemory()
private void logMemory(String caller)
{
System.gc();
DoCommand dc = new DoCommand(getApplication());
if (dc != null)
{
log(dc, "onLowMemory");
log(dc, caller);
log(dc, dc.GetMemoryInfo());
String procInfo = dc.GetProcessInfo();
if (procInfo != null)
@ -424,10 +422,24 @@ public class SUTAgentAndroid extends Activity
}
else
{
Log.e("SUTAgentAndroid", "onLowMemory: unable to log to file!");
Log.e("SUTAgentAndroid", "logMemory: unable to log to file!");
}
}
@Override
public void onLowMemory()
{
System.gc();
logMemory("onLowMemory");
}
@Override
public void onTrimMemory(int level)
{
System.gc();
logMemory("onTrimMemory"+level);
}
private void monitorBatteryState()
{
battReceiver = new BroadcastReceiver()