Commit Graph

13 Commits

Author SHA1 Message Date
Zhao Wei Liew 62edb35560 cmsdk: PerformanceManager: Update POWER_HINT_SET_PROFILE value
We removed POWER_HINT_AUDIO recently, thus moving the value of
POWER_HINT_SET_PROFILE up.

Change-Id: Ib1c4e1b2569064023a7951631ac1de120fcf47ef
2017-02-19 10:02:18 +08:00
Adnan Begovic b51572d697 cmsdk: Create CMSystemServer to handle our platform init.
Change-Id: I7b62978e2a284a3a1ec1ffc1d8c72545d7b0c939
2016-05-31 17:28:48 -07:00
Scott Mertz 6113701337 PerformanceManagerService: drop requests if system is not yet ready
There is a race condition between when onBootPhase(PHASE_SYSTEM_SERVICES_READY)
is handled and when clients request profiles, cpu boost, or launch boost.
Drop these requests in this condition.

OPO-702
Change-Id: I0860f824473767a4a4776e9febc7fb786b81f457
2016-05-12 15:29:27 -07:00
Steve Kondik b77b8b5a70 cmsdk: Pass the process name and pid for launch boosts
* We need this for vendor perf tools.
 * This also adds a NativeHelper class which loads the JNI
   library on-demand, since we don't have an entry point.

Change-Id: If76ad8f952e86366978ae9cf9d1f107febccc28b
2016-05-06 22:25:21 -07:00
Adnan Begovic 279ce42664 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
2016-03-25 14:14:14 -07:00
Adnan Begovic b4eafda7de cmsdk: Add PerformanceManager tests, Change target permission.
Since PerformanceManager is strictly a CyanogenMod construct,
  it doesn't make sense to enforce the interfaces with an android
  specific permission (even though the implementation is delegated
  to power manager). To keep consistency with the other api's,
  modify the enforcing permission to a cm specific declaration.

  Also add test cases for the PerformanceManager public interfaces.

Change-Id: I430b69dbee73bf94bb60932d1942ab97e3ba193e
2016-03-08 09:24:34 -08:00
Danesh M 61afdc1fd7 PerformanceManager : Ensure we clear calling identity
When going from perfmanager -> powermanager we need to clear the calling
identity otherwise you get :

Bad call: specified package android under uid 10031 but it is really 1000

CYNGNOS-786

Change-Id: Iacd310f56d6538b0f7a4779f89b4451f6a203c5b
2016-02-23 14:28:24 -08:00
Danesh M 34ff00c8a4 PerformanceManager : Keep in sync with low power mode
Fix edge cases such as :

1) Toggling to power save when plugged in (Should reject)
2) Plugging in to power while in power save should toggle to
   balanced.
3) Toggling from power save to anything else should disable
   low power mode (Orange system bars...etc)

CYNGNOS-786

Change-Id: If6a4c08843673a6d02c38c94ed44d36230c0cb81
2016-02-15 10:59:01 -08:00
Adnan Begovic 7bdcaa59f4 cmsdk: Fixup stub generation.
Change-Id: I1b033ff646dbbdafa5d0efcaf110b76ca48980e3
2015-12-22 11:10:24 -08:00
Khalid Zubair 4a964c508e perf: Add PerformanceManager.getProfileHasAppProfiles API
Add an API to query PerformanceManager if a perf profile supports
app-profiles.

Change-Id: I51d958343624ab085de0352ac182cb05308e0da4
2015-11-25 12:52:40 -08:00
Khalid Zubair 37b590928f perf: fix perf profile change issues
Rework profile handling to address the following issues:

 - When app specific profiles are enabled, the perf service silently
   changes the profile to BALANCED when the user revisits settings.
   The service and Settings UI still show whatever pref the user had
   selected. The user is now unable to change the setting to BALANCED.
   The perf service ignores the change because the current profile
   (selected by app profiles) did not change.

 - When low power mode (battery saver) activates or deactivates, the
   user selected profile is overwritten.

All runtime decisions regarding active profiles have been consolidated
in to a single applyProfile() function that handles low power mode,
user and app-specific profile rules.

App specific profiles are applied only if the power profile is
BALANCED.

setPowerProfileInternal has been changed to save the user pref even if
the active pref is unchanged.

Fixes SAMBAR-1088

Change-Id: Iac658959130f08452f5e41ce3339fe4603ac474e
2015-11-25 12:52:23 -08:00
Steve Kondik ac36cbe559 perf: Remove logspam
Change-Id: Id7c54851950eedc77ab6bc085fe515b6e7aaaac5
2015-11-04 04:39:31 -08:00
Steve Kondik 620c35bd6b cmsdk: Refactor the PerformanceManager
* Remove all code and configuration into CMSDK.
 * Deprecate the properties-based API

Change-Id: Ib14ce5b8623cb368e6b545d1f82bc9c58580e13b
2015-11-03 17:59:44 -08:00