* 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
* 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
* 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
* 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
* 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
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
* Don't create the mode observer or try to publish tiles if none
of the adaptive modes are supported.
Change-Id: Iee6fe8131b0614e10f35b5a03d65fb44c71c0da9
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
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
* 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
An empty string for the package name implies the given component
should be cleared out, so make sure updateBootAnim respects that.
Change-Id: I07c7fc64970546c2d73a610d9c0b71f1e757657d
TICKET: CRACKLING-1043
- Renamed TYPE_GEO_LOCATION_REQ to TYPE_WEATHER_BY_GEO_LOCATION_REQ
and TYPE_WEATHER_LOCATION_REQ to TYPE_WEATHER_BY_WEATHER_LCATION_REQ
- Prevent null argument on setter methods. Documentation updated to
warn user of IllegalArgumentException if null is passed
Change-Id: I6ba8fb7fb3a10d8c964414b58e00d9ce77a74e84
TICKET: CYNGNOS-2377
- Builder constructor takes now 3 args: city name, temp and temp
unit. This is the minimun data that a weather service should
provide when a weather update request is processed.
- Float members have been changed to double. Setter/getter methods
updated.
- New setter/getter methods have been added to set current day high
and low temp. Forecast list should be used only to provide weather
forecast for upcoming days (this has been clearly documented).
WeatherContract was updated to include these 2 new columns
- Added javadoc to all public methods
- Timestamp is not longer required in constructor. A new method
setTimestamp has been added
Change-Id: Ia1edcfef0e2268f3881fed076c6ad74a81ca7334
TICKET: CYNGNOS-2365
TICKET: CYNGNOS-2382
TICKET: CYNGNOS-2356
TICKET: CYNGNOS-2360
getBroadcastItem is only valid if beginBroadcast is called
RemoteCallbackList.java:
"Retrieve an item in the active broadcast that was previously started
* with {@link #beginBroadcast}"
Fix logic to do so
TICKET: CYNGNOS-2397
Change-Id: Iec787a088ae3999e5024776ad50143249c434084
Add new API cancelRequest to CMWeatherManager. This will allow
clients to cancel a request that was previuosly submitted to
the weather service.
As part of this change, requestWeatherUpdate(weatherLocation),
requestWeatherUpdate(Location) and lookupCity(cityName) will
now return the RequestInfo object created if the request
was successfully submitted to the weather manager service
TICKET: CYNGNOS-2383
TICKET: CYNGNOS-2385
Change-Id: Ic122f91e0ea8a24d81dbed48741ef1e33567b56c
If a new weather service provider is selected, reset the timer so
the newly selected provider can process the weather update requests
Change-Id: I2d16000b0eb987c6d0985b465af3259a3619d8ef
TICKET: CYNGNOS-2364
Introduce CM Weather Manager and Weather Provider Services API.
The CM Weather Manager can be used by apps to request weather
updates.
The Weather Provider Services API allows a third party developer to
implement a weather service to process weather update requests and
update the CM Weather Content Provider data which can be consumed by
any other app holding the required permission.
Change-Id: Idcc80712ba92715109d3577d120f7fea85d6c996
Unflattening an empty string will result in a null ComponentName
which will cause an IllegalArgumentException when building the
LiveLockScreenInfo.
Change-Id: I0bafddb48a47ef67d9833cd12bff7eb34369425e
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
* CMContextConstants.Features.PERFORMANCE was mistakely used
instead of CMContextConstants.Features.PARTNER
Change-Id: I4582b2faac23b0a3d34a5c6396cffa56c6177556
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
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
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
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
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
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
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
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
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
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
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
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
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
This fixes the following errors during bootup:
QSTileHost: Error creating tile for spec: visualizer
QSTileHost: java.lang.IllegalArgumentException: Bad tile spec: visualizer
CYNGNOS-1722
Change-Id: Idd45ef73beb004fb4afb310bb335f3cc85b08330
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
Lower protection level of THIRD_PARTY_KEYGUARD permission from
signature|privileged to normal.
Change-Id: I464daba67a66e88efe6219cec2663a07d15ab3ed
TICKET: CYNGNOS-1689
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
For CM13, the third party keyguard permission is being added to
the cmsdk rather than frameworks/base. This patch also introduces
CmLockPatternUtils, a subclass of LockPatternUtils, which allows us
to make use of the new third party keyguard permissions in cmsdk.
Change-Id: I91fadfaae79e3f146e9ae73929cea91294ef8d87
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
The MODIFY_NETWORK_SETTINGS and MODIFY_SOUND_SETTINGS permissions were
not descriptive enough. Improve the strings to enumerate exactly what
settings these permissions protect.
Fixes FOR-23.
Change-Id: Idd64738c21d879462a7e7e6c65ceefdc771f1bcd