commit | a353a9bf2b15050f201fd31315640de8e7665511 | [log] [tgz] |
---|---|---|
author | Sudheer Shanka <sudheersai@google.com> | Sat Jan 06 01:42:28 2018 +0000 |
committer | android-build-merger <android-build-merger@google.com> | Sat Jan 06 01:42:28 2018 +0000 |
tree | e853df38a4cfac445da5c8c09439d780ca49595b | |
parent | 5dc684901335dbe06ae7811110ae40b75c613c02 [diff] | |
parent | b7a503b5784b520da5ae6ca124426744f8b4f12c [diff] |
Merge "Skip unsupported tests on low ram devices." into stage-aosp-oc-mr1-cts-dev am: e352866bee Change-Id: I62d301dd0c4f026ea4f52de0ad706d50ff5382e4
diff --git a/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractDozeModeTestCase.java b/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractDozeModeTestCase.java index c2dce38..f20f1d1 100644 --- a/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractDozeModeTestCase.java +++ b/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractDozeModeTestCase.java
@@ -129,7 +129,7 @@ public void testBackgroundNetworkAccess_enabledButWhitelistedOnNotificationAction() throws Exception { - if (!isSupported()) return; + if (!isSupported() || isLowRamDevice()) return; setPendingIntentWhitelistDuration(NETWORK_TIMEOUT_MS); try {
diff --git a/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractRestrictBackgroundNetworkTestCase.java b/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractRestrictBackgroundNetworkTestCase.java index 1c46396..ce56d25 100644 --- a/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractRestrictBackgroundNetworkTestCase.java +++ b/tests/cts/hostside/app/src/com/android/cts/net/hostside/AbstractRestrictBackgroundNetworkTestCase.java
@@ -26,6 +26,7 @@ import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; +import android.app.ActivityManager; import android.app.Instrumentation; import android.app.NotificationManager; import android.content.BroadcastReceiver; @@ -476,6 +477,12 @@ return errors.toString(); } + protected boolean isLowRamDevice() { + final ActivityManager am = (ActivityManager) mContext.getSystemService( + Context.ACTIVITY_SERVICE); + return am.isLowRamDevice(); + } + protected String executeShellCommand(String command) throws Exception { final String result = runShellCommand(mInstrumentation, command).trim(); if (DEBUG) Log.d(TAG, "Command '" + command + "' returned '" + result + "'");