зеркало из https://github.com/mozilla/gecko-dev.git
Bug 867360 - Add onTrimMemory handler to sutagent; r=jmaher
This commit is contained in:
Родитель
232007da3f
Коммит
2ac6fe10bf
|
@ -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()
|
||||
|
|
Загрузка…
Ссылка в новой задаче