Commit Graph

502 Commits

Author SHA1 Message Date
Michael Bestas
69c9ab0f86 Automatic translation import
Change-Id: I415a05f9260dee22c61c2bd8cad035a424990fb6
2016-05-10 18:43:11 +03:00
Michael Bestas
4a0ad7cfbb CMSettings: Fix upgrade from cm-12.1 after weather changes
* Only the owner can write to the global db

Change-Id: Iec7736c28ff0bc7a35dae8bbc85ca2b1c137da49
2016-05-08 01:15:29 +03: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
Luis Vidal
186ae8353d Set a default temperature unit
Bump the DB version and set a default temperature unit in
global settings

Change-Id: I14f80e1b3fa3ae4a47769c02b5ebd6a905a53e46
TICKET: CYNGNOS-2751
2016-05-06 17:49:03 -07:00
d34d
e4886a668f QS: Make themes a first class citizen again
Change-Id: Icd397a2ddd730ae525233b66288fde9a6798c221
TICKET: CYNGNOS-2670
2016-05-05 14:00:21 -07:00
Pat Erley
9ff5ea9cea cmsdk: Fix CTS Failure due to testDumpProtected
Only dump CMAudio Service State for processes with dump permissions.

OPO-679
Change-Id: I28a501851a76e6d82f5726c13ac1fac74f47a8f1
2016-05-05 12:14:58 -07:00
Roman Birg
10f165d5d0 cmsdk: add persisted key value for status bar tiles
The persisted one simply contains the user, the publishing package, and
the tile tag - items which can be persisted across reboots to restore
the tile's properties on boot properly.

Ticket: CYNGNOS-2530

Change-Id: If770557482e81ab0dd0d16c3ac8be0b2b51e653a
Signed-off-by: Roman Birg <roman@cyngn.com>
2016-05-04 22:31:41 -07:00
d34d
8770189b8d cmsdk: Add allowViaWhitelist to LLS_MANAGER_ACCESS_PRIVATE
Change-Id: Idee5bd602047c01f8e13cd7d5ddbe6fb151215a2
TICKET: CYNGNOS-2378
2016-05-04 17:42:28 -07:00
Steve Kondik
462be9bc62 cmsdk: Add support for segmented LEDs
* For devices with segmented LEDs which can function as a range bar.

Change-Id: I346576b705635b60f9fd8716937e86b23bc7aa30
2016-05-03 18:54:07 -07:00
Roman Birg
60f2acf2f0 cmsdk: @hide protected variable
Ticket: CYNGNOS-2480

Change-Id: I0d104b235db59af008dee560763d6a753e3c8b79
Signed-off-by: Roman Birg <roman@cyngn.com>
2016-05-02 17:48:51 -07:00
Roman Birg
fd4b383b71 CMSettings: intercept Settings calls to DEV_FORCE_SHOW_NAVBAR
Because DEV_FORCE_SHOW_NAVBAR has lived in Settings.System,
Settings.Secure, and now in CMSettings.Secure, we need to return the
proper value no matter which place an app might query.

Ticket: CYNGNOS-2480

Change-Id: Ie84df9763aa3714ec4ce4d033dc73be4de3f1f00
Signed-off-by: Roman Birg <roman@cyngn.com>
2016-05-02 16:17:41 -07:00
Adnan Begovic
94dd91a34c cmsdk: Fix PerformanceManagerTest expectations.
Since the API for PerformanceManager returns the number
  of profiles supported we can assume what the profiles are
  since the HAL provides them in an ordered manner. Thus,
  iterate through the size of the number of profiles and verify
  each one that's possible.

Change-Id: I87f6d1a847c849bd9e544c1e89a666726c61fe83
TICKET: CYNGNOS-2603
2016-05-02 10:33:21 -07:00
Jorge Ruesga
c6550fd803 cmsdk: include our own consumer proguard rules
Include a proguard file with can be consumed by the latest gradle plugin to
merge this ones rules without the rules of the app linked to.
This way devs doesn't need to declare (in a recent version of the gradle plugin)
-dontwarn and -dontnote for cyanogenmod.library when linked to it, because
proguard crashes the build because it cannot access to cm system private classes.

Change-Id: I7c94a9119db744b0029b4d9a8aa782adcbd47b93
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
2016-05-02 10:08:21 -07:00
Jorge Ruesga
de43b8c2d8 cmsdk: set minsdk to api level 4
In other case it will force to declare READ_PHONE_STATUS permission to apps
linked to

Change-Id: I384837c2bda2fe775dafd33b6f7690ca1db465d7
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
2016-05-02 10:07:44 -07:00
Steve Kondik
a4ab6bd2c1 cmsdk: Fix warning from 64-bit clang
Change-Id: I2e45d0b1a8a552331d2691d6bc6d72a3b48a8467
2016-04-30 20:16:44 -07:00
Michael Bestas
76ff069e49 Automatic translation import
Change-Id: I9bc4a483af682783e5f0ee215daf8b7334fe5431
2016-04-29 00:47:58 +03:00
Steve Kondik
bf3c0cf948 cmsdk: Add CMAudioManager
* This is a rework of the session callback API which previously
   lived in the framework due to JNI usage. This has been split out
   and cleaned up for CMSDK.
 * The JNI library lives on the server side, and the app-level
   callback has been changed to a protected broadcast. This allows
   us to wake up registered services when these events occur.
 * Additionally, we support listing all active audio sessions.
 * Also brings some JNI love/hate over to CMSDK.

Change-Id: I31c293943474419e3db088bb7ffab75f7440ac0f
2016-04-27 22:13:36 -07:00
Steve Kondik
153bd2287c livedisplay: Fix another transition issue
* If the screen is off during the entire transition period,
   when we turn the display back on it is not updated with
   the correct color temperature.
 * The code here is trying to be Mr. Smarty Pants and avoid
   extra updates, but it's totally pointless and also broken.
   There's no ill effects from writing to the hardware when
   the screen comes on, and updateColorTemperature already
   has all the other conditionals we need.
 * Just call updateColorTemperature every time, regardless.
   The LiveDisplayService ensures the callbacks run on the
   handler thread and all this crap can be removed.

Change-Id: Ib9560e13870a5c6bbe9c5a26fad40f5ec1cefa83
2016-04-26 22:36:52 -07:00
Steve Kondik
4595cfde0b livedisplay: Add some unit tests
* Test color temperature control and mode selection

Change-Id: Icc4fffef4c64cf3424e30890b5a4a37154482b3a
2016-04-26 01:18:19 -07:00
Steve Kondik
35315d3c0f cmsdk: Fix crash when getting LiveDisplay config
* If capabilities is empty, BitSet.toLongArray returns an empty array.

Change-Id: I17476438995b581050feda346d0348228519ff44
2016-04-26 01:17:30 -07:00
Ethan Chen
c68b38ac3a livedisplay: Connect display modes to CMHW
REF: CRACKLING-1069
Change-Id: I5be5cabf316d9bd02ab4ffc169d458ab8d1b46d4
2016-04-25 17:44:53 -07:00
Steve Kondik
e41c2924cb livedisplay: Fix three bugs
* Fix issue with color adjustments not being applied at bootup.
 * Fix issue where hardware was always updated twice.
 * Check the display state inside the color animator- this was
   occasionally racing and triggering kernel bugs on some devices.

Change-Id: Ieb9845e6b0f1c7ca979cbfa35c0b9b688ef1a8cf
2016-04-24 01:43:55 -07:00
Roman Birg
bf5261c360 CMSettings: add CM_SETUP_WIZARD_COMPLETED key
We need to store the state of _our_ setup wizard.

To not break existing devices' provisioning, copy the current state of the global
provisioned flag to the new key value.

Ticket: CYNGNOS-2431

Change-Id: I3d88361edc126788f42b28efd11f3c7598117138
Signed-off-by: Roman Birg <roman@cyngn.com>
2016-04-22 08:29:38 -07:00
Steve Kondik
7a4fed9640 livedisplay: Always check for transition
* If the device is started in the middle of a transition period,
   the transition would not occur. Always check for this condition
   instead of only firing it when TwilightService updates.

Change-Id: Ibe6cfa69506ffc6a9bf6390ee7e13863f275ec2a
2016-04-21 20:45:32 -07:00
Steve Kondik
b00c945e35 livedisplay: Bugfixes and cleanups
* Simplify the code and callback mechanisms
 * Fix bug where settings weren't applied at startup
 * Make stuff immutable where possible
 * Corrected the sunrise calculation to start on time
 * Fix issue where tile state could become out of sync
 * Don't spam the hardware on screen on/off
 * Stop trying to cache values in so many places, they get out of sync
   too easily.
 * Move the animator to the general display adjustments
 * Clean up outdoor mode state on screen toggle

Change-Id: Ic14425e5294d78698b9280dfb1237b222bb706cc
2016-04-21 00:26:40 -07:00
Adnan Begovic
9adbc6f4d4 cmsdk: Ignore "samples" subdir.
Since the samples are going to grow with
  each new interface addition, lets keep them
  in separate git projects and overlap their path
  into this directory.

Change-Id: Ie37283646fe8b1927a81a0f1fb299f56475e237d
2016-04-20 16:39:44 -07:00
Luis Vidal
ab3916fd2a Add Weather API test coverage
Test coverage for:
- DayForecast.Builder
- ServiceRequestResult.Builder
- WeatherInfo.Builder
- WeatherLocation.Builder

Change-Id: I66e716fa7a768b095e4b72011eda359b06a55f2e
TICKET: CYNGNOS-2491
2016-04-20 10:27:10 -07:00
Luis Vidal
02a71cc24e Weather API: Honor the values set for today's low/high temp
The vales passed to setTodaysHigh() and setTodaysLow() have no effect.
This patch fixes that problem. The values provided in the Builder
helper class will be actually set when the WeatherInfo object is built

Change-Id: I5f47b16a56fd577349d3b3d45ea7a753262f90ea
TICKET: CYNGNOS-2484
2016-04-18 16:52:29 -07:00
Adnan Begovic
18aa2f52eb cmsdk: Fix definition of live display tile, as its now dynamic.
Change-Id: I468e42b91996aad348fa0a1c85e0bc66597cf440
2016-04-18 12:27:47 -07:00
Michael Bestas
380d31c00c Automatic translation import
Change-Id: Ic3958966b87da56246142a98957d9cfe820b4066
2016-04-16 17:52:35 +03:00
Steve Kondik
3944915061 livedisplay: Fix validator for the nudge counter
* This is a range counter starting from -3 (initial value) which
   counts upwards once a day. It's finally set to 1 when either the
   feature is used or we gave up with the nudges.

Change-Id: Ia19b381aa35c598b31b46071479ae590dc8d9ffd
2016-04-15 22:50:12 -07:00
Danesh M
b62448a59b Revert "CmSdk : Add deprecated THIRD_PARTY_KEYGUARD permission"
This reverts commit 0918427452.

Change-Id: I5c81b9b38360c8f87b072416352f32079ad6deb4
2016-04-15 15:13:35 -07:00
Danesh M
0918427452 CmSdk : Add deprecated THIRD_PARTY_KEYGUARD permission
We need this for older apps to still function.

Change-Id: I8c0f37bab9ad82d2915884eb9c4f6ccdd9ba3c1a
2016-04-15 13:20:48 -07:00
Luca Stefani
e5545282f6 livedisplay: Update system-api
* Missing in 0ec60c69a0.

Change-Id: Ic649fe9831a4484c0331a1c6c1b97d1973039416
2016-04-15 07:03:55 -07:00
Danny Baumann
842344a358 livedisplay: Fix endless loop for devices that don't support outdoor
mode.

There was a logic mistake that caused _all_ modes to be skipped if
outdoor mode isn't supported. In order to avoid such mistakes in the
future, also simplify the logic and make it more easily understandable.

Change-Id: I5fe8edbb3c4d2dd05fc4b4a7f94ca05d4ecd408b
2016-04-15 12:48:07 +02:00
Steve Kondik
7cd7f79c75 livedisplay: Fix bad state after bootup
* Make sure all modules are updated, and clean up a little code.

Change-Id: Id02ddb1558deea4451783fbe27f495d63f63c910
2016-04-15 03:15:28 -07:00
Steve Kondik
0ec60c69a0 livedisplay: Don't explode if no modes are available
* Don't create the mode observer or try to publish tiles if none
   of the adaptive modes are supported.

Change-Id: Iee6fe8131b0614e10f35b5a03d65fb44c71c0da9
2016-04-15 02:38:42 -07:00
Steve Kondik
712426f249 livedisplay: Publish our own damn tile!
Change-Id: If765cb1fe1cbc34c857dc6237cd25a1fb27f848e
2016-04-14 20:35:15 -07:00
Steve Kondik
763e39ad54 livedisplay: Fix error checks when fetching config
Change-Id: I8ba43f32b2c45f626401f3cbc0050bc0593748c8
2016-04-14 20:34:59 -07:00
Michael Bestas
14190e4f00 Fix LiveDisplay string
Change-Id: Ic7e03a1284bc51ef91ad9e7d8d2572aec405ee14
2016-04-14 15:10:48 -07:00
Adnan Begovic
62604cf540 cmsdk: Exclude compiled 'cyanogenmod/library' java package.
Since aar's contain the raw resource to be compiled into the
  consumer package, having the compiled java from the resources
  inside of the java archive can lead to multiple instances
  of the class in the target package during compilation.

  Avoid that scenario by excluding the compile 'cyanogenmod/library'
  package from the final aar.

TICKET: CYNGNOS-2305
Change-Id: I3b40205f4c2173ecd059e034312ed18dc9c6de34
2016-04-14 10:51:47 -07:00
Luis Vidal
ad5e5d019f Remove public default constructor from CMWeatherManager.RequestStatus [1/2]
RequestStatus holds only final constants and should not provide
public constructors. This class also should be final.

This patch also fix minor typos on RequestStatus javadoc

Change-Id: I0deb1d6a9b23eed83451dec352bb4c410e2378d6
TICKET: CYNGNOS-2441
2016-04-13 17:52:16 -07:00
d34d
b49885a649 ExtViews: Pass input events to underlying Window
Change-Id: If4303a49dd0c637e9336dcf454e338b883906925
TICKET: CYNGNOS-2442
2016-04-13 17:35:37 -07:00
Luis Vidal
fe1812fd38 Weather API: Delegate the responsability of rejecting back to back requests [1/2]
The Weather Manager Service should not impose rules regarding how
a weather provide service wants to react to back to back weather
update requests, nor impose the time a caller should wait before
a new request can be submitted. These constraints vary between
weather services, so it's up the each implementation to enforce
these constraints.

With this patch, the Weather manager service will pass the requests
as they come from the requester and it will be up to the active service
provider decide whether process or reject the request.

Changes to API:
- Moved the request statuses to new inner class RequestStatus in
 CMWeatherManager
- Pass status arg to onLookupCityRequestCompleted()
- Added reject(int) method to ServiceRequest

Change-Id: I3512490688255e25395e955d506fe42ed52f8fe0
TICKET: CYNGNOS-2430
2016-04-13 15:22:40 -07:00
Luis Vidal
377fffca69 Use temperature unit from CMSettings on weather update requests
Make sure the the weather update requests are using the temperature
unit set by the user in the weather settings

Change-Id: Iac3a891b5afbcf36a87386f828b40bcbd0e1de02
TICKET: CYNGNOS-2429
2016-04-13 14:56:24 -07:00
Luis Vidal
ed4d063611 Add WEATHER_TEMPERATURE_UNIT to CMSettings [1/2]
Introduce WEATHER_TEMPERATURE_UNIT. This setting will be used to
store the temperature unit in which the weather data will be reported.

Users will be able to set this value in the weather settings menu.
Each weather service provider might choose to provide the user
with a way to overlay this value (for example via the settings
activity that each service provider can define)

Change-Id: Ib6e47c9790aba02e6c29bd7f783730efda9177f3
TICKET:CYNGNOS-2426
2016-04-13 12:45:25 -07:00
d34d
10da08aa5e cmsdk: correct naming of THIRD_PARTY_KEYGUARD perm
Change-Id: If2d062a90db340f8415d12897b16667fc834a848
TICKET: CYNGNOS-1705
2016-04-13 12:21:24 -07:00
Luis Vidal
ad0d8c53a0 Weather API: Return ID rather than RequestInfo [1/2]
Instead of exposing the RequestInfo object created by the WeatherMgr
return an ID to identify the request. This ID can be later used to
cancel the request if needed. The WeatherProviderService base class
keeps track of the ongoing requests and can map this ID to the
corresponding request

This patch also include the following minor changes:
- Use List instead of ArrayList in API
- Update javadoc to public methods to reflect API changes
- Use UUID random generator in immutable classes to generate the
  hashcode rather than relying solely in the hashcode of the builder
  object.

Change-Id: Ib88dd0ecddd6fdb016b77ac29709fbae092dea29
TICKET: CYNGNOS-2425
TICKET: CYNGNOS-2423
2016-04-13 11:57:38 -07:00
Steve Kondik
1dab5a0ca9 cmsdk: Refactoring LiveDisplay
* Moving LiveDisplay to CMSDK!
 * Completely redesigned the feature for future expansion.
 * No new features in this patch, but a proper API is being
   designed.

Change-Id: Ic8f55678f9141bf3386b2a1cf2fd1e8b3916c278
2016-04-13 01:37:08 -07:00
Roman Birg
620b1eb908 cmsdk: compile as aar
for common resources

TICKET: CYNGNOS-2305
Change-Id: Idc1872b5fa3884754b49b08d2f8381f18fba234d
Signed-off-by: Roman Birg <roman@cyngn.com>
Signed-off-by: Adnan Begovic <adnan@cyngn.com>
2016-04-12 15:27:07 -07:00