From 279ce42664be4a958e01dd41fecefbe36eaa5074 Mon Sep 17 00:00:00 2001 From: Adnan Begovic Date: Fri, 25 Mar 2016 12:37:26 -0700 Subject: cmsdk: Mandate performance 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. Change-Id: I50f5993ff9c5107fdeaa9a5aa95377235eb3ac02 TICKET: CYNGNOS-2294 --- .../src/org/cyanogenmod/tests/power/unit/PerfomanceManagerTest.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/src/org/cyanogenmod/tests/power/unit/PerfomanceManagerTest.java b/tests/src/org/cyanogenmod/tests/power/unit/PerfomanceManagerTest.java index 7b00a5c..7bc3430 100644 --- a/tests/src/org/cyanogenmod/tests/power/unit/PerfomanceManagerTest.java +++ b/tests/src/org/cyanogenmod/tests/power/unit/PerfomanceManagerTest.java @@ -17,6 +17,8 @@ package org.cyanogenmod.tests.power.unit; import android.test.AndroidTestCase; import android.test.suitebuilder.annotation.SmallTest; + +import cyanogenmod.app.CMContextConstants; import cyanogenmod.power.IPerformanceManager; import cyanogenmod.power.PerformanceManager; @@ -34,6 +36,9 @@ public class PerfomanceManagerTest extends AndroidTestCase { @Override protected void setUp() throws Exception { super.setUp(); + // Only run this if we support performance abstraction + org.junit.Assume.assumeTrue(mContext.getPackageManager().hasSystemFeature( + CMContextConstants.Features.PERFORMANCE)); mCMPerformanceManager = PerformanceManager.getInstance(mContext); // Save the perf profile for later restore. mSavedPerfProfile = mCMPerformanceManager.getPowerProfile(); -- cgit v1.1