summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAdnan Begovic <adnan@cyngn.com>2016-03-15 16:40:06 -0700
committerAdnan Begovic <adnan@cyngn.com>2016-03-24 16:50:56 -0700
commit21a567428db79f97d2178a8dec7cf1825b7ecff6 (patch)
tree31108b2cb12675ddf48e99583b14b4bf70bfc419 /tests
parentcdf85adde1be30ce675e8c5442ec4c21a6cd2991 (diff)
downloadvendor_cmsdk-21a567428db79f97d2178a8dec7cf1825b7ecff6.zip
vendor_cmsdk-21a567428db79f97d2178a8dec7cf1825b7ecff6.tar.gz
vendor_cmsdk-21a567428db79f97d2178a8dec7cf1825b7ecff6.tar.bz2
cmsdk: Mandate profile feature xml's for service implementation.
The feature 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. TICKET: CYNGNOS-2288 Change-Id: Id0adcc1eaa4a0512faf25f11057c45dc2ac733e0
Diffstat (limited to 'tests')
-rw-r--r--tests/src/org/cyanogenmod/tests/profiles/unit/ProfileManagerTest.java4
-rw-r--r--tests/src/org/cyanogenmod/tests/profiles/unit/ProfileTest.java4
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/src/org/cyanogenmod/tests/profiles/unit/ProfileManagerTest.java b/tests/src/org/cyanogenmod/tests/profiles/unit/ProfileManagerTest.java
index 37338b0..d044150 100644
--- a/tests/src/org/cyanogenmod/tests/profiles/unit/ProfileManagerTest.java
+++ b/tests/src/org/cyanogenmod/tests/profiles/unit/ProfileManagerTest.java
@@ -18,6 +18,7 @@ package org.cyanogenmod.tests.profiles.unit;
import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.SmallTest;
+import cyanogenmod.app.CMContextConstants;
import cyanogenmod.app.ProfileManager;
import cyanogenmod.app.IProfileManager;
import cyanogenmod.providers.CMSettings;
@@ -32,6 +33,9 @@ public class ProfileManagerTest extends AndroidTestCase {
protected void setUp() throws Exception {
super.setUp();
mProfileManager = ProfileManager.getInstance(mContext);
+ // Only run this if we support profiles service
+ org.junit.Assume.assumeTrue(mContext.getPackageManager().hasSystemFeature(
+ CMContextConstants.Features.PROFILES));
}
@SmallTest
diff --git a/tests/src/org/cyanogenmod/tests/profiles/unit/ProfileTest.java b/tests/src/org/cyanogenmod/tests/profiles/unit/ProfileTest.java
index f48b805..38ba56e 100644
--- a/tests/src/org/cyanogenmod/tests/profiles/unit/ProfileTest.java
+++ b/tests/src/org/cyanogenmod/tests/profiles/unit/ProfileTest.java
@@ -23,6 +23,7 @@ import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.SmallTest;
+import cyanogenmod.app.CMContextConstants;
import cyanogenmod.app.Profile;
import cyanogenmod.profiles.AirplaneModeSettings;
import cyanogenmod.profiles.BrightnessSettings;
@@ -39,6 +40,9 @@ public class ProfileTest extends AndroidTestCase {
@Override
protected void setUp() throws Exception {
super.setUp();
+ // Only run this if we support profiles service
+ org.junit.Assume.assumeTrue(mContext.getPackageManager().hasSystemFeature(
+ CMContextConstants.Features.PROFILES));
}
@MediumTest