Commit Graph

114 Commits

Author SHA1 Message Date
d34d bfa500dd15 LLS: Add live lock screen service [1/4]
The live lock screen service is resposonsible for deciding what
LLS should be displayed at any given time.  Live lock screens can
be swapped out using a priority based system.

Change-Id: Ifba73e839b749fe78a9e4ee347dd20eea6bf0a22
2016-03-29 15:02:45 -07:00
Michael Bestas 374a17e295 Fix: "cmsdk: Mandate partner feature xml's for service implementation."
* CMContextConstants.Features.PERFORMANCE was mistakely used
  instead of CMContextConstants.Features.PARTNER

Change-Id: I4582b2faac23b0a3d34a5c6396cffa56c6177556
2016-03-28 14:26:12 +02:00
Adnan Begovic b271dcf279 cmsdk: Mandate partner 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: Ic980225df9c115e97f7147cf043cf92bbb225f01
TICKET: CYNGNOS-2293
2016-03-25 14:16:35 -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 ccdb292eec cmsdk: Mandate themes 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: I67b16a0725ed89d5ddbc973b09337d6227087e4d
TICKET: CYNGNOS-2295
2016-03-25 11:19:46 -07:00
Adnan Begovic c406211045 cmsdk: Mandate telephony 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: Ib8e41130f143f784088b4566589a4ddc58aa2ace
TICKET: CYNGNOS-2291
2016-03-24 17:34:54 -07:00
Adnan Begovic fe7fd1d489 cmsdk: Mandate app suggest 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: Icda71efc084cf91bd358dba24eee4704179be90e
TICKET: CYNGNOS-2290
2016-03-24 17:25:13 -07:00
Adnan Begovic 21a567428d cmsdk: Mandate profile 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.

TICKET: CYNGNOS-2288
Change-Id: Id0adcc1eaa4a0512faf25f11057c45dc2ac733e0
2016-03-24 16:50:56 -07:00
Adnan Begovic cdf85adde1 cmsdk: Mandate cm sb 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.

TICKET: CYNGNOS-2289
Change-Id: Ice0ae7c45aecbb34e0ea667128b040906c46d7e7
2016-03-24 16:50:40 -07:00
d34d b05ce12eab Themes: Check theme api level in onBootPhase
This check should be done once the system has reached the
PHASE_ACTIVITY_MANAGER_READY otherwise we can end up getting
a boot failure within the ThemeManagerService

Change-Id: If3e9c8885d8718224cf7d8fed0c0fb82ebe0fcab
TICKET: CYNGNOS-2230
2016-03-21 09:16:33 -07:00
Adnan Begovic a335ba39c2 cmsdk: Mandate cmhw feature xml's for service implementation.
The features 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: I41f4ac60af076743909c6090fd50c3ad045bc9e1
2016-03-15 14:09:04 -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
d34d b3ea2859fd Themes: Refactor themes to CMSDK [2/6]
First attempt at moving as much as possible out of F/B
and into cmsdk

Change-Id: I9e53d1c32e01e88fc3918663dabe0001df922bc2
TICKET: CYNGNOS-2126
2016-03-04 13:59:33 -08:00
Roman Birg e3c966861f cmsdk: send intent to intialize CMHW
Ref: OPO-513

Change-Id: Iedd88bfad12b8f257bb792bf024d8eefa92b321c
Signed-off-by: Roman Birg <roman@cyngn.com>
2016-02-25 09:00:18 -08:00
Matt Garnes c2efaa7794 Uncomment out getHotwordPackageNameInternal impl
This was mistakenly commented out and causes the API to not function.

Fixes FOR-205.

Change-Id: I3c76d9c3665e35e2d13bed00cba1e742e4c0fb07
2016-02-24 10:27:22 -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
Matt Wagantall eb82dbf050 cmsdk: cmhw: Add UniqueDeviceId support
It's sometimes useful to know what physical device you're using.

CMHW SerialNumber and an "ro.serialno" property already exists, but
are not guaranteed to be unique. Different OEM may use overlapping
numbering schemes, and sometimes placeholder like "012345ABCDE" are
used.

Attempt to work around these shortcomings by defining a new
UniqueDeviceId class that provides a globally unique device ID that
is both deterministic for a given device and designed not to overlap
with IDs of any other devices.

Change-Id: I3f426972558394ba8e78261273ac8521aa603327
2016-02-02 16:37:59 -08:00
Scott Mertz 62579b157a cmsdk: add invalid input checking for persistent storage APIs
Some of this exists in the PersistentStorage implementation, but it
was never formally documented in the APIs.  Inherit the cmhw implementation
error checking & move it into the service.

Add tests to validate the new restrictions & a test that was previously
failing.

Change-Id: I3ecda29fdd28bbc4e6d8ccce7511c4644065ea46
2016-01-22 16:24:33 -08:00
Janet Sun 57dc3b3240 CMSDK: add duration for priority/quiet mode
Add setZenModeWithDuration API call with long durationMills
Use NotificationManager.setZenMode with Condition URI
specifying end time.
Update settings/CMPartnerInterfaceTest
TODO: unit test to be added in:
tests/src/org/cyanogenmod/tests/settings/unit.

FOR-156

Change-Id: I18dd661fc07419a7019b6372e81df430a70f86e9
2015-12-23 11:05:45 -08:00
Adnan Begovic 7bdcaa59f4 cmsdk: Fixup stub generation.
Change-Id: I1b033ff646dbbdafa5d0efcaf110b76ca48980e3
2015-12-22 11:10:24 -08:00
Roman Birg 2ba238bf7a ProfileManagerService: fix broadcasting crash
Ref: CYNGNOS-1478
Change-Id: If4952c4513063ea4b2cf2105514183731175ad72
Signed-off-by: Roman Birg <roman@cyngn.com>
2015-12-22 08:50:29 -08:00
Roman Birg cb4a990216 Profiles: add isEnabled(); send state changes
Ref: CYNGNOS-1461
Change-Id: Idee9417a2f0b181c8d15cd763859c0a0e581dce6
Signed-off-by: Roman Birg <roman@cyngn.com>
2015-12-21 10:30:15 -08:00
Steve Kondik 968127f532 cmsdk: Add CMHW method to check if SRE is self managed
Change-Id: Ia5f644ce0b964a965afa47ea08016167c8b20620
2015-12-09 21:02:54 -08:00
Adnan Begovic 4ae9604b18 cmsdk: Reimplement helper methods for secondary telephony service.
Change-Id: If126936f788d398c53dca21297cd7d69f9d933b8
2015-11-29 14:55:36 -08:00
Adnan Begovic c221959167 cmsdk: Re-enable multiple profiles functions.
Change-Id: I1db0cba6cf107926a25a8e45952813d3c21eb470
2015-11-29 14:55:21 -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
Adnan Begovic ce2636010c cmsdk: Point at cmsettings for system profiles.
Change-Id: I61497111f1bf1873554c4185b4424662dcb8c7e5
2015-10-26 15:37:55 -07:00
Adnan Begovic fe7a368a69 cmsdk: Temporary build fixes
Change-Id: I18a1aa9ade95de63fe18eaaeca388b118c8ffe8c
2015-10-09 14:56:20 -07:00
Adnan Begovic a79a53b8ea cmsdk: mContext is private with SystemService now.
YOU MEAN WE HAVE SANE ABSTRACTION NOW?!

Change-Id: I5b37b656b2002013b368b43153927b796ec46e6a
2015-10-09 14:56:20 -07:00
Danesh M b4ef25ab19 CMSdk : Initial thermal state to STATE_UNKNOWN
Change-Id: I37c7fe7441d7f0f09d1b96be001f046417ffff12
2015-09-24 18:18:56 -07:00
Danesh M b4f88faa26 CMSdk : Add thermal monitor service impl
Change-Id: I54c4473a5fdd026958bc6bf170b2e8953aaa64af
2015-09-24 11:44:14 -07:00
herriojr e78ca4d6fe Added Application Suggestions.
Added in custom Resolver to handle providing suggestions.

Added in Service to handle providing suggestions to custom resolver.

Added in ability to provider suggestions through a Proxy to another
application which must be installed during compile time if one is
to be used. This is a similar implementation to how the Location
Services work.

Change-Id: Id960260596b7bb6485caa1e1d07744e387a4c6e9
2015-09-14 14:29:43 -07:00
Steve Kondik 7cef6f6945 cmsdk: Add persistent properties API
* Add support for reading and writing values from/to persistent
   storage. Requires the MANAGE_PERSISTENT_STORAGE permission, which
   should not be available for general use by applications.

Change-Id: I8a793396d207f23fcda851c172372f2073778eec
2015-09-09 15:43:32 -07:00
Matt Garnes eabd575721 Add Broadcast action and query API for AudioSource.HOTWORD.
- Add ACTION_HOTWORD_INPUT_CHANGED broadcast action and related extras.
- Add getCurrentHotwordPackageName() API to SettingsManager to query the
  current package name of the application that controls the HOTWORD
  input.
- Rename SettingsManager to PartnerInterface.

Change-Id: I5987499cd32908c47a7e8e95d644c483dc32914c
2015-09-08 17:28:20 -07:00
Adnan Begovic 052391135b cmsdk: Enforce cyanogenmod.permission.MODIFY_PROFILES for profiles.
Change-Id: Id14bfd9b214b4f53960c55d8abab2764f990b1b6
2015-09-01 15:40:58 -07:00
Steve Kondik ba4db5ad36 cmhw: Add makeDefault arg to setDisplayMode
* Already supported by the HAL and is necessary to sync state with
   the server side.

Change-Id: I65148d5464dff8dbbee374387a01bcf13a945eb1
2015-08-20 23:58:47 -07:00
Steve Kondik e18f6d8b1c cmsdk: Add initial DisplayMode and AutoContrast support to CMHW
Change-Id: I71f3599c64c03efc4b090ea71e583c942d0c03c2
2015-08-19 05:33:40 -07:00
Steve Kondik 5ee87cbf06 cmsdk: Transplant CMHW into CMSDK
* Moving CMHW out of the framework and into CMSDK.

Change-Id: I0b68b67d059e2310c83e253a9071d886ed6760cb
2015-08-19 05:33:11 -07:00
Steve Kondik 435e2f3b17 profiles: Don't bind the keyguard until ActivityManager is up
Change-Id: I2f349d00c197cf5c4a492fb0892b3edd71479ea4
2015-08-19 05:29:16 -07:00
Roman Birg 307941c0fd cmsdk: fix enabling/disabling keyguard
We cannot create a new WindowManagerPolicy every time since the method
isn't called from the main thread every time, which could lead to
exceptions being thrown when trying to create PhoneWindowManager.

Instead of creating a new policy, bind to the keyguard service on bind,
and then pass it to the profile to operate on.

Ref: NIGHTLIES-1640

Change-Id: I3ac58bfa534755eaa73890cc5ddf05987a7d0d8c
Signed-off-by: Roman Birg <roman@cyngn.com>
2015-08-13 10:49:17 -07:00
Joao Figueiredo 7f50335f2b cmsdk: Dual SIM support on CM SDK
Signed-off-by: Adnan Begovic <adnan@cyngn.com>
Change-Id: I69b349853b0259582956744d9ddd99a187c10fff
2015-08-06 18:56:12 -07:00
Matt Garnes 51c39ba2d7 Add API to SettingsManager to set zen mode.
- Add a new permission cyanogenmod.permission.MODIFY_SOUND_SETTINGS.
- Only allowed when the caller holds
  cyanogenmod.permission.MODIFY_SOUND_SETTINGS.
- Allows the user to set zen mode to the off, priority interruptions
  only, or no interruptions modes.
- For each mode change, the end condition will be set to null so that
  the mode remains active indefinitely.

Change-Id: Id465509a8cc8d98953bf8cbe06cacff02b9f75a0
2015-08-06 16:18:50 -07:00
Matt Garnes 0cdb1d513c Add SettingsManager.
Add new APIs for changing a subset of system settings.

Protected by cyanogenmod.permission.MODIFY_NETWORK_SETTINGS:
    - Add ability to toggle airplane mode on/off.
    - Add ability to toggle mobile data on/off.

Protected by android.permission.REBOOT:
    - Add ability to shutdown or reboot the device.

Change-Id: I5e943be11260c58afa664f1702c0ecb4413528fe
2015-08-06 11:35:00 -07:00
Adnan Begovic fa82ebb308 cmsdk: Support deleteIntent and remove tiles when packages change.
Change-Id: I488410296c7579870406ea8fe289cf0b2158ea80
2015-07-31 16:27:15 -07:00
Adnan Begovic d61839701e cmsdk: Create new setIcon method for utilizing bitmaps
Change-Id: I123994af89fe435b9f4bc146056a237f1cecb939
2015-07-31 13:04:41 -07:00
Adnan Begovic c9295fb9cc cmsdk: Clear calling identity when resetAll is called.
Change-Id: Id39eb18165d12a792c141dc44840a122d509dece
2015-07-14 13:42:41 -07:00
Jorge Ruesga 63524972a3 cmsdk: fix cannot create handler
Change-Id: I34153f6199d46b7fa9a914efa38552b8d66c0c99
JIRA: NIGHTLIES-1532
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
2015-07-13 16:58:16 -07:00
Adnan Begovic cf0bfd333e CMSDK: Begin documentation and testing for profiles.
Change-Id: I06c02f6aed63cfa0483376ae93a3f9a594aff201
2015-07-10 14:40:52 -07:00
Adnan Begovic 6e46829eb7 CMSDK: Introduce factored out resources from framework.
Change-Id: I4193db99f3f883260354cde98366f94c608f6163
2015-07-09 20:05:29 -07:00
Adnan Begovic cc979035e7 CMSDK: Make sure to initialize ProfileTriggerHelper.
OSS-JIRA: NIGHTLIES-1480

Change-Id: I48fbb350d96424b593858aca1b2343a79f298b0c
2015-07-01 01:04:29 -07:00
Adnan Begovic 4334b3d969 CMSDK: Introduce Profiles API from frameworks.
Refactor to create a system service in secondary
  CM framework.

Change-Id: Ic69da01d941bbd09271c260429d744f8e79ab7b9
2015-06-25 17:35:48 -07:00
Jorge Ruesga 635f8f1657 cmsdk: notify new listeners all registered custom tiles
If a new listener is created, then notified all custom tiles that was previously registered

Change-Id: I9e8d9a1fa84d54b00ea7fd8ed400e172f17f06cc
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
2015-06-14 00:50:37 +02:00
Jorge Ruesga 08a3470a78 cmsdk: customtiles: allow load resources from external packages
Saved the context passed to CustomTile.Builder in other to differenciate from the context
used to publish the tile. This allow to load resources (icons) from other packages

Change-Id: I8e40bc59a66f371f3a02f0182e25c6e9eca73c63
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
2015-06-14 00:07:54 +02:00
Adnan Begovic 2217bb4197 CMSDK: Remove dead code.
Change-Id: If08729e64271ed72545eddc8da3147f23c6f2d75
2015-05-18 16:35:01 -07:00
Adnan Begovic 37c4b96e0b CMSDK: Don't share a namespace with the library.
Otherwise PackageParser will skip you.

  W/ResourceType( 3077): ResTable_typeSpec entry count inconsistent: given 6, previously 1003
  I/PackageManager( 3077): /system/framework/org.cyanogenmod.platform-res.apk changed; collecting certs
  W/PackageManager( 3077): Failed to parse /system/framework/org.cyanogenmod.platform-res.apk:
  Application package org.cyanogenmod.platform already installed.  Skipping duplicate.

Change-Id: Iddea111f4c9bbe69939266ce5c6902d176407b14
2015-05-13 04:54:40 -07:00
Danny Baumann 7267e32ca4 Fix package name.
Package names must contain at least one period if they're not 'android'.

Change-Id: I43658b30837efcaf099e8c02454154e9a57e1a91
2015-05-13 04:27:47 -07:00
Adnan Begovic 3f13414fde CMSDK: Make sure we're binding the correct permission for enforcement.
Change-Id: Ie58b11cfa972f449bfc20b05f4b52b7cd28ab7d5
2015-05-13 01:39:34 -07:00
Adnan Begovic 37fc76fe96 CMSDK: Create cyanogenmod platform resource package.
org.cyanogenmod.platform-res provides resources that,
  if public, are globally accessible.

  This allows us to declare public and internal permissions as
  well as reference permissions declared by the android framework
  core

Change-Id: Ia7d541f4b403585f7479ecd87895987b8471005b
2015-05-12 17:40:49 -07:00
Adnan Begovic e54a96d647 CMSDK: Update implementation for permission declarations.
Change-Id: I9cca55f693ef3f0363bac2f5c8ae1db07adc4f34
2015-04-30 17:26:01 -07:00
Adnan Begovic a7d6fc579f CMSDK: Refactor compile, prepare for integration tests.
Also don't build CMPlatformTests unless explicitely called.

Change-Id: I3fd8f884d8815eab9987077766c0ff2fe3f98b4d
2015-04-30 11:10:56 -07:00