diff options
author | Adnan Begovic <adnan@cyngn.com> | 2016-03-25 12:37:26 -0700 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2016-03-25 14:14:14 -0700 |
commit | 279ce42664be4a958e01dd41fecefbe36eaa5074 (patch) | |
tree | 115d30726290d53d449aeaadf144308c08019199 /cm/lib | |
parent | ccdb292eecc53c1343eaae0f4e0e9342326bad16 (diff) | |
download | vendor_cmsdk-279ce42664be4a958e01dd41fecefbe36eaa5074.zip vendor_cmsdk-279ce42664be4a958e01dd41fecefbe36eaa5074.tar.gz vendor_cmsdk-279ce42664be4a958e01dd41fecefbe36eaa5074.tar.bz2 |
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
Diffstat (limited to 'cm/lib')
-rw-r--r-- | cm/lib/main/java/org/cyanogenmod/platform/internal/PerformanceManagerService.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cm/lib/main/java/org/cyanogenmod/platform/internal/PerformanceManagerService.java b/cm/lib/main/java/org/cyanogenmod/platform/internal/PerformanceManagerService.java index 4b03ba0..0665a5b 100644 --- a/cm/lib/main/java/org/cyanogenmod/platform/internal/PerformanceManagerService.java +++ b/cm/lib/main/java/org/cyanogenmod/platform/internal/PerformanceManagerService.java @@ -29,6 +29,7 @@ import android.os.Message; import android.os.Process; import android.os.SystemProperties; import android.text.TextUtils; +import android.util.Log; import android.util.Slog; import com.android.server.ServiceThread; @@ -110,7 +111,13 @@ public class PerformanceManagerService extends SystemService { @Override public void onStart() { - publishBinderService(CMContextConstants.CM_PERFORMANCE_SERVICE, mBinder); + if (mContext.getPackageManager().hasSystemFeature( + CMContextConstants.Features.PERFORMANCE)) { + publishBinderService(CMContextConstants.CM_PERFORMANCE_SERVICE, mBinder); + } else { + Log.wtf(TAG, "CM performance service started by system server but feature xml not" + + " declared. Not publishing binder service!"); + } publishLocalService(PerformanceManagerInternal.class, new LocalService()); } |