Commit Graph

88 Commits

Author SHA1 Message Date
Zhao Wei Liew
d73a9322a4 cmsdk: cmhw: Deprecate TAP_TO_WAKE feature
All devices should use the native implementation now.

Change-Id: Ic29472ba28569536a8556f61229a8a8fe783354a
2017-01-24 08:14:53 +00:00
jrior001
b99c20a806 Add generic support for Lid Cover Apps
Many new devices have available flip cover cases with some form
of view window or notification options. Currently we support a
dotcase app for HTC and a View window app is under development.
Provide a new Intent to allow a common way to launch a variety
of device specific cover apps.

Change-Id: Ic986b239b75bfc6d76142451826b3f996e242a29
2017-01-18 15:25:08 +01:00
Zhao Wei Liew
cf51b678cd cmsdk: Fix @deprecated annotation mismatch warnings
Change-Id: I0141aa66139ac0fa6089aecd7056e017c4c1132f
2017-01-16 13:23:07 +00:00
Hendrik Hagendorn
5bb06dccb5 cmsdk: remove 'hide clock' option from clock position tunable
* Hiding the clock is now possible using the icon blacklist.
* Since the the hide option in the clock position tunable
  isn't currently implemented let's remove it

Change-Id: I2412051289a922dfc72cdf266b47f32cf7aaa31a
2017-01-06 12:06:01 +01:00
Zhao Wei Liew
79cced08e7 cmsdk: Deprecate STATS_COLLECTION_REPORTED CMSetting
The functionality that uses this setting has been removed.
This setting should no longer be used.

Change-Id: Iff887a711a9f8cac18cf9938280ddc99a5787615
2016-12-29 00:35:36 +00:00
Michael Bestas
f6e4623f6f FileUtils: Add util to check if a file exists
Change-Id: I565744821346c90ff670704a13fffc7bf464ff71
2016-12-10 12:27:32 -08:00
Zhao Wei Liew
1c5e5e7006 cmsdk: Add GlobalSettingSwitchPreference class
We need to add toggles for some AOSP global settings,
such as heads up notifications.

Change-Id: I5e3cc8717c639bed4ee99e40c350ef7e7c2d76bd
2016-12-10 01:34:25 -08:00
Ethan Chen
41eab0f81a cmsdk: Use ConnectivityManager to manage tethering
* Hotspot is not assigning DHCP addresses correctly if enabled
  through the profiles codepath using WifiManager.

Change-Id: I9b67748d1b51c873864cf11f9240372e367a0c53
2016-12-09 20:05:41 -08:00
Michael W
8534274f5f cmsdk: utils: Introduce PackageManagerUtils class
Partially based off the PackageManagerHelper class in Launcher3.

Change-Id: I0ed2ea210cb52ac4bd94c7bc5320c24e6d423279
2016-12-08 17:13:07 -08:00
Zhao Wei Liew
77b34c39ed CMSDK: Add volume answer call CMSetting
Change-Id: Ie7f14b1af053d23876908ec3c99f038e76fe5beb
2016-12-01 20:59:49 -08:00
Steve Kondik
e8aecd3a8a cmsdk: Ensure CMHW feature constants aren't optimized out
* The preferences constraints system uses reflection to look up
   fields via strings, we need to ensure they are not optimized
   out by Proguard. Alternatively we can manually enumerate them,
   but it's yet another list of constants to maintain. We should
   have used a proper enumeration to begin with, but so it goes.
 * The @VisibleForTesting annotation is honored by the platform for
   ensuring that Proguard doesn't stomp fields. The support library
   has an @Keep annotation, but it's only supported by Gradle. If
   it becomes supported by the platform in the future, switch to
   it instead.
 * Also add tests for all of this.

Change-Id: I9f324e003e2a9de5604085b978d5f95bdd098d32
2016-11-22 22:48:35 -08:00
Danny Baumann
e01237ee2f Add a CMSystemSettingDropDownPreference.
Change-Id: Ic3b7589fe3a33b62fba3949e968789a3a99cf9f6
2016-11-02 13:28:01 +01:00
Danny Baumann
fbd5dc1b07 Add option definition for vibration during zen mode.
Change-Id: I7398adbaa691bc6ec50b56328190a317bee805eb
2016-11-02 09:21:58 +01:00
Steve Kondik
e721f8cff4 cmsdk: Add support for split screen button behavior
Change-Id: I7289e8abe23d047f909066a9986e8b9d55bec27e
2016-10-18 23:37:02 -07:00
Steve Kondik
26977b4a75 cmsdk: Refactor Parts to use RemotePreference
* Delete ALL the codes!

Change-Id: I839ba927f03363601452bdc3d894e09549366302
2016-10-17 19:24:29 -07:00
Steve Kondik
3805419c29 cmsdk: RemotePreference API
* Factoring out the work done for CMParts into an actual API that can
   be used for all of the various device settings apps.

Change-Id: Ie1b47c900c2b37457b90f1b0af0634d5fe12fd9a
2016-10-17 19:24:01 -07:00
Steve Kondik
0dae635abe cmsdk: Helper for working with Settings URIs
* Add a bunch of helpers for dealing with settings URIs in
   a transparent way.
 * This also includes the "Observatory" which is an aggregator
   of ContentObservers. Inspired by TunerService.

Change-Id: Ie30c3f712d3c6536af559d93f7debe2dcc5ead06
2016-10-17 19:19:17 -07:00
Steve Kondik
78079eacb8 cmsdk: Add support for more preference constraints
* Add support for negation- prefix with !
 * Add requiresAction constraint, which checks if an application is
   available to resolve the given action
 * Fix issues with operations order
 * Add flag to remove a preference if it's intent can't be resolved
 * Add helper to allow setting minLines of a preference, since it's
   common for things to get weird with the kinds of behavior we
   are introducing everywhere
 * Add support for nuking *other* preferences. For example with
   Doze, many devices have custom features and a extra_settings
   panel which is redundant with the switch. Now we can trivially
   override the one we don't want.

Change-Id: Ibb14b05add56b403013e908db1105dce9d34faad
2016-10-17 19:18:59 -07:00
Zhao Wei Liew
5d787c24d0 cmsdk: preference: Add SecureSettingSwitchPreference
We may need to store/retrieve secure settings in some cases.

Change-Id: Ibf329652d8d057485e39060c956846755c3a91d2
2016-10-13 19:55:57 +08:00
Steve Kondik
cd98e0b30b cmsdk: Rework the PerformanceManager
* Added a proper API for this thing
 * Pass objects around with necessary metadata, pre-filtered and sorted
 * Added event log and service dump
 * Simplified locking and adjusted for performance / correctness
 * Clarified/beautified code where possible
 * TODO:
   - Write profile descriptions
   - Finish the UI
   - Clean up javadocs
   - Do something with per-app profiles, maybe

Change-Id: Ie2ef84031e81a18e95dcd62392c7e6939860d933
2016-10-12 04:06:33 -07:00
Steve Kondik
c27e31ffd7 cmsdk: Add support for PartsRefresher to CMPartsPreference
* Allow CMParts to update the summary (or any detail) of a preference
   so it can be shown correctly in the UI.
 * Also some cleanup and refactoring around the parts list.

Change-Id: Idc16a7eb1a1e4170671fd068bd240b88fadfb577
2016-10-11 02:36:10 -07:00
Zhao Wei Liew
33fc2d4385 cmsdk: Migrate STYLUS_ICON_ENABLED to CMSettings
Change-Id: If40a8f390d4105812e7fab89e3612f21d6d206a4
2016-10-09 05:47:30 -07:00
Zhao Wei Liew
a9367b4aac cmsdk: Remove duplicate legacy system element
This is already in the array several lines above.

Change-Id: I0e046902dc1bf01ea445587e1f8a4e7f8520051c
2016-10-09 05:47:09 -07:00
Steve Kondik
152ef22084 Merge branch 'cm-13.0' of git://github.com/CyanogenMod/cm_platform_sdk into cm-14.0
Change-Id: I28fdf53785f1ec81f5d811c099e81acdb91e0009
2016-10-09 05:20:44 -07:00
Steve Kondik
08086df9d0 cmsdk: Add constraints support for CMHardware features
* This patch will make it easy to hide preferences based on the
   lack of a CMHardware feature. In the preference, specify this:

     cm:requiresFeature="cmhardware:FEATURE_KEY_DISABLE"

   ..and the preference will magically be removed if the feature
   is not supported.

Change-Id: I51699df7b39bb38b9ea69c93ade658736f89b988
2016-10-08 19:37:20 -07:00
Steve Kondik
0452ebac72 cmsdk: Add search resources plumbing for CMParts
Change-Id: I541bbbabd81eb249b7696f23d5122b6a5f4f8f50
2016-10-08 04:22:31 -07:00
Steve Kondik
5ba48458e1 cmsdk: Change how parts are launched
* Encode the part into the action and use an explicit intent instead
   of relying on extras.

Change-Id: I4f035d6b839e9701e20a9b78dbe2a39757aad13e
2016-10-08 04:22:30 -07:00
d34d
c4f27d5b81 Themes: Introduce theme mixes into ThemesContract
Change-Id: I6341bada8e3ef674b272621f90bc9beb28767a59
TICKET: CYNGNOS-2121
2016-10-07 10:14:28 -07:00
Steve Kondik
5d08519c6c cmsdk: Add owner constraint for preferences
* Set "cm:requiresOwner=true" to enforce that the current user
   is an owner, otherwise the preference will be removed.

Change-Id: I20d1348f58a855d07676882db773f73687396a6d
2016-09-25 23:17:49 -07:00
Steve Kondik
2d61e0ceba cmsdk: Add constraints and behaviors for our preferences
* Add a new set of attributes which can be declared in the
   preference XML which will cause the preference to be
   removed from the hierarchy if the constraint is not met.
   Currently we can check for installed packages, system
   properties, config references, and system features.
 * CMPartsPreference is also updated to use similar logic
   based on the external XML.

Change-Id: If8fb39cd3312623e38bb3498bfb3f29ed8b444d6
2016-09-19 03:22:36 -07:00
Steve Kondik
9faa2740a5 cmsdk: Add ListPreference helpers backed by CMSettings
Change-Id: Ide607a4ba3b220d82aff5019f61ecdc7afe0a523
2016-09-14 01:47:44 -07:00
Steve Kondik
7db76d6a5d cmsdk: Add CMParts API
* Add a Preference subclass which queries CMParts and handles all
   the work needed to add a new part into Settings with a single
   line of XML.
 * The parts list lives in the CMParts app as res/xml/parts_catalog.xml
 * We also support receiving a broadcast to update the title/summary.

Change-Id: Iaceddc85272718ba93e4086cc2577c3b016419e2
2016-09-13 10:27:01 -07:00
Steve Kondik
3da45e19ad cmsdk: Untangle internal vs. external dependencies
* The public SDK build is currently including AIDLs which are
   meant to be used for internal purposes only. My assumption
   is that this particular implementation was done before we
   split off an "internal" SDK, which is used by the platform itself.
 * The issue came up when adding an AIDL which has a backing
   Java data object which was not included.
 * It should be safe to simply hide this interface. All references
   to it are hidden already. It is only used for internal purposes
   and does not change the API.
 * With the internal dependencies removed from the public SDK, we
   can completely remove the reference in the makefile.

Change-Id: I0515815543feb077ee5e289b9f900e28758c6e98
2016-09-11 13:54:30 -07:00
Steve Kondik
7be730bbf1 cmsdk: Add CMSettings preference helpers
* These lived in the Settings app previously, but are now moved as
   we need them in a few places.
 * The support library required to use these helpers, but we
   intentionally reference it using LOCAL_JAVA_LIBRARIES so the
   application will need to declare a dependency.

Change-Id: I56844def5e1100ca0300d0027312cc9adcaab941
2016-09-08 13:41:16 -07:00
Steve Kondik
aac8bdc05d cmsdk: Introduce API level 7 - Guava
Change-Id: I9fda50cc46d15e4f89a29303be18c8947befc3e1
2016-09-04 04:35:09 -07:00
Roman Birg
662cb51642 cmsdk: fix visible check in hasChanged
Previously the visible check was comparing the newly set value to
itself. Now we cache the old value, set new value, and can do a proper
comparison.

Change-Id: Idbe921bfe9e311551d6bfbad432c647c129f376e
Signed-off-by: Roman Birg <roman@cyngn.com>
2016-08-30 16:00:36 -07:00
Steve Kondik
6f2edde8a7 cmsdk: Temp fixes for bringup
Change-Id: I11e7425c523081f9cc52c7d3daf56cfabfe6424f
2016-08-29 05:43:29 -07:00
Steve Kondik
5501335568 cmsdk: Remove Wimax toggle
* This was specific to an ancient HTC implementation of Wimax and
   is no longer a thing. Feel free to revert if someone brings
   up Crespo4g :)

Change-Id: I64b50f8e6df443108ae84a96303ba7802cbed653
2016-08-29 00:55:09 -07:00
Steve Kondik
d22315e883 cmsdk: Revert custom dexopt changes
* Dexopt is no longer a thing on N.

Revert "You are now a developer!"

This reverts commit 2059ea6908.

Revert "[1/2] cmsdk: cm custom boot dexopt UI"

This reverts commit 6e5ab27fbb.

Change-Id: Ie50e8e6a77172d2b5b0659be831e7dd7a19fee04
2016-08-29 00:50:06 -07:00
Michael Bestas
2059ea6908 You are now a developer!
* Show alternative brand logo in dexopt screen
  when developer options are enabled
* Drawable by Asher

Change-Id: Ie100d7c3e9c96a7ad64c4cd65195d6f531090140
2016-08-20 18:07:38 +03:00
Adnan Begovic
c349280cf8 cmsdk: Finalize api level 6 (Fig).
Change-Id: I529806e5526faf7d23689354a6cc958d9989b95c
2016-08-17 14:18:44 -07:00
Danesh M
e1ba9407f7 CMSDK : Fix generateAlertColorFromDrawable for non BitmapDrawable
In the case that the bitmap being passed in was not a bitmap drawable,
we were not retaining any of the attributes from the original drawable.
This patch ensures we ask that drawable to draw on the canvas/bitmap so we
can use that information. Also add tests around it.

Change-Id: I3eefba6e6624fe0bed4965ddf9029320c40f7420
2016-08-14 21:57:37 -07:00
Alexander Martinz
6e5ab27fbb [1/2] cmsdk: cm custom boot dexopt UI
* Pass app info and number of installed packages to boot message UI
 * Ui by Asher and Joey, based on Alexander's previous work

Change-Id: I9298d7e2b85a703921abf62f8b91157e6f88803b
Signed-off-by: Joey Rizzoli <joey@cyanogenmoditalia.it>
2016-08-10 16:52:21 -07:00
Steve Kondik
db640a9648 livedisplay: Float-to-string conversions considered harmful
* Force US locale when doing internal flattening of HSIC objects
   into strings. This would crash in the validator if the user's
   local uses commands instead of dots to format floats.

Change-Id: I08f44238a486308a483205b97632114d2f7a77f1
2016-08-10 02:08:47 -07:00
Steve Kondik
87590f0b1e cmsdk/livedisplay: Add support for picture adjustment
* Allows adjustment of hue, saturation, intensity, and contrast.

Change-Id: Icf8ff6200a07b68e09dcd7f140a82e57b53944f7
2016-08-08 12:41:27 -07:00
Steve Kondik
86cae92291 livedisplay: Add support for direct color balance control
* We currently use the DisplayColorCalibration API for setting display
   temperature which makes a lot of guesses about what temperature
   the display really is. Some devices will support the new ColorBalance
   API (via QDCM or other mechanism), which offers a calibrated
   alternative. Add support for this, which will supercede DCC if
   available.
 * Additionally, define the available color temperature range as a
   set of overlayable values so this can be specified per-device.
   This range will be mapped to balance values using the power curve
   calculations in the new MathUtils class.

Change-Id: I99608c09807b747d962680293c7b0cee8d669003
2016-07-20 10:07:31 -07:00
Luis Vidal
46bed1698d cmsdk: Prevent NPE in CMWeatherManager
Verify that we have an instance of to the weather manager service
before we try to register/unregister a listener or query the
current weather provider.

Change-Id: Iec09073615f85626c6f64e4a55758aae52231ca8
2016-06-17 15:12:38 -07:00
d34d
9c42d415b9 ExtViews: Catch SecurityException due to bad interface
When interfaces get obfucsated, bad things happen.

Change-Id: I9b0829853da536f4047dab8223c97f993a399645
TICKET: CYNGNOS-2916
2016-06-16 14:04:23 -07:00
Michael Bestas
522b0c3db1 utils: Introduce FileUtils class
Change-Id: Icbfa068fa0db2ae28436063072dd4b576f1b2be1
2016-06-16 10:44:36 -07:00
Scott Mertz
aa11b3330a cmsdk: fixup javadoc in CMHardwareManager
Change-Id: I114e57c1b907de3cc7cdaff746b0391cef4b8eb0
2016-06-14 11:54:08 -07:00