* Some devices might return unsupported, therefore
explicitly label this state as bad
* Also applies for special situations where encryption
is essentially impossible, like booting with
MultiROM from an external storage
Change-Id: I7752933bad05bf8c67f5ca0d3fba7c5b38833c87
When an app target pre-O releases, the default max aspect ratio
is 1.86:1 which leads to ugly black areas on devices that have
screens with higher aspect ratio (for example Galaxy S8/S9).
This change adds an option to allow users to change aspect ratio
for pre-O apps to full screen aspect ratio.
Change-Id: I2531542f736ee7b809ef7faffd72e5963e7d20d6
* 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
*) 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
*) 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
* In case mCanAdjustBrightness was false, the brightness level would
always be set to the maximum value.
Change-Id: I034bc17ac1174c491830f0a6cb1969a99ee900a7
* 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
* Fixes ArrayIndexOutOfBoundsException when accessing
button settings after update from 14.1 when user had
one hand selected before.
Change-Id: I3a8663211cfc5dd7ee22dbb6fa85a8eafb746790
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>
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>
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>
*) 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
*) Android docs say this is required.
*) Fixes generating alert color from oreo gmail app (and probably
many others).
Change-Id: Iad9a8ea82531c1cf844fae5456fd998a4b486165
*) 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
Throwing an exception leads to rescueMode in oreo
Change-Id: I9c4cb7af8cae51936f439641b79ae522c84eaaee
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
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>
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
*) 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
*) 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