Merge "Return TotalMemory size when ddr size is not present" am: 24e934c0c3 am: c1029121ac
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2583778 Change-Id: I94b51b86f028d7f19171aeca827cfe59f5d404a4 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1360,7 +1360,7 @@ public class Process {
|
||||
String formatSize = MemoryProperties.memory_ddr_size().orElse("0KB");
|
||||
long memSize = FileUtils.parseSize(formatSize);
|
||||
|
||||
if (memSize == Long.MIN_VALUE) {
|
||||
if (memSize <= 0) {
|
||||
return FileUtils.roundStorageSize(getTotalMemory());
|
||||
}
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ public class ProcessTest extends TestCase {
|
||||
}
|
||||
|
||||
public void testGetAdvertisedMem() {
|
||||
assertTrue(Process.getAdvertisedMem() > 0);
|
||||
assertTrue(Process.getTotalMemory() <= Process.getAdvertisedMem());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user