[Android General] Grouxho:
Yeah, you are right. But sorry bro, i forgot most of you use same mods ...... :good:

Well, this is ok, of course, but once we want to add a switch, let´s do it properly to minimize unneccessary cpu cylces . Let´s add the switch code and the call to blur only when good lock plugin is not present and enabled. In this way we save uinnecessary parsing off settings xml in this cases:

So,

.method private apply(Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;)V

we should look for

...

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

move-result v1

if-eqz v1, :cond_0

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

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

move-result-object v1

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

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

move-result v1

if-eqz v1, :cond_0

invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->applyQSColoringBlurEffect()V

:cond_0

invoke-direct {p0, p1}, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->applyCoverFlags(Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;)V
...

we should change the next cond jump

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

move-result v1

if-eqz v1, :cond_0aaaaaa ###### we change this

invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->applyQSColoringBlurEffect()V

:cond_0 ### we keep this

then at the end of the method we add this code

invoke-direct {p0, p1}, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->applyBouncer(Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;)V

goto :goto_1

### add this block of code
:cond_0aaaaa

+const-string/jumbo v4, "b_ga_panel_blur_enable"

+const v5, 0x0

+invoke-static {v4, v5}, Lcom/android/wubydax/GearUtils;->getDbIntForKey(Ljava/lang/String;I)I

+move-result v4

+if-eqz v4, :cond_0 #### match it with previous cond label

+invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->grx_applyQSColoringBlurEffect()V

goto: goto_go

####

.end method

It is important to avoid cpu cycles when you read settings keys.

Well, have a look to the code, i have just written it without checking your added vars.. etc.. i just wanted to tell you how to add it properly if you want to avoid such an amount of settings preferences reading, at least when good lock plugin is enables.

And as i said with dim, for this mod is also better to save preferences values in variables, because if not everytime you pull down the panel you are parsing a json tree reading just a simple swith value and / or a seekbar .... It is better to store them in vars (use observer)

Please, check the code i added to the end of the method, i have not checked if we will get a verify error or so... the thing i wanted to show is the idea of saving unneccessary readings. The plugin enablied check is run anyway, so, let´s check our switch after we know it is not enabled

---------- Post added at 07:14 PM ---------- Previous post was at 06:46 PM ----------

---------- Post added at 07:15 PM ---------- Previous post was at 07:14 PM ----------

@diphons , added link in night mode toggle to your xml, many thanks mate