[Galaxy S6 General] asc1977:
[MENTION=1042140]tdunham[/MENTION]

you write a great guide for HOW TO ADD SETTINGS OBSERVER and i do it well on PhoneStatusBar.smali

Now i tried for QSTileView.smali and get always a fc

Also daxgirl tried to fix but we find no bug. Did you have a idea if you have time. adds in blue

Here is my observer

.class Lcom/android/systemui/qs/QSTileView$SettingsObserver;
.super Landroid/database/ContentObserver;
.source "QSTileView.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/systemui/qs/QSTileView;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = "SettingsObserver"
.end annotation

# instance fields
.field final synthetic this$0:Lcom/android/systemui/qs/QSTileView;

# direct methods
.method constructor <init>(Lcom/android/systemui/qs/QSTileView;Landroid/os/Handler;)V
.locals 0

iput-object p1, p0, Lcom/android/systemui/qs/QSTileView$SettingsObserver;->this$0:Lcom/android/systemui/qs/QSTileView;

invoke-direct {p0, p2}, Landroid/database/ContentObserver;-><init>(Landroid/os/Handler;)V

return-void
.end method

# virtual methods
.method observe()V
.locals 3

const/4 v2, 0x0

iget-object v1, p0, Lcom/android/systemui/qs/QSTileView$SettingsObserver;->this$0:Lcom/android/systemui/qs/QSTileView;

iget-object v1, v1, Lcom/android/systemui/qs/QSTileView;->mContext:Landroid/content/Context;

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

move-result-object v0

const-string v1, "toggle_buttons_background_color"

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

move-result-object v1

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

return-void
.end method

.method public onChange(Z)V
.locals 1

iget-object v0, p0, Lcom/android/systemui/qs/QSTileView$SettingsObserver;->this$0:Lcom/android/systemui/qs/QSTileView;

invoke-virtual {p0}, Lcom/android/systemui/qs/QSTileView;->set_toggles()V

return-void
.end method

and here what i add in QSTIleView.smali

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
[COLOR="blue"]Lcom/android/systemui/qs/QSTileView$SettingsObserver;,[/COLOR]
Lcom/android/systemui/qs/QSTileView$H;
}
.end annotation

.method public constructor <init>(Landroid/content/Context;)V
.locals 6
.param p1, "context" # Landroid/content/Context;

.prologue
const/4 v5, 0x1

.line 97
invoke-direct {p0, p1}, Landroid/view/ViewGroup;-><init>(Landroid/content/Context;)V

.line 70
new-instance v2, Lcom/android/systemui/qs/QSTileView$H;

invoke-direct {v2, p0}, Lcom/android/systemui/qs/QSTileView$H;-><init>(Lcom/android/systemui/qs/QSTileView;)V

iput-object v2, p0, Lcom/android/systemui/qs/QSTileView;->mHandler:Lcom/android/systemui/qs/QSTileView$H;

.line 99
iput-object p1, p0, Lcom/android/systemui/qs/QSTileView;->mContext:Landroid/content/Context;

.line 101
invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

move-result-object v1

.line 102
.local v1, "res":Landroid/content/res/Resources;
const v2, 0x7f0c0106

invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I

move-result v2

iput v2, p0, Lcom/android/systemui/qs/QSTileView;->mIconSizePx:I

.line 103
const v2, 0x7f0c0112

invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I

move-result v2

iput v2, p0, Lcom/android/systemui/qs/QSTileView;->mTileSpacingPx:I

.line 104
const v2, 0x7f0c0110

invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I

move-result v2

iput v2, p0, Lcom/android/systemui/qs/QSTileView;->mTilePaddingBelowIconPx:I

.line 105
const v2, 0x7f0c010c

invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I

move-result v2

iput v2, p0, Lcom/android/systemui/qs/QSTileView;->mDualTileVerticalPaddingPx:I

.line 107
invoke-direct {p0}, Lcom/android/systemui/qs/QSTileView;->newTileBackground()Landroid/graphics/drawable/Drawable;

move-result-object v2

iput-object v2, p0, Lcom/android/systemui/qs/QSTileView;->mTileBackground:Landroid/graphics/drawable/Drawable;

.line 109
new-instance v2, Landroid/util/DisplayMetrics;

invoke-direct {v2}, Landroid/util/DisplayMetrics;-><init>()V

iput-object v2, p0, Lcom/android/systemui/qs/QSTileView;->mDisplayMetrics:Landroid/util/DisplayMetrics;

.line 110
iget-object v2, p0, Lcom/android/systemui/qs/QSTileView;->mContext:Landroid/content/Context;

const-string v3, "window"

invoke-virtual {v2, v3}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

move-result-object v2

check-cast v2, Landroid/view/WindowManager;

invoke-interface {v2}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;

move-result-object v2

iget-object v3, p0, Lcom/android/systemui/qs/QSTileView;->mDisplayMetrics:Landroid/util/DisplayMetrics;

invoke-virtual {v2, v3}, Landroid/view/Display;->getMetrics(Landroid/util/DisplayMetrics;)V

.line 111
iget-object v2, p0, Lcom/android/systemui/qs/QSTileView;->mContext:Landroid/content/Context;

invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

move-result-object v2

const v3, 0x7f0c0107

invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I

move-result v2

int-to-float v2, v2

iput v2, p0, Lcom/android/systemui/qs/QSTileView;->mDefaultTextSize:F

.line 113
invoke-direct {p0}, Lcom/android/systemui/qs/QSTileView;->recreateLabel()V

.line 114
const/4 v2, 0x0

invoke-virtual {p0, v2}, Lcom/android/systemui/qs/QSTileView;->setClipChildren(Z)V

.line 116
new-instance v2, Landroid/view/View;

invoke-direct {v2, p1}, Landroid/view/View;-><init>(Landroid/content/Context;)V

iput-object v2, p0, Lcom/android/systemui/qs/QSTileView;->mTopBackgroundView:Landroid/view/View;

.line 117
iget-object v2, p0, Lcom/android/systemui/qs/QSTileView;->mTopBackgroundView:Landroid/view/View;

invoke-static {}, Landroid/view/View;->generateViewId()I

move-result v3

invoke-virtual {v2, v3}, Landroid/view/View;->setId(I)V

.line 120
invoke-virtual {p0}, Lcom/android/systemui/qs/QSTileView;->createIcon()Landroid/view/View;

move-result-object v2

iput-object v2, p0, Lcom/android/systemui/qs/QSTileView;->mIcon:Landroid/view/View;

.line 122
sget-boolean v2, Lcom/android/systemui/statusbar/Feature;->mQuickSettingBackgroundAnimation:Z

if-eqz v2, :cond_0

.line 123
iget-object v2, p0, Lcom/android/systemui/qs/QSTileView;->mIcon:Landroid/view/View;

new-instance v3, Lcom/android/systemui/qs/QSTileIconBackground;

invoke-direct {v3, p1}, Lcom/android/systemui/qs/QSTileIconBackground;-><init>(Landroid/content/Context;)V

invoke-virtual {v2, v3}, Landroid/view/View;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

.line 127
:goto_0
iget-object v2, p0, Lcom/android/systemui/qs/QSTileView;->mIcon:Landroid/view/View;

invoke-virtual {p0, v2}, Lcom/android/systemui/qs/QSTileView;->addView(Landroid/view/View;)V

.line 129
new-instance v2, Landroid/view/View;

iget-object v3, p0, Lcom/android/systemui/qs/QSTileView;->mContext:Landroid/content/Context;

invoke-direct {v2, v3}, Landroid/view/View;-><init>(Landroid/content/Context;)V

iput-object v2, p0, Lcom/android/systemui/qs/QSTileView;->mDivider:Landroid/view/View;

.line 130
iget-object v2, p0, Lcom/android/systemui/qs/QSTileView;->mDivider:Landroid/view/View;

const v3, 0x7f0a004f

invoke-virtual {p1, v3}, Landroid/content/Context;->getColor(I)I

move-result v3

invoke-virtual {v2, v3}, Landroid/view/View;->setBackgroundColor(I)V

.line 131
const v2, 0x7f0c0109

invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I

move-result v0

.line 132
.local v0, "dh":I
iget-object v2, p0, Lcom/android/systemui/qs/QSTileView;->mDivider:Landroid/view/View;

new-instance v3, Landroid/view/ViewGroup$LayoutParams;

const/4 v4, -0x1

invoke-direct {v3, v4, v0}, Landroid/view/ViewGroup$LayoutParams;-><init>(II)V

invoke-virtual {v2, v3}, Landroid/view/View;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

.line 135
invoke-virtual {p0, v5}, Lcom/android/systemui/qs/QSTileView;->setClickable(Z)V

.line 137
invoke-virtual {p0, v5}, Lcom/android/systemui/qs/QSTileView;->setLongClickable(Z)V

.line 139
invoke-direct {p0}, Lcom/android/systemui/qs/QSTileView;->updateTopPadding()V

invoke-virtual {p0}, Lcom/android/systemui/qs/QSTileView;->set_toggles()V

.line 141
[COLOR="Blue"] new-instance v1, Lcom/android/systemui/qs/QSTileView$SettingsObserver;

new-instance v2, Landroid/os/Handler;

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

invoke-direct {v1, p0, v2}, Lcom/android/systemui/qs/QSTileView$SettingsObserver;-><init>(Lcom/android/systemui/qs/QSTileView;Landroid/os/Handler;)V

invoke-virtual {v1}, Lcom/android/systemui/qs/QSTileView$SettingsObserver;->observe()V[/COLOR]
return-void

.line 125
.end local v0 # "dh":I
:cond_0
iget-object v2, p0, Lcom/android/systemui/qs/QSTileView;->mIcon:Landroid/view/View;

const v3, 0x7f020636

invoke-virtual {v2, v3}, Landroid/view/View;->setBackgroundResource(I)V

goto :goto_0
.end method