change memory requirements for managed profile support

Test: atest FeatureTest
Bug: 190583525
Change-Id: Ia9d3b0c97c99e23bf78f2dfddaf9d3284ba48d86
diff --git a/tests/tests/content/src/android/content/pm/cts/FeatureTest.java b/tests/tests/content/src/android/content/pm/cts/FeatureTest.java
index beab1c4..68edc76 100644
--- a/tests/tests/content/src/android/content/pm/cts/FeatureTest.java
+++ b/tests/tests/content/src/android/content/pm/cts/FeatureTest.java
@@ -32,12 +32,14 @@
 public class FeatureTest extends AndroidTestCase {
 
     private static final String TAG = "FeatureTest";
+    private static final long TWO_GB = 1536000000; // 2 GB
 
     private PackageManager mPackageManager;
     private ActivityManager mActivityManager;
     private WindowManager mWindowManager;
     private boolean mSupportsDeviceAdmin;
     private boolean mSupportsManagedProfiles;
+    private long mTotalMemory;
 
     @Override
     protected void setUp() throws Exception {
@@ -49,6 +51,9 @@
                 mPackageManager.hasSystemFeature(PackageManager.FEATURE_DEVICE_ADMIN);
         mSupportsManagedProfiles =
                 mPackageManager.hasSystemFeature(PackageManager.FEATURE_MANAGED_USERS);
+        ActivityManager.MemoryInfo memInfo = new ActivityManager.MemoryInfo();
+        mActivityManager.getMemoryInfo(memInfo);
+        mTotalMemory = memInfo.totalMem;
     }
 
     /**
@@ -76,8 +81,8 @@
             return;
         }
 
-        // Skip the tests for low-RAM devices
-        if (mActivityManager.isLowRamDevice()) {
+        // Skip the tests for devices with less than 2GB of ram available
+        if (lessThanTwoGbDevice()) {
             return;
         }
 
@@ -107,4 +112,9 @@
         double heightInInchesSquared = Math.pow(dm.heightPixels/dm.ydpi,2);
         return Math.sqrt(widthInInchesSquared + heightInInchesSquared);
     }
+
+    // Implementation copied from CoreGmsAppsTest#twoGbDevice()
+    private boolean lessThanTwoGbDevice() {
+        return mTotalMemory < TWO_GB;
+    }
 }