[Android General] wlryss:
I tried to apply observer to two smalies - ScrimController.smali (DIM Effect) and StatusBarWindowManager.smali (Native Blur).

For a start i added GearUtils to SystemUI.

We download files from the enclosed archive and we place them in the decompiled SystemUI - in enclosed archive - GearUtils.smali , it isn't necessary to download archive from XDA post.

If GearUtils is already added to your SystemUI, then it is recommended to locate files from enclosed archive in compliance with an order of folders in archive - that is to locate folders from archive in SystemUI/smali_classes2/, and - to delete the SystemUI/smali/com/android/wubydax/ folder.

1. SystemUI/smali/com/android/systemui/statusbar/phone/StatusBarWindowManager.smali - it`s necessary to make all from this post (once again thanks for the instruction) and then it is necessary to make the following changes:

a) .method public grx_applyQSColoringBlurEffect()V it`s necessary to make so:

.method public grx_applyQSColoringBlurEffect()V
.locals 7

const-string/jumbo v5, "b_ga_panel_blur_enable"

const v6, 0x0

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

move-result v5

if-eqz v5, :cond_2

const-string v0, "b_ga_panel_blur"

const v1, 0xa

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

move-result v0

int-to-float v0, v0

const v2, 0x64

int-to-float v2, v2

div-float v4, v0, v2

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mCurrentState:Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;

iget-boolean v0, v0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;->keyguardShowing:Z

if-eqz v0, :cond_0

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mCurrentState:Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;

iget-boolean v0, v0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;->qsExpanded:Z

if-nez v0, :cond_1

:cond_0
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mCurrentState:Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;

iget-boolean v0, v0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;->keyguardShowing:Z

if-nez v0, :cond_3

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mCurrentState:Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;

iget-boolean v0, v0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;->panelExpanded:Z

if-eqz v0, :cond_3

:cond_1
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mLpChanged:Landroid/view/WindowManager$LayoutParams;

iget v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I

or-int/lit8 v1, v1, 0x2

iput v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I

iget-object v1, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mLpChanged:Landroid/view/WindowManager$LayoutParams;

iput v4, v1, Landroid/view/WindowManager$LayoutParams;->dimAmount:F

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mLpChanged:Landroid/view/WindowManager$LayoutParams;

iget v1, v0, Landroid/view/WindowManager$LayoutParams;->samsungFlags:I

or-int/lit8 v1, v1, 0x40

iput v1, v0, Landroid/view/WindowManager$LayoutParams;->samsungFlags:I

:cond_2
:goto_0
return-void

:cond_3
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mLpChanged:Landroid/view/WindowManager$LayoutParams;

iget v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I

and-int/lit8 v1, v1, -0x3

iput v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mLpChanged:Landroid/view/WindowManager$LayoutParams;

iget v1, v0, Landroid/view/WindowManager$LayoutParams;->samsungFlags:I

and-int/lit8 v1, v1, -0x41

iput v1, v0, Landroid/view/WindowManager$LayoutParams;->samsungFlags:I

goto :goto_0
.end method

b) Then add line to head of smali (marked+++):

.class public Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;
.super Ljava/lang/Object;
.source "StatusBarWindowManager.java"

# interfaces
.implements Lcom/android/systemui/statusbar/RemoteInputController$Callback;
.implements Lcom/android/systemui/Dumpable;
+++.implements Lcom/android/wubydax/GearContentObserver$OnContentChangedListener;

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$1;,
Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$OtherwisedCollapsedListener;,
Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;
}
.end annotation

Then we need to add fields (. field .....) and method (marked with +++):

.......................................
.field private mBouncerLpChanged:Landroid/view/WindowManager$LayoutParams;

+++.field private final mContext:Landroid/content/Context;

.field private final mCurrentState:Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;

+++.field private final mHandler:Landroid/os/Handler;

.field private mHasTopUi:Z
.....................................

# direct methods
+++.method static synthetic -get0(Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;)Landroid/content/Context;
.locals 1

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager;->mContext:Landroid/content/Context;

return-object v0
.end method

.method static constructor <clinit>()V
.locals 1

invoke-static {}, Lcom/android/systemui/Rune;->getDefaultDisplayTimeout()I

In .method public constructor <init>(Landroid/content/Context;)V it is necessary to add line before return-void (marked +++):

................................................

move-result-wide v2

iput-wide v2, v0, Lcom/android/systemui/statusbar/phone/StatusBarWindowManager$State;->keyguardUserActivityTimeout:J

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

return-void
.end method

And at last at the end of the StatusBarWindowManager.smali it is necessary to add two methods:

.method registerObserver()V
.locals 7

new-instance v3, Ljava/util/ArrayList;

invoke-direct {v3}, Ljava/util/ArrayList;-><init>()V

const-string/jumbo v4, "b_ga_panel_blur_enable"

invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

const-string/jumbo v4, "b_ga_panel_blur"

invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

new-instance v1, Lcom/android/wubydax/GearContentObserver;

new-instance v4, Landroid/os/Handler;

invoke-direct {v4}, Landroid/os/Handler;-><init>()V

invoke-direct {v1, v4, p0}, Lcom/android/wubydax/GearContentObserver;-><init>(Landroid/os/Handler;Lcom/android/wubydax/GearContentObserver$OnContentChangedListener;)V

invoke-static {}, Lcom/android/systemui/SystemUIApplication;->getContext()Landroid/content/Context;

move-result-object v4

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

move-result-object v0

invoke-virtual {v3}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

move-result-object v4

:goto_0
invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z

move-result v5

if-eqz v5, :cond_0

invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;

move-result-object v2

check-cast v2, Ljava/lang/String;

invoke-static {v2}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;

move-result-object v5

const/4 v6, 0x0

invoke-virtual {v0, v5, v6, v1}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V

goto :goto_0

:cond_0
return-void
.end method

.method public onContentChanged(Ljava/lang/String;)V
.locals 1

const-string/jumbo v0, "b_ga_panel_blur_enable"

invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v0

if-eqz v0, :cond_0

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

:cond_0
const-string/jumbo v0, "b_ga_panel_blur"

invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v0

if-eqz v0, :cond_1

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

:cond_1

return-void
.end method

2. SystemUI/smali/com/android/systemui/statusbar/phone/ScrimController.smali - it`s necessary to make all from this post and then it is necessary to make the following changes:

a) In .method protected updateScrims()V part of code it is necessary to make so:

.method protected updateScrims()V
.locals 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_6

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
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

:cond_6
################
const-string v4, "b_ga_panel_dim"

const v5, 0x1

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

move-result v4

if-nez v4, :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
.end method

Then add line to head of smali (marked+++):

.class public Lcom/android/systemui/statusbar/phone/ScrimController;
.super Ljava/lang/Object;
.source "ScrimController.java"

# interfaces
.implements Landroid/view/ViewTreeObserver$OnPreDrawListener;
.implements Lcom/android/systemui/statusbar/policy/OnHeadsUpChangedListener;
+++.implements Lcom/android/wubydax/GearContentObserver$OnContentChangedListener;

# static fields

Then we need to add fields (. field .....) and method (marked with +++):

...........................................................
.field private final mInterpolator:Landroid/view/animation/Interpolator;

.field protected mIsSecure:Z

+++.field private final mContext:Landroid/content/Context;

+++.field private final mHandler:Landroid/os/Handler;

.field private mKeyguardFadeoutAnimation:Landroid/animation/ValueAnimator;

.field private mKeyguardFadingOutInProgress:Z
.....................................

# direct methods
.method static synthetic -get0(Lcom/android/systemui/statusbar/phone/ScrimController;)Z
.locals 1

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

return v0
.end method

.method static synthetic -get1(Lcom/android/systemui/statusbar/phone/ScrimController;)Ljava/lang/Runnable;
.locals 1

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/ScrimController;->mOnAnimationFinished:Ljava/lang/Runnable;

return-object v0
.end method

.method static synthetic -get2(Lcom/android/systemui/statusbar/phone/ScrimController;)Lcom/android/systemui/statusbar/phone/UnlockMethodCache;
.locals 1

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

return-object v0
.end method

+++.method static synthetic -get3(Lcom/android/systemui/statusbar/phone/ScrimController;)Landroid/content/Context;
.locals 1

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/ScrimController;->mContext:Landroid/content/Context;

return-object v0
.end method

.method static synthetic -set0(Lcom/android/systemui/statusbar/phone/ScrimController;Landroid/animation/ValueAnimator;)Landroid/animation/ValueAnimator;
.locals 0

iput-object p1, p0, Lcom/android/systemui/statusbar/phone/ScrimController;->mKeyguardFadeoutAnimation:Landroid/animation/ValueAnimator;

return-object p1
.end method

In .method public constructor <init>Lcom/android/systemui/statusbar/phone/LightBarController;Lcom/android/systemui/statusbar/ScrimView;Lcom/android/systemui/statusbar/ScrimView;Landroid/view/View;)V it is necessary to add line before return-void (marked +++):

..............................................

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

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

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

return-void
.end method

And at last at the end of the ScrimController.smali it is necessary to add two methods:

.method registerObserver()V
.locals 7

new-instance v3, Ljava/util/ArrayList;

invoke-direct {v3}, Ljava/util/ArrayList;-><init>()V

const-string/jumbo v4, "b_ga_panel_dim"

invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

new-instance v1, Lcom/android/wubydax/GearContentObserver;

new-instance v4, Landroid/os/Handler;

invoke-direct {v4}, Landroid/os/Handler;-><init>()V

invoke-direct {v1, v4, p0}, Lcom/android/wubydax/GearContentObserver;-><init>(Landroid/os/Handler;Lcom/android/wubydax/GearContentObserver$OnContentChangedListener;)V

invoke-static {}, Lcom/android/systemui/SystemUIApplication;->getContext()Landroid/content/Context;

move-result-object v4

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

move-result-object v0

invoke-virtual {v3}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

move-result-object v4

:goto_0
invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z

move-result v5

if-eqz v5, :cond_0

invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;

move-result-object v2

check-cast v2, Ljava/lang/String;

invoke-static {v2}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;

move-result-object v5

const/4 v6, 0x0

invoke-virtual {v0, v5, v6, v1}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V

goto :goto_0

:cond_0
return-void
.end method

.method public onContentChanged(Ljava/lang/String;)V
.locals 1

const-string/jumbo v0, "b_ga_panel_dim"

invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v0

if-eqz v0, :cond_0

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

:cond_0
return-void
.end method

It seems all recommendations are implemented.

Note!! - my key for Rom Control for switch Blur - b_ga_panel_blur_enable