Commit Graph

840 Commits

Author SHA1 Message Date
Arne Coucheron
f13838a099 Revert "lineage-sdk: Switch back to AOSP TwilightService"
* Causing issues on several devices, with that the GPS gets stuck in
  ON state and can't be turned off
* No timezone fallback

This reverts commit cac65b8972.

Change-Id: Ie9b0249a1e6f94c374e90f89f49d506b1ec6c50d
2018-06-06 08:00:50 +02:00
Sam Mortimer
e703ff0a0b Add led capability LIGHTS_ADJUSTABLE_BATTERY_LED_BRIGHTNESS
*) Many existing liblights support notification brightness
   control via the alpha channel but do not support similar
   for the battery led.

*) 8f7a4559ab
   introduced a dependency on light capability
   LIGHTS_ADJUSTABLE_BATTERY_LED_BRIGHTNESS such that, when
   set, it was assumed that the battery led brightness is
   also liblights adjustable.  It turned out that this
   was not the case.

*) Create a new capability to allow devices to distinguish
   whether their liblights supports adjustable brightness
   control for notification and battery leds independently
   of one another.

*) Document how brightness support works in LightsCapabilities.

*) Copy LightsCapabilities comments to the default lights config
   to raise visibility.

Change-Id: Id95905f07128c78c6acacf3b60d71bb37f70bcfb
2018-06-05 20:26:52 +02:00
Michael Bestas
506bef406e Automatic translation import
Change-Id: I4c2317a017fb1c58b9b490e4e9e9e05bec1275de
2018-06-03 14:10:28 +03:00
Rashed Abdel-Tawab
18fd692bbd lineage-sdk: Add backend for reading enhancement
Change-Id: Ibd1c9e057ddf8e9d21657aef0ebeeaa9a253e92d
2018-05-24 21:39:00 +02:00
Michael Bestas
ff242a26c1 Automatic translation import
Change-Id: I2ba6cf000f997a70900a390768321c9961b9bc14
2018-05-08 19:47:48 +03:00
Sam Mortimer
cac65b8972 lineage-sdk: Switch back to AOSP TwilightService
*) cyanogen@ forked a local copy of TwilightService in
   683c67fdd4
   However, the AOSP Twilight API is now much leaner and will continue
   to receive bug fixes which our local copy won't.  Therefore, switch
   back to fw/b TwilightService making changes to match the API as needed.

*) Refactor getTwilightK() now that yesterday, today, tomorrow sunset/sunrise
   values are no longer directly exposed by class TwilightState.  (And make it
   more readable at the same time.)

*) Return < 0 from getTwilightK() if a useful result couldn't be determined
   (eg lack of location) and update the caller so as not to try changing the
   temperature when this happens.  Previously, getTwilightK() would always
   return the day temperature on failure.

Change-Id: If1043435ccfee90fe5c892991d314009d13b33bb
2018-05-07 01:49:53 +02:00
Bruno Martins
285d9d6dbe LineageBatteryLights: Fix brightness for devices with segmented leds
* In case mCanAdjustBrightness was false, the brightness level would
   always be set to the maximum value.

Change-Id: I034bc17ac1174c491830f0a6cb1969a99ee900a7
2018-04-26 18:52:26 +02:00
Bruno Martins
bd4ca1f551 LineageBatteryLights: Take current user settings into account
Change-Id: Ie99c14a73c14e1f5b6c39125625153f2628f884d
2018-04-26 15:13:35 +01:00
Bruno Martins
89eb3d49de LineageBatteryLights: Rename some class members and add more debugging
* Follow LineageNotificationLights debug logic

Change-Id: I6b4a91db45a119c8c0b8b30684386765b73b93d2
2018-04-26 15:13:04 +01:00
Michael Bestas
8f7a4559ab lineage-sdk: Allow adjusting brightness of non-RGB LEDs
* Mimic LineageNotificationLights logic

Change-Id: Ifc0c899ef78dbdec22fa69ecd0bcffe1a9488afe
2018-04-22 03:22:14 +02:00
Michael Bestas
da7aad6ea2 Automatic translation import
Change-Id: I900e08f5e60de36e0112582f368268ab2550ee9a
2018-04-20 00:56:24 +03:00
Paul Keith
e45961db1d sdk: Remove low power restrictions on color control
* We no longer support the GPU backed, power hungry, color
  transformations that this check was put in place for, so
  remove the restriction on color temp changes for low power
* This is desirable because low power situations happen often
  at times later in the day, when blasting users with blue
  light (for auto night mode) is undesirable, and because
  reducing the intensity of colors is more power efficient,
  at least for AMOLED displays

Change-Id: I6b78a3f626cff3387d2acafa9c73cdf6af208fef
2018-04-10 16:04:02 +02:00
Michael Bestas
a34e338626 Automatic translation import
Change-Id: Id5a6f4eb1afe35cb95416832a51c3c64aa4a3696
2018-04-01 22:33:09 +03:00
Dan Pasanen
faca0b31b6 LineageSettingsProvider: explicitly include android support libs
* Fixes non-jack build

Change-Id: I1b22ad0ca9e21e2b329678be18f02cf69de44a1a
2018-03-21 22:50:36 +00:00
Bruno Martins
523448f4c6 README: Point to the new wiki
Change-Id: I8a4ced2e399af49317dda0ed6a0bda5af34b2742
2018-03-21 15:00:47 +00:00
LuK1337
bd83e97381 lineage-sdk: Update validators for button settings
* Fixes ArrayIndexOutOfBoundsException when accessing
  button settings after update from 14.1 when user had
  one hand selected before.

Change-Id: I3a8663211cfc5dd7ee22dbb6fa85a8eafb746790
2018-03-18 13:43:17 +00:00
Joey
fdd21f4a59 sdk: ilama API (9)
Change-Id: I22ec35e3ab59fe64c223e8e3433e12c05870a1c0
Signed-off-by: Joey <joey@lineageos.org>
2018-03-12 14:04:47 +01:00
Joey
72bfc040c6 sdk: workaround for runtime-permission request dialog with GooglePackageManager
google's package manager uses the android:description
attribute as description for the runtime permission request dialog
with non-default dangerous permissions, so this would result in something like

"Allow <APP NAME> to _Allows an app to customize the system colors._ ?"

Let's change it to something more neutral so it can be used both as
in-settings description and for runtime dialogs

Change-Id: Iade57105a7af5d132a258fedadefe0f017fc4502
Signed-off-by: Joey <joey@lineageos.org>
2018-03-11 16:22:59 +00:00
Joey
15fa12ec02 sdk: fixes for documentation
Change-Id: Iace1ed8b9a4c38afda908a6923bdbea4679cba83
Signed-off-by: Joey <joey@lineageos.org>
2018-03-11 16:22:59 +00:00
Joey
5a72b57502 sdk: Styles API finalization for API9
Changes:

- Added getter for global style and current accent
- Added getter for a list of (available) trusted overlays
- Apps that want to change the global style now MUST specify their
  package name when calling setGlobalStyle().
  LineageParts will expose the name of the app that's currently managing
  the global style
- Improved documentation

Change-Id: Iaa1b106f43684b4120aa0f39023ebfddcb379806
Signed-off-by: Joey <joey@lineageos.org>
2018-03-11 16:22:59 +00:00
Michael Bestas
d70eb3905a Automatic translation import
Change-Id: Ie12729572a5f5aff8198c4d642b895fafcbf2c10
2018-03-09 00:36:25 +02:00
Bruno Martins
945545d8b9 LineageSettings: Add a setting for button backlight only when pressed
Change-Id: I1a914a5f0dab22376f2a86d58be4e4a0c233f6ac
2018-03-07 09:26:16 +00:00
Bruno Martins
a9afea70c3 lineage-sdk: Update the way OMS records details about overlays
Change-Id: If5c5988e32b9ee7bec129b60b8b13ee4772904b2
2018-03-05 22:11:22 +00:00
Joey
76fc3d3942 sdk: introduce Style API
This API will allow apps to change global style mode and accent.

Global style mode can be
* Automatic (wallpaper)
* Automatic (day of time)
* Light
* Dark

Accent colors are defined in the caller application that will have
to pass the package name.

It's possible for apps to pass a Bitmap and get a suggestion
of a global style + accent color that can be applied.

Restrictions:
* Only one accent can be enabled at time.
* We're not limiting this to system apps, but we're marking
  this as dangerous permissions so apps will have to require
  it at runtime to the user.

Change-Id: I921e8758c3ae093a88e897899612830258c97f8d
Signed-off-by: Joey <joey@lineageos.org>
2018-03-05 13:33:30 +00:00
Sam Mortimer
17b61ed328 lineage-sdk lights: Let Lineage lights decide if notification led is on/off
*) Allows us to cater for the case where the notification led is turned off
   and yet the user wants to adjust battery light settings (which requires
   posting led notifications to illustrate the change).

Change-Id: I24d128d796a44f5b3e9051d441427cc19e2a3822
2018-02-28 00:06:35 -08:00
Ethan Chen
be65612e2a lineage-sdk: Add vendor platform signature overlay
Change-Id: I7e2daaaad194536d0e4fab4edcfb570d3038e10b
2018-02-27 05:19:36 +00:00
Michael Bestas
b68e02306a Automatic translation import
Change-Id: I5f0d7df148653f6f67f826c8ee4770dc19992d23
2018-02-25 22:04:41 +02:00
LuK1337
5c6b56138f LineageSettingsProvider: Fix default setting for DEV_FORCE_SHOW_NAVBAR
* It has been moved to Global.

Change-Id: I99dfa3742bd0c7963b4795b13afe5d4c8a0681c3
2018-02-23 21:05:56 +01:00
Michael Bestas
1c51c1c2e8 Automatic translation import
Change-Id: I8081d8983553a18b617b784ebbf8c8b0a27b511e
2018-02-22 03:50:39 +02:00
Asher Simonds
c97a9ad191 LineageSettingsProvider: adaptive icon
Change-Id: I6a6d2acd2b319d313d02b18c59464563f1a84565
2018-02-17 12:51:03 +00:00
Joey
becaa68f53 sdk: add TILE_LOCATION_DETAIL logging const
Change-Id: I036b2e332ba0b03e50d323daf395bb13d160656d
Signed-off-by: Joey <joey@lineageos.org>
2018-02-16 21:33:39 +00:00
Sam Mortimer
681bd06b36 lineage-sdk: Set drawable bounds in generateAlertColorFromDrawable()
*) Android docs say this is required.

*) Fixes generating alert color from oreo gmail app (and probably
   many others).

Change-Id: Iad9a8ea82531c1cf844fae5456fd998a4b486165
2018-02-13 17:06:14 +00:00
Sam Mortimer
b37c96df9c lineage-sdk lights: Treat requested led color of 0 as needing a default
*) fw/b now sets the color to 0 to indicate that we need to set
   a default (to cover Oreo+ sdk where DEFAULT_LIGHTS has been
   deprecated).

Change-Id: I91b7cfff2ea6f8c1b999b6246c14416a2a47cbfb
2018-02-12 10:53:41 -08:00
Pranav Vashi
9a097830fa livedisplay: don't throw exception if config is not ready, warning is enough
Throwing an exception leads to rescueMode in oreo

Change-Id: I9c4cb7af8cae51936f439641b79ae522c84eaaee
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2018-02-11 20:22:13 +01:00
Joey
6b4410555a sdk: livedisplay: add a method to determine whether night mode is enabled
LiveDisplayManager.getMode() returns MODE_AUTO when night mode is enabled
automatically, so there's no way to determine if night is on when livedisplay
changes automatically

Change-Id: Ia47fc127232c2bb3b6634b55712060a919f8c9c1
Signed-off-by: Joey <joey@lineageos.org>
2018-02-11 20:22:13 +01:00
Joey
157a7c1cde sdk: add berry global style and accent settings
Change-Id: If4b2d913713c7e5d2dab8dd43a41a7d0db3c6cb2
Signed-off-by: Joey <joey@lineageos.org>
2018-02-11 20:22:13 +01:00
Joey
376449bca3 sdk: add accent names references
Change-Id: Ib7d68029cc6468c1c0b81a75da05025762290c17
Signed-off-by: Joey <joey@lineageos.org>
2018-02-11 20:22:13 +01:00
Luca Stefani
38b21a6648 sdk: Cleanup PerformanceManager
* Remove per-app profiles support
* Remove cpu boost support

Change-Id: I37e7473f8df1d08a69bc9274ae356dc1133811db
2018-02-08 17:33:54 +01:00
dianlujitao
18337dc1da lineage-sdk: Reenable performance profiles
Change-Id: Ic179230f425747c360c4a0ce6a9d446ca2d97265
2018-02-08 14:37:58 +00:00
qjohn
f8eaf9f782 lineage: Fix LiveDisplay tile off color
* Should match other icons when disabled.

Change-Id: Ic745d71b0eef0fca68a63e9558a43c203334e819
2018-02-01 01:31:16 +02:00
Jon Haus
7ea84eb2f9 lineage-sdk: Add Network Traffic [2/3]
Changes made since the original implementation from older branches:

*) Forward-ported to Oreo and adapted to Lineage SDK (bgcngm).

*) Implement LineageStatusBarItem interfaces to receive visibility
   and color tint information (bgcngm / sam3000).

*) Move from fw/b to lineage-sdk (sam3000).

*) Increase refresh interval from 1s to 2s (sam3000).

*) Don't generate messages when the statusbar isn't visible (sam3000).

*) Allow for choice of unit to be kb/s or Mb/s (and kB/s and MB/s). This
   deprecates threshold selection for autohide (sam3000).

*) Add an option for whether units should be shown in the
   statusbar (sam3000).

*) Various other simplifications (sam3000).

*) Added vector drawables (courtesy of kover).

Change-Id: Ia5aadc3f03a7b434a047accbd7d53f4aa44c77fb
2018-01-28 03:52:35 +00:00
Sam Mortimer
27a44cc178 lineage-sdk: Add LineageStatusBarItem interfaces
*) Introduce LineageStatusBarItem class that contains interfaces
   and utility methods that can be used by status bar items that
   that are hosted here in the lineage-sdk in order to communicate
   with systemui.

*) Nested interface: Manager
   Implemented by layout view LineageStatusBarItemHolder in systemui.
   Contains methods that are used to request receipt of certain
   systemui events.

*) Nested interface: DarkReceiver
   Can be used to listen for systemui DarkReceiver events.

*) Nested interface: VisibilityReceiver
   Can be used to listen for changes in visibility of a statusbar item.
   Works even if the statusbar item sets it's own visibility to GONE.

*) Util method: findManager(View v) walks up through parent views to
   look for something that implements Manager.

*) Systemui side that provides a layout that implements Manager:
   https://review.lineageos.org/#/c/202265/

Change-Id: Ie237db5bfac9994b87de39372505cd61c39d89ee
2018-01-28 03:52:17 +00:00
Sam Mortimer
e7008a222e LineageSettingsProvider: Support migration from cmsettings
*) Migrate database from cmsettings.db to lineagesettings.db

*) Remove old CMSettingsProvider.xml shared_prefs.

*) Remove the code to disable the PreBootReceiver component.
   PackageManager is not yet ready for component lookups when
   LineageSettings is called during fw/b service startups.
   However, the preboot intent is only sent when the build
   fingerprint changes so disabling it doesn't really buy us
   anything.  We also track and check migration state in
   sharedPrefs anyway.

Change-Id: I636f8315ce8a36f6d223d6a5accfe11c40ef9570
2018-01-27 13:25:35 +00:00
Sam Mortimer
22e88073d7 lineage-sdk internal: Add FileUtils delete() and rename() helpers
Change-Id: I00170f5c42a9849ec71b2c328b56b1ee32e73747
2018-01-27 13:25:30 +00:00
Sam Mortimer
c7a8ed54b5 lineage-sdk: DnD light brightness control for battery and notifications
*) Support separate normal and dnd led brightness levels for battery
   and notifications.

*) Move lineage-specific notification bundle extras definitions from fw/b
   to LineageNotification here in the sdk.

*) In addition to the existing bundle extra EXTRA_FORCE_SHOW_LIGHTS, add
   a new extra EXTRA_FORCE_LIGHT_BRIGHTNESS that can be used to override
   the brightness level set by a Lineage system setting brightness level
   on a per notification basis.  This is used by the brightness sliders
   in LineageParts that otherwise would have to juggle changing / restoring
   the system led brightness setting whenever the a slider is on display.

*) Disable all lights in dnd mode when lineage setting ZEN_ALLOW_LIGHTS
   is set to 0.

Change-Id: I917f402a291682b582f68c8324a33c461357dad9
2018-01-25 20:38:10 +00:00
Michael Bestas
a9aeed9a58 lineage-sdk: Cleanup whitespace in resources
* Fixup after LineageOS rebrand and legacy features strip

Change-Id: If998f2c17402facb1724f7e2c58d968e4bf95b21
2018-01-24 02:43:13 +02:00
Michael Bestas
4496c7fb1c Revert "Add resources for WiFi customization"
* No longer needed, last used in cm-13.0

This reverts commit c972c0e85e.

Change-Id: I18d1256c97930c80240e27e52c493795c6f2c4f8
2018-01-24 02:43:13 +02:00
Michael Bestas
d3907794a6 lineage-sdk: Remove MediaRecorder API
* Last used in cm-13.0 for cyngn purposes

Change-Id: Ie5aa8b224c29f2d716489cf7a7eb2dfe2d8a3bbf
2018-01-24 02:43:13 +02:00
Michael Bestas
900f0098ba lineage-sdk: Remove ACTION_APP_FAILURE intent
* Was used by ThemeManagerService

Change-Id: I94b5e640a8280edced2706ab029a2558f2003486
2018-01-24 02:43:13 +02:00
Michael Bestas
e54c07d4ed lineage-sdk: Remove alarm clock API
* Last used/implemented in cm-13.0 DeskClock

Change-Id: I9db1a72e29fd2ce232f7cad69ee9b5a6fadfa5de
2018-01-24 02:43:12 +02:00