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
*) 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
Different parts of the system need to check if advanced reboot is enabled,
so just move the method here and include it in said different parts.
The global actions constants also used to live in the frameworks, but as
they include our own additions and are also accessible by LineageParts,
place them here from now on.
Change-Id: Ic5a02b8118c702dced5a25d775a4cc84c92a3fc2
This class will be the new home for all the buttons logic currently
in fw/b. Currently, it only implements the "long press volume keys to
skip" feature.
Based on the following commits from cm-14.1:
commit 1296fb316946ca1361b2d32557b6c9e028f509c8
Author: Dark Eyes <dark_eyes_@hotmail.com>
Date: Sat Nov 5 12:09:31 2016 -0400
Fix long press volume buttons skip tracks
Without that patch, the volume changes up or down prior
to skipping tracks because the sendvolumekeyevent doesn't
have the mayChangeVolume condition. Also, that part is
useless cause the mUseTvRouting condition is taken care
of correctly later.
Change-Id: I88757315f135f013e7692861d46b3a07fbfc07d5
commit 61cebe2fea95f799b7b4edc540f6c38d3c13fbde
Author: Michael Bestas <mikeioannina@gmail.com>
Date: Thu Dec 18 14:43:22 2014 +0200
Fix volume key music controls and wake up
- Forward port code from cm-11.0 and adjust for 5.0
- Fix not being able to adjust volume when music control is on
- Disable screen off volume/music control when wake key is enabled
Change-Id: Ie0ad83965c41fd33120490c25a4ff3d9b2cbeb37
commit f41ba8af1796b4903dba3d134e56e8148f3b4808
Author: Austin T. Conn <atc3030dev@gmail.com>
Date: Wed Dec 17 13:28:00 2014 -0500
Settings: Forward Port Volume Long Press Skip Tracks (1/2)
Bring Forward Volume Rocker Track Change
Requires Settings Change
http://review.cyanogenmod.org/#/c/82222/
Change-Id: I70b00e08fe48707110725dd1daa56b1e48d15a03
Change-Id: I5c7f733913242bba822cf3f9f7e1e3320c2bedf7
* Used to "live" in fw/b since ever, but will be here from now on.
* This also brings AOSP configs (config_longPressOnHomeBehavior and
config_doubleTapOnHomeBehavior) to the SDK since those are being
extended, putting everything in one place.
* Long pressing home button will now default to launch assistant
and menu button to open recent apps, leaving the past behind.
Change-Id: I0ca2b2cf9a565a334c3edf19a978fa6d2c4d2ea3
*) The change https://review.lineageos.org/#/c/193263/ knowingly removed
the functionality where a pref group itself would be removed if all
child prefs were removed (see comments around PS8/9).
*) bgcngm discovered cases where this is needed so add this
functionality back.
Change-Id: Ibe684a6a21a2989623df71b08c2f5241682988ac
*) Graveyard is shared by all prefs with a given context.
*) When we reap in onAttached(), there may be prefs that aren't yet
attached to the hierarchy. Ensure that summonReaper keeps
track of them until the last onAttached() is called in the context.
*) Fixes self-removing prefs that weren't being removed on a settings
page that has at least one least other self-removing pref.
Change-Id: Ic48b86bb6f06aa29c44814a5487e2382349fb363
This reverts commit 027b615325.
While it served its original purpose, this was causing bad side-effects
when using our constraints (verified at least with requiresConfig and
requiresAction). Moving the reap to onAttached was rendering self-removing
prefs useless because if the view isn't loaded yet, the preference
(which also doesn't yet exists) can't really be hidden.
Change-Id: Ic61fe4b9979412d89c55ea1543c494e69bf6eab7
Adapted from the following in order to fit
into lineage-sdk (LuK1337):
Settings: Add LineageOS Updater
https://review.lineageos.org/191270
Change-Id: Ifce9da06b82075f1152d939f77a455f003879501
Migrate frameworks/base lineage feature
code handling to lineage-sdk.
*) Settings observation and most lineage lights
feature specific code has been moved to the
lineage-sdk.
*) Battery frameworks services call out to the
sdk to allow our features to make changes to
lights values.
Based on the commits:
Author: DvTonder <david.vantonder@gmail.com>
Author: Ricardo Cerqueira <cyanogenmod@cerqueira.org>
Date: Mon Nov 4 00:57:51 2013 +0000
Framework: Port CM9 features to CM10
Change-Id: Ibd63116df90b06f6ce6adb8a0343059bbb999bfb
Author: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sun Dec 8 15:24:41 2013 +0700
BatteryService: fix FC on boot until battery stat is present
updateLightsLocked() can be called from CM's added SettingsObserver
when battery stat is not present, causing an FC and a loop until
battery stat is present.
Change-Id: Ic4438fe50e98f1aa05ae1d0d26240bf9410fd92f
Author: Sam Mortimer <sam@mortimer.me.uk>
Date: Tue Dec 31 16:22:05 2013 -0800
[2/2] Framework: instant led test
Adds support a new notification extra boolean
EXTRA_FORCE_SHOW_LIGHTS. Used by settings
notification light picker to force lights on
when the screen is on.
Change-Id: If0a42d32b28fe8c02ef5f7dd148db7eb478fac17
Author: Michael Bestas <mikeioannina@gmail.com>
Date: Mon Aug 18 04:56:28 2014 +0300
Add support for single color notification LED (1/2)
Change-Id: I367af77036da9e87c6dd0df552ce4c56d945a44d
Author: Danesh M <daneshm90@gmail.com>
Date: Thu, 12 Nov 2015 10:52:11 -0800
Framework : Move System settings to CMSettings
Change-Id: I4e9fb06db7b9ba05e4a7bbe11916bb2271af4727
Author: Adnan Begovic <adnan@cyngn.com>
Date: Mon, 9 Nov 2015 16:26:00 -0800
fw: Move battery light settings to CMSettings.
Change-Id: I28e60473356b2a9af152df82d34ad7abc9918682
Author: Steve Kondik <steve@cyngn.com>
Date: Thu Sep 24 11:27:59 2015 -0700
lights: Automatically generate an LED color for notifications
Change-Id: I7288e52499819a6a6c75ed9d9ba7cfa1b13c5669
nms: Only generate LED colors if the device has a multicolored LED
* Check the overlay value before doing any of this stuff.
Change-Id: Iedfceba6bfc86b2761d8af57ecab51026bfa4c19
Change-Id: I7288e52499819a6a6c75ed9d9ba7cfa1b13c5669
Author: Adrian DC <radian.dc@gmail.com>
Date: Sat Oct 14 23:08:47 2017 +0200
fw: Rebrand to LineageOS and cleanup for Android Oreo
Change-Id: I21d424433bb52a17eea7974c4ea29a3a16fe1be5
Author: AdrianDC <radian.dc@gmail.com>
Date: Sat Jul 18 12:20:51 2015 +0200
Lights with Screen On [1/2]: Optional allowment of lights
Change-Id: I2071147d8ddab80ba0e1e7310e785ac3e03b3c7c
Lights with screen on: Don't disable leds after the lockscreen
Change-Id: If8f5b867a34be09fb061bb7ad040b16730f4e263
Framework : Move System settings to CMSettings
Change-Id: I4e9fb06db7b9ba05e4a7bbe11916bb2271af4727
fw: Rebrand to LineageOS and port for Android Oreo
Change-Id: I65cfeb659fe516ef43aa84b1c6d2eb6876df202a
Change-Id: If8f5b867a34be09fb061bb7ad040b16730f4e263
Author: Michael W <baddaemon87@gmail.com>
Date: Mon Oct 9 22:04:00 2017 +0200
Core: Battery warning levels are inclusive, not exclusive
Change-Id: Ib35b154b6117f7e26b4a3a5aee9254dda3adda12
Author: Adrian DC <radian.dc@gmail.com>
Date: Sat Oct 14 23:08:47 2017 +0200
fw: Rebrand to LineageOS and cleanup for Android Oreo
Change-Id: I845f866891386aee808a4e7e80f4ab7c3ad48830
Change-Id: I13fcb1e16756a8008d0850050e0b09ab0b92a56f
Migrate frameworks/base lineage feature
code handling to lineage-sdk.
*) Settings observation and most lineage lights
feature specific code has been moved to the
lineage-sdk.
*) Battery frameworks services call out to the
sdk to allow our features to make changes to
lights values.
Based on the commits:
Author: DvTonder <david.vantonder@gmail.com>
Author: Ricardo Cerqueira <cyanogenmod@cerqueira.org>
Date: Mon Nov 4 00:57:51 2013 +0000
Framework: Port CM9 features to CM10
Change-Id: Ibd63116df90b06f6ce6adb8a0343059bbb999bfb
Author: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sun Dec 8 15:24:41 2013 +0700
BatteryService: fix FC on boot until battery stat is present
updateLightsLocked() can be called from CM's added SettingsObserver
when battery stat is not present, causing an FC and a loop until
battery stat is present.
Change-Id: Ic4438fe50e98f1aa05ae1d0d26240bf9410fd92f
Author: Sam Mortimer <sam@mortimer.me.uk>
Date: Tue Dec 31 16:22:05 2013 -0800
[2/2] Framework: instant led test
Adds support a new notification extra boolean
EXTRA_FORCE_SHOW_LIGHTS. Used by settings
notification light picker to force lights on
when the screen is on.
Change-Id: If0a42d32b28fe8c02ef5f7dd148db7eb478fac17
Author: Michael Bestas <mikeioannina@gmail.com>
Date: Mon Aug 18 04:56:28 2014 +0300
Add support for single color notification LED (1/2)
Change-Id: I367af77036da9e87c6dd0df552ce4c56d945a44d
Author: Danesh M <daneshm90@gmail.com>
Date: Thu, 12 Nov 2015 10:52:11 -0800
Framework : Move System settings to CMSettings
Change-Id: I4e9fb06db7b9ba05e4a7bbe11916bb2271af4727
Author: Adnan Begovic <adnan@cyngn.com>
Date: Mon, 9 Nov 2015 16:26:00 -0800
fw: Move battery light settings to CMSettings.
Change-Id: I28e60473356b2a9af152df82d34ad7abc9918682
Author: Steve Kondik <steve@cyngn.com>
Date: Thu Sep 24 11:27:59 2015 -0700
lights: Automatically generate an LED color for notifications
Change-Id: I7288e52499819a6a6c75ed9d9ba7cfa1b13c5669
nms: Only generate LED colors if the device has a multicolored LED
* Check the overlay value before doing any of this stuff.
Change-Id: Iedfceba6bfc86b2761d8af57ecab51026bfa4c19
Change-Id: I7288e52499819a6a6c75ed9d9ba7cfa1b13c5669
Author: Adrian DC <radian.dc@gmail.com>
Date: Sat Oct 14 23:08:47 2017 +0200
fw: Rebrand to LineageOS and cleanup for Android Oreo
Change-Id: I21d424433bb52a17eea7974c4ea29a3a16fe1be5
Author: AdrianDC <radian.dc@gmail.com>
Date: Sat Jul 18 12:20:51 2015 +0200
Lights with Screen On [1/2]: Optional allowment of lights
Change-Id: I2071147d8ddab80ba0e1e7310e785ac3e03b3c7c
Lights with screen on: Don't disable leds after the lockscreen
Change-Id: If8f5b867a34be09fb061bb7ad040b16730f4e263
Framework : Move System settings to CMSettings
Change-Id: I4e9fb06db7b9ba05e4a7bbe11916bb2271af4727
fw: Rebrand to LineageOS and port for Android Oreo
Change-Id: I65cfeb659fe516ef43aa84b1c6d2eb6876df202a
Change-Id: If8f5b867a34be09fb061bb7ad040b16730f4e263
Author: Michael W <baddaemon87@gmail.com>
Date: Mon Oct 9 22:04:00 2017 +0200
Core: Battery warning levels are inclusive, not exclusive
Change-Id: Ib35b154b6117f7e26b4a3a5aee9254dda3adda12
Author: Adrian DC <radian.dc@gmail.com>
Date: Sat Oct 14 23:08:47 2017 +0200
fw: Rebrand to LineageOS and cleanup for Android Oreo
Change-Id: I845f866891386aee808a4e7e80f4ab7c3ad48830
Change-Id: Ic4c9c5f5602515ccbc2c6b8b10bcf3d2c6e34b4b
*) Moved lights capabilities from frameworks/base
NotificationManager to the lineage-sdk.
*) Add device has a battery light LIGHTS_BATTERY_LED capability.
Adapted from the original frameworks/base commits:
Author: Ricardo Cerqueira <android@cerqueira.org>
Date: Thu Nov 10 12:15:00 2016 +0000
NotificationManager: Concentrate LED light capabilities in a single location
We have a bunch of individual boolean toggles for various LED behaviors
and combinations, which end up getting used as a similarly sprawling bunch
of getResource() calls across various locations. And they keep piling up...
So... create a new overlayable bit field of LED capabilities,
config_deviceLightCapabilities, where we can throw everything
and expand in the future. Remove the obsolete overlays so that
everyone uses the new overlay moving forward.
Change-Id: I7d627914b058861048071fc15776031c4152157f
Author: Adrian DC <radian.dc@gmail.com>
Date: Sat Oct 14 23:08:47 2017 +0200
fw: Rebrand to LineageOS and cleanup for Android Oreo
Change-Id: If7468759925d1636adad1c253d68b5adbc6dfb26
Change-Id: Ib14badcc0a2ad165610dd7d0e90388170e1cd548
*) Eliminates visibility of the pref removal. You could previously
see vertical movement of text during initial display of replaced
prefs.
*) In addition, when reaping, use setVisible(false) instead of
removePreference. Otherwise, array out of bounds index exceptions
occur in frameworks pref support libraries (as a result of moving
from onBindViewHolder to onAttached).
Change-Id: I1a0045552572a590f89715f8d94156eddaaec469
*) Add support for integer requiresConfig resources (previously supported
only strings and bools). Preference is removed if the int is 0.
*) Add a new attribute requiresConfigMask that takes a string decimal int.
If requiresConfig is an integer then the pref is removed if
(requiresConfig resource value & requiresConfigMask value) == 0.
If requiresConfig is not an integer type then requiresConfigMask
is ignored.
*) Code clean-up for the rest of checking requiresConfig.
Change-Id: Ic2622809c02a94d9cecf6f59ed6e689fdb835458
This got removed unintentionally by:
Author: Sam Mortimer <sam@mortimer.me.uk>
Date: Wed Oct 11 23:00:18 2017 -0700
Remove ThirdPartyKeyguard
Change-Id: Ie3717b9ea7a23988ebd646ed7e2fe8f105a4a693
Add back the lock util methods from the original commit:
Author: Danesh M <daneshm90@gmail.com>
Date: Mon Feb 8 14:57:31 2016 -0800
CMSettings : Add option to pass swipe-up-to-unlock (3/3)
CYNGNOS-1873
Change-Id: Icdd2505dbc56a77f49a76ea61daf75c5d8a24fd6
Change-Id: I6177700be955f42505dbd5fbb23461f8e151e1b4
* The feature was used only on Huashan since 2015
* It serves only for a small part of the users
who wanted to restrict to one light instead
of three lights from the LEDs bar
* Due to Oreo's new HIDL interfaces stack,
the additional data holder would need
a custom lights interface which is useless
for a single device and a rare use case
Change-Id: Ie08a1d625c7ce00fefff5bc1159522207be69dbc
Signed-off-by: Adrian DC <radian.dc@gmail.com>