summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreddy-sh.chen <eddy-sh.chen@mstarsemi.com>2017-03-16 15:52:21 +0800
committerWally Yau <wyau@google.com>2019-08-14 11:30:11 -0700
commit97341094008a8871ac255b1de341505009b76bdd (patch)
treeaf5cba3c3d3159989cad9b810f3e8c4467525707
parentd494e00ccc3761d2e09866014b3cb4d66c8a2481 (diff)
downloadcts-97341094008a8871ac255b1de341505009b76bdd.tar.gz
[DO NOT MERGE] Disabling EncryptionTests on Android TV
Since Android TV doesn't has a sreen lock, data storage encryption is optional for it. Bug: 121179027 Test: atest android.security.cts.EncryptionTest#testEncryption Change-Id: I5927bc97e4950550ca6743e5376c6dce647dc65f (cherry picked from commit d7a8f61147bc7ec301b8b1759459f2686eb30800)
-rw-r--r--tests/tests/security/src/android/security/cts/EncryptionTest.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/tests/security/src/android/security/cts/EncryptionTest.java b/tests/tests/security/src/android/security/cts/EncryptionTest.java
index 07b39de608d..ed6cf5c7196 100644
--- a/tests/tests/security/src/android/security/cts/EncryptionTest.java
+++ b/tests/tests/security/src/android/security/cts/EncryptionTest.java
@@ -22,6 +22,7 @@ import android.platform.test.annotations.SecurityTest;
import android.test.AndroidTestCase;
import junit.framework.TestCase;
+import android.content.pm.PackageManager;
import android.content.Context;
import android.util.Log;
import java.io.BufferedReader;
@@ -46,7 +47,13 @@ public class EncryptionTest extends AndroidTestCase {
private boolean isRequired() {
// Optional before MIN_API_LEVEL
- return PropertyUtil.getFirstApiLevel() >= MIN_API_LEVEL;
+ return PropertyUtil.getFirstApiLevel() >= MIN_API_LEVEL && !isTelevision();
+ }
+
+ private boolean isTelevision() {
+ PackageManager pm = getContext().getPackageManager();
+ return pm.hasSystemFeature(PackageManager.FEATURE_TELEVISION)
+ || pm.hasSystemFeature(PackageManager.FEATURE_LEANBACK);
}
public void testEncryption() throws Exception {