[Xposed Framework Modules] tony78960:
[size=+2]Automation[/size]

It is possible to control Screen Filter via intents, here is how the magic works:

There are three different intent actions:

com.tonymanou.screenfilter.action.DISABLE

com.tonymanou.screenfilter.action.ENABLE

com.tonymanou.screenfilter.action.TOGGLE

With each of these actions, you can choose which filter you want to control by setting one or both of the following extras:

FILTER_DIM

Valid values for 'selected' are: "1" (int), "true" (boolean) or no value (null string).

Valid values for 'unselected' are: "0" (int), "false" (boolean) or just don't use this extra.

FILTER_COLOR

Valid values for 'selected' are: "1" (int), "true" (boolean) or no value (null string).

Valid values for 'unselected' are: "0" (int), "false" (boolean) or just don't use this extra.

In the case of ENABLE and TOGGLE actions, you can change the value of the filters with the following extras:

TRANSPARENCY

Valid values are 8 bit unsigned integers within the transparency interval you set, between 5 and 255.

Works only if FILTER_DIM is selected and if the darkening filter is getting enabled.

COLOR

Valid values are 32 bit signed integers in base 10 representing the ARGB color (hexadecimal string not supported yet).

Works only if FILTER_COLOR is selected and if the color filter is getting enabled.

Note: if both FILTER_DIM and FILTER_COLOR are unselected or if they are not given, only the darkening filter is affected by the action and TRANSPARENCY is skipped.

For instance, using the command-line:

adb shell am broadcast -a com.tonymanou.screenfilter.action.TOGGLE

Toggles the darkening filter.

adb shell am broadcast -a com.tonymanou.screenfilter.action.ENABLE --ez FILTER_DIM true --ei TRANSPARENCY 125

Enables the darkening filter at the transparency 125.

adb shell am broadcast -a com.tonymanou.screenfilter.action.ENABLE --ei FILTER_COLOR 1 --ei COLOR 792333838

Enables the color filter at the color #2F3A0E0E (792333838 = 0x2F3A0E0E).

But...

adb shell am broadcast -a com.tonymanou.screenfilter.action.DISABLE --ei FILTER_COLOR 0

Will disable the darkening filter /!\

Screen Filter is also provides shortcuts and is recognized as a plugin in Locale/Tasker.

Here is how the "linked filters" option works:

Not linked:

darkening enabled, color enabled

--> darkening is disabled, color is disabled

darkening enabled, color disabled

--> darkening is disabled, color is enabled & color updated

darkening disabled, color enabled

--> darkening is enabled & transparency updated, color is disabled

darkening disabled, color disabled

--> darkening is enabled & transparency updated, color is enabled & color updated

Linked:

darkening enabled, color enabled

--> darkening is disabled, color is disabled

darkening enabled, color disabled

--> darkening is disabled

darkening disabled, color enabled

--> darkening is enabled & transparency updated, color is updated

darkening disabled, color disabled

--> darkening is enabled & transparency updated, color is enabled & color updated

[size=+2]Testing[/size]

[size=+1]

AOSP based

[/size]

Successfully tested on:

Android emulator 4.0.3

Genymotion 4.1.1 / 4.3 / 4.4.2

CM 11 (KK 4.4.4)

Reported working on:

CM 10.2 (JB 4.3.1) on GT-i8190 [post]

CM 9 (ICS 4.0.4) on LG Optimus L3 [post]

[size=+1]

Stock

[/size]

Reported working on:

Omni Rom on Galaxy R [post] and Galaxy S3 (GT-I9300) [post]

Samy Deluxe Pick Your King 4.4.2 on Galaxy S4 (GTI9505) [post]

Stock 4.3 MK2 baseband on Galaxy S4 (SCH-R970 USCC) [post]

Stock 4.4 rooted on Galaxy Note 2 [post]

Crash ROM (17.1) on Galaxy Note 3 (N9005) [post]

Stock TouchWiz 4.4.2 on Galaxy Note 3 (SM-N9005) [post] and on Note Pro 12.2 (SM-P905) [post]

CloudyG3 (KitKat) on LG G2 [post]

Stock rooted ROM on T-Mobile LG G3 [post]

Stock 4.4.2 (version 183.46.15) on RAZR HD [post]

Stock 4.4.2 on Moto G (XT1032) [post]

Carbon Rom 4.4.4 on Galaxy S4 mini [post]

KitKat Google Edition on Galaxy S4 [post]

Stock 4.4.4 on Nexus 5 [post]

Stock Sony 4.4.4 on Xperia Z (C6603) [post]

Stock 4.2.1 on Cubot One [post]

. . .

If you get problems after installation, check in the following section if the bug is already known. If not, then read the Troubleshooting section.

[size=+2]Known bugs[/size]

Screen-off animation (like electron beam / CRT effect) is not affected by the filter

As you can see in the first post, screenshots are affected by the filter

Quick settings disappear when the toolbox is visible on Stock Sense 6 (HTC One m7 and m8)

Stock ROM where SystemUI addon is not loaded:

Stock 4.4.2 on Elephone P10c

Stock 4.4.2 on i9500

Stock 4.4.2 on Micromax A106

Neat rom 4.1.2 on SGS2

[size=+2]Troubleshooting[/size]

In case you set the filter too dark and you can't see anything on your screen, just reboot your device.

After installation or update of the module, [highlight]you

must

reboot your device[/highlight] to get the latest changes fully loaded.

If it does not work even after reboot:

first, check if Xposed is working and if the module is activated in the Xposed Installer,

then, post in the thread indicating your ROM and attaching:

your last Xposed error log (the /data/data/de.robv.android.xposed.installer/log/error.log file)

and your SystemUI.apk (should be located in /system/app or /system/priv-app)

Thanks!

[size=+2]To-do list[/size]

Toolbox customization:

Hide the toolbox from notification panel or quick settings independently

Choose location (top/bottom)

Change the height

Double tap on the icon to open settings activity

Full toolbox customization:

Change items location

Ability to make the button transparent or replace it by a grey(off)/white(on) image

Ability to add shortcuts to some values

Filter improvements:

Let the user create different settings (color + transparency)

Filter pattern [post] [post]

Darkening filter using an image [post]

Filter blending using multiply instead of addition (?)

Allow unfiltered screenshots (?)

Other ways to toggle the filter:

Notification with ^ and v buttons

Overlay control [post]

Automation:

Auto enable at device startup

Auto enable depending on application context

Auto enable depending on the time and/or battery level

Other:

Make the project open-source

Llama integration (locale changer)

Make use of the luminosity sensor