aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAdnan Begovic <adnan@cyngn.com>2016-03-14 08:13:57 -0700
committerAdnan Begovic <adnan@cyngn.com>2016-03-15 14:09:04 -0700
commita335ba39c2304fc2ac971322cf8118a235769b85 (patch)
tree85db8196a1dfb645591f32a0b3f2b22fd97a9b1d /tests
parent19b267dfff29400de5909fad62c0e962b821b804 (diff)
downloadvendor_cmsdk-a335ba39c2304fc2ac971322cf8118a235769b85.zip
vendor_cmsdk-a335ba39c2304fc2ac971322cf8118a235769b85.tar.gz
vendor_cmsdk-a335ba39c2304fc2ac971322cf8118a235769b85.tar.bz2
cmsdk: Mandate cmhw feature xml's for service implementation.
The features xml plays two roles: 1) To allow sdk interface (constructor) to throw when system service is unavailable. This allows for clearer platform development debugging. 2) To allow for simpler disambiguation of what services to instrument in a modular environment. Change-Id: I41f4ac60af076743909c6090fd50c3ad045bc9e1
Diffstat (limited to 'tests')
-rw-r--r--tests/src/org/cyanogenmod/tests/hardware/unit/CMHardwareManagerTest.java4
-rw-r--r--tests/src/org/cyanogenmod/tests/hardware/unit/DisplayModeTest.java4
-rw-r--r--tests/src/org/cyanogenmod/tests/hardware/unit/PersistentStorageTest.java4
3 files changed, 12 insertions, 0 deletions
diff --git a/tests/src/org/cyanogenmod/tests/hardware/unit/CMHardwareManagerTest.java b/tests/src/org/cyanogenmod/tests/hardware/unit/CMHardwareManagerTest.java
index 8e2af14..f8dfa4e 100644
--- a/tests/src/org/cyanogenmod/tests/hardware/unit/CMHardwareManagerTest.java
+++ b/tests/src/org/cyanogenmod/tests/hardware/unit/CMHardwareManagerTest.java
@@ -19,6 +19,7 @@ package org.cyanogenmod.tests.hardware.unit;
import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.SmallTest;
+import cyanogenmod.app.CMContextConstants;
import cyanogenmod.hardware.CMHardwareManager;
import cyanogenmod.hardware.ICMHardwareService;
@@ -30,6 +31,9 @@ public class CMHardwareManagerTest extends AndroidTestCase {
@Override
protected void setUp() throws Exception {
super.setUp();
+ // Only run this if we support hardware abstraction
+ org.junit.Assume.assumeTrue(mContext.getPackageManager().hasSystemFeature(
+ CMContextConstants.Features.HARDWARE_ABSTRACTION));
mCMHardwareManager = CMHardwareManager.getInstance(mContext);
}
diff --git a/tests/src/org/cyanogenmod/tests/hardware/unit/DisplayModeTest.java b/tests/src/org/cyanogenmod/tests/hardware/unit/DisplayModeTest.java
index a642b2c..4a3e1ef 100644
--- a/tests/src/org/cyanogenmod/tests/hardware/unit/DisplayModeTest.java
+++ b/tests/src/org/cyanogenmod/tests/hardware/unit/DisplayModeTest.java
@@ -20,6 +20,7 @@ import android.os.Parcel;
import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.SmallTest;
+import cyanogenmod.app.CMContextConstants;
import cyanogenmod.hardware.DisplayMode;
/**
@@ -29,6 +30,9 @@ public class DisplayModeTest extends AndroidTestCase {
@Override
protected void setUp() throws Exception {
super.setUp();
+ // Only run this if we support hardware abstraction
+ org.junit.Assume.assumeTrue(mContext.getPackageManager().hasSystemFeature(
+ CMContextConstants.Features.HARDWARE_ABSTRACTION));
}
@SmallTest
diff --git a/tests/src/org/cyanogenmod/tests/hardware/unit/PersistentStorageTest.java b/tests/src/org/cyanogenmod/tests/hardware/unit/PersistentStorageTest.java
index 10bc390..eb58905 100644
--- a/tests/src/org/cyanogenmod/tests/hardware/unit/PersistentStorageTest.java
+++ b/tests/src/org/cyanogenmod/tests/hardware/unit/PersistentStorageTest.java
@@ -18,6 +18,7 @@ package org.cyanogenmod.tests.hardware.unit;
import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.SmallTest;
+import cyanogenmod.app.CMContextConstants;
import cyanogenmod.hardware.CMHardwareManager;
import java.util.Arrays;
@@ -31,6 +32,9 @@ public class PersistentStorageTest extends AndroidTestCase {
@Override
protected void setUp() throws Exception {
super.setUp();
+ // Only run this if we support hardware abstraction
+ org.junit.Assume.assumeTrue(mContext.getPackageManager().hasSystemFeature(
+ CMContextConstants.Features.HARDWARE_ABSTRACTION));
mHardwareManager = CMHardwareManager.getInstance(mContext);
}