-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#273: Improved "memory low" event detection.
- Loading branch information
Showing
5 changed files
with
132 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
app/src/main/java/fr/ralala/hexviewer/utils/memory/MemoryInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package fr.ralala.hexviewer.utils.memory; | ||
|
||
/** | ||
* ****************************************************************************** | ||
* <p><b>Project HexViewer</b><br/> | ||
* Memory info. | ||
* </p> | ||
* | ||
* @author Keidan | ||
* <p> | ||
* License: GPLv3 | ||
* </p> | ||
* ****************************************************************************** | ||
*/ | ||
public class MemoryInfo { | ||
private long mTotalMemory = 0L; | ||
private long mUsedMemory = 0L; | ||
private long mTotalFreeMemory = 0L; | ||
private double mPercentUsed = 0.0; | ||
|
||
public long getTotalMemory() { | ||
return mTotalMemory; | ||
} | ||
|
||
public void setTotalMemory(long totalMemory) { | ||
mTotalMemory = totalMemory; | ||
} | ||
|
||
public long getUsedMemory() { | ||
return mUsedMemory; | ||
} | ||
|
||
public void setUsedMemory(long usedMemory) { | ||
mUsedMemory = usedMemory; | ||
} | ||
|
||
public long getTotalFreeMemory() { | ||
return mTotalFreeMemory; | ||
} | ||
|
||
public void setTotalFreeMemory(long totalFreeMemory) { | ||
mTotalFreeMemory = totalFreeMemory; | ||
} | ||
|
||
public double getPercentUsed() { | ||
return mPercentUsed; | ||
} | ||
|
||
public void setPercentUsed(double percentUsed) { | ||
mPercentUsed = percentUsed; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
app/src/main/java/fr/ralala/hexviewer/utils/memory/MemoryListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package fr.ralala.hexviewer.utils.memory; | ||
|
||
/** | ||
* ****************************************************************************** | ||
* <p><b>Project HexViewer</b><br/> | ||
* Memory listener. | ||
* </p> | ||
* | ||
* @author Keidan | ||
* <p> | ||
* License: GPLv3 | ||
* </p> | ||
* ****************************************************************************** | ||
*/ | ||
public interface MemoryListener { | ||
void onLowAppMemory(boolean disabled, MemoryInfo mi); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters