mirror of
https://github.com/emanuele-f/PCAPdroid.git
synced 2026-07-03 21:21:12 +08:00
Avoid spamming of low memory notifications
This commit is contained in:
parent
794a9522a1
commit
ef45343175
@ -1037,11 +1037,11 @@ public class CaptureService extends VpnService implements Runnable {
|
||||
public void onTrimMemory(int level) {
|
||||
String lvlStr = Utils.trimlvl2str(level);
|
||||
boolean lowMemory = (level != TRIM_MEMORY_UI_HIDDEN) && (level >= TRIM_MEMORY_RUNNING_LOW);
|
||||
boolean critical = lowMemory && (level >= TRIM_MEMORY_RUNNING_CRITICAL);
|
||||
boolean critical = lowMemory && (level >= TRIM_MEMORY_COMPLETE);
|
||||
|
||||
Log.w(TAG, "onTrimMemory: " + lvlStr + " - low= " + lowMemory + ", critical=" + critical);
|
||||
|
||||
if(lowMemory)
|
||||
if(critical && !mLowMemory)
|
||||
handleLowMemory();
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user