summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-03-21 20:28:29 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2023-03-21 20:28:29 +0000
commit40a49aa1a028effeb4efc05487b8cfe83953fa2c (patch)
tree03afe134ee3cbb6358b8ecf7e5ac2d1eb1f535c9
parenta1d581f5060e17b47e6449aeb9aa240ca4d68554 (diff)
parentb05204718d50e81ee0f46cef63855c7a6919ff10 (diff)
downloadcts-40a49aa1a028effeb4efc05487b8cfe83953fa2c.tar.gz
Merge "Snap for 9781425 from 44c1b424412f904ee65d614b1eb4bb778f718556 to android12-tests-release" into android12-tests-release
-rw-r--r--tests/tests/content/src/android/content/pm/cts/FeatureTest.java18
1 files changed, 13 insertions, 5 deletions
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 68edc76c597..58a40117df6 100644
--- a/tests/tests/content/src/android/content/pm/cts/FeatureTest.java
+++ b/tests/tests/content/src/android/content/pm/cts/FeatureTest.java
@@ -72,7 +72,7 @@ public class FeatureTest extends AndroidTestCase {
}
// Managed profiles only required for handheld devices
- if (!isHandheldDevice()) {
+ if (!isHandheldOrTabletDevice()) {
return;
}
@@ -91,12 +91,20 @@ public class FeatureTest extends AndroidTestCase {
}
/**
- * The CDD defines a handheld device as one that has a battery and a screen size between
- * 2.5 and 8 inches.
+ * The CDD defines:
+ * - A handheld device as one that has a battery and a screen size between 2.5 and 8 inches.
+ * - A tablet device as one that has a battery and a screen size between 7 and 18 inches.
*/
- private boolean isHandheldDevice() throws Exception {
+ private boolean isHandheldOrTabletDevice() throws Exception {
+ if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)
+ || mPackageManager.hasSystemFeature(PackageManager.FEATURE_LEANBACK)
+ || mPackageManager.hasSystemFeature(PackageManager.FEATURE_WATCH)
+ || mPackageManager.hasSystemFeature(PackageManager.FEATURE_EMBEDDED)) {
+ return false;
+ }
+
double screenInches = getScreenSizeInInches();
- return deviceHasBattery() && screenInches >= 2.5 && screenInches <= 8.0;
+ return deviceHasBattery() && screenInches >= 2.5 && screenInches <= 18.0;
}
private boolean deviceHasBattery() {