perf: Add PerformanceManager.getProfileHasAppProfiles API

Add an API to query PerformanceManager if a perf profile supports
app-profiles.

Change-Id: I51d958343624ab085de0352ac182cb05308e0da4
This commit is contained in:
Khalid Zubair
2015-11-24 09:57:46 -08:00
committed by Scott Mertz
parent 37b590928f
commit 4a964c508e
3 changed files with 40 additions and 2 deletions

View File

@@ -26,4 +26,6 @@ interface IPerformanceManager {
int getPowerProfile();
int getNumberOfProfiles();
boolean getProfileHasAppProfiles(int profile);
}

View File

@@ -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;
}
}