Merge "Return TotalMemory size when ddr size is not present" into udc-dev am: 6a9af3fd32
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23120746 Change-Id: Id6835463f7e0b1fab2404976ea2ea77dd6d7912a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1359,7 +1359,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