diff options
author | Khalid Zubair <kzubair@cyngn.com> | 2015-11-24 09:57:46 -0800 |
---|---|---|
committer | Scott Mertz <scott@cyngn.com> | 2015-11-25 12:52:40 -0800 |
commit | 4a964c508ee2c225408bddeecd99081223061a0f (patch) | |
tree | 0767c9e44a5249ede47334a63a3be8e47b720d50 /src/java/cyanogenmod/power | |
parent | 37b590928fc324a3b2dfba83cba6993855885b2b (diff) | |
download | vendor_cmsdk-4a964c508ee2c225408bddeecd99081223061a0f.zip vendor_cmsdk-4a964c508ee2c225408bddeecd99081223061a0f.tar.gz vendor_cmsdk-4a964c508ee2c225408bddeecd99081223061a0f.tar.bz2 |
perf: Add PerformanceManager.getProfileHasAppProfiles API
Add an API to query PerformanceManager if a perf profile supports
app-profiles.
Change-Id: I51d958343624ab085de0352ac182cb05308e0da4
Diffstat (limited to 'src/java/cyanogenmod/power')
-rw-r--r-- | src/java/cyanogenmod/power/IPerformanceManager.aidl | 2 | ||||
-rw-r--r-- | src/java/cyanogenmod/power/PerformanceManager.java | 19 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/java/cyanogenmod/power/IPerformanceManager.aidl b/src/java/cyanogenmod/power/IPerformanceManager.aidl index 106854f..bf44ac9 100644 --- a/src/java/cyanogenmod/power/IPerformanceManager.aidl +++ b/src/java/cyanogenmod/power/IPerformanceManager.aidl @@ -26,4 +26,6 @@ interface IPerformanceManager { int getPowerProfile(); int getNumberOfProfiles(); + + boolean getProfileHasAppProfiles(int profile); } diff --git a/src/java/cyanogenmod/power/PerformanceManager.java b/src/java/cyanogenmod/power/PerformanceManager.java index f91bc98..e8e41b4 100644 --- a/src/java/cyanogenmod/power/PerformanceManager.java +++ b/src/java/cyanogenmod/power/PerformanceManager.java @@ -178,4 +178,23 @@ public class PerformanceManager { } return ret; } + + /** + * Check if profile has app-specific profiles + * + * Returns true if profile has app-specific profiles. + */ + public boolean getProfileHasAppProfiles(int profile) { + boolean ret = false; + if (mNumberOfProfiles > 0) { + try { + if (checkService()) { + ret = sService.getProfileHasAppProfiles(profile); + } + } catch (RemoteException e) { + // nothing + } + } + return ret; + } } |