[Android General] Grouxho:
Enable - disable Dim Effect in Panel

This mod is on fly

It is compatible with Good lock. If the user has got Good lock enabled then the mod does nothing.

Guide

1.- Decompile SystemUI

2.- Edit ScrimController.smali

3.- Replace the next method

.method protected updateScrims()V
.locals 6 ### change it to 6

const/4 v3, 0x0

const/high16 v2, 0x3f800000 # 1.0f

const/4 v1, 0x0

const-class v0, Lcom/android/systemui/coloring/QSColoringServiceManager;

invoke-static {v0}, Lcom/android/systemui/Dependency;->get(Ljava/lang/Class;)Ljava/lang/Object;

move-result-object v0

check-cast v0, Lcom/android/systemui/coloring/QSColoringServiceManager;

invoke-virtual {v0}, Lcom/android/systemui/coloring/QSColoringServiceManager;->isQSColoringEnabled()Z

move-result v0

if-eqz v0, :cond_0abab ### change this

const-class v0, Lcom/android/systemui/coloring/QSColoringServiceManager;

invoke-static {v0}, Lcom/android/systemui/Dependency;->get(Ljava/lang/Class;)Ljava/lang/Object;

move-result-object v0

check-cast v0, Lcom/android/systemui/coloring/QSColoringServiceManager;

invoke-virtual {v0}, Lcom/android/systemui/coloring/QSColoringServiceManager;->isQSColoringDimEffectEnabled()Z

move-result v0

if-nez v0, :cond_0

invoke-direct {p0, v1}, Lcom/android/systemui/statusbar/phone/ScrimController;->setScrimInFrontColor(F)V

invoke-direct {p0, v1}, Lcom/android/systemui/statusbar/phone/ScrimController;->setScrimBehindColor(F)V

iput-boolean v3, p0, Lcom/android/systemui/statusbar/phone/ScrimController;->mAnimateChange:Z

return-void

:cond_0 ### match with this the below cond
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/ScrimController;->mAnimateKeyguardFadingOut:Z

if-nez v0, :cond_1

iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/ScrimController;->mForceHideScrims:Z

if-eqz v0, :cond_2

:cond_1
invoke-direct {p0, v1}, Lcom/android/systemui/statusbar/phone/ScrimController;->setScrimInFrontColor(F)V

invoke-direct {p0, v1}, Lcom/android/systemui/statusbar/phone/ScrimController;->setScrimBehindColor(F)V

:goto_0
iput-boolean v3, p0, Lcom/android/systemui/statusbar/phone/ScrimController;->mAnimateChange:Z

return-void

:cond_2
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/ScrimController;->mWakeAndUnlocking:Z

if-eqz v0, :cond_4

iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/ScrimController;->mDozing:Z

if-eqz v0, :cond_3

invoke-direct {p0, v1}, Lcom/android/systemui/statusbar/phone/ScrimController;->setScrimInFrontColor(F)V

invoke-direct {p0, v2}, Lcom/android/systemui/statusbar/phone/ScrimController;->setScrimBehindColor(F)V

goto :goto_0

:cond_3
invoke-direct {p0, v2}, Lcom/android/systemui/statusbar/phone/ScrimController;->setScrimInFrontColor(F)V

invoke-direct {p0, v1}, Lcom/android/systemui/statusbar/phone/ScrimController;->setScrimBehindColor(F)V

goto :goto_0

:cond_4
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/ScrimController;->mKeyguardShowing:Z

if-nez v0, :cond_5

iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/ScrimController;->mBouncerShowing:Z

xor-int/lit8 v0, v0, 0x1

if-eqz v0, :cond_5

invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/ScrimController;->updateScrimNormal()V

invoke-direct {p0, v1}, Lcom/android/systemui/statusbar/phone/ScrimController;->setScrimInFrontColor(F)V

goto :goto_0

:cond_5
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/ScrimController;->updateScrimKeyguard()V

goto :goto_0

####### add this block of code

:cond_0abab

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/ScrimController;->mScrimInFront:Lcom/android/systemui/statusbar/ScrimView;

invoke-virtual {v0}, Lcom/android/systemui/statusbar/ScrimView;->getContext()Landroid/content/Context;

move-result-object v0

invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v0

const-string v4, "b_ga_panel_dim"

const v5, 0x1

invoke-static {v0, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v0

if-eq v0, v5, :cond_0 ###match this jump with the above one

invoke-direct {p0, v1}, Lcom/android/systemui/statusbar/phone/ScrimController;->setScrimInFrontColor(F)V

invoke-direct {p0, v1}, Lcom/android/systemui/statusbar/phone/ScrimController;->setScrimBehindColor(F)V

iput-boolean v3, p0, Lcom/android/systemui/statusbar/phone/ScrimController;->mAnimateChange:Z

return-void

########

.end method

In the method you will see what changes i made (look for ## )

4.- RC

Add a switch preference, key -> "b_ga_panel_dim" default value -> true title -> "Dim Effect in Panel Enabled" (for example)

Enjoy

NOTES

- If you have a look to the code you will see how easy is to add dim level for user screen and lock screen... ...

- This mod is very used (everytime we pull down the panel) , as well as the blur one, so i recommend you to add an observer and to store the preferences value in variables inside the classes (ScrimController for this mod and StatusBarWindowManager for blur). Doing this, just replace the reading of the preference through contentresolver by reading the var value. You can imagine you will save many cpu cycles doing so.