[Samsung Galaxy S 5 Unified Development] ikrom:
UPDATED for Android Marshmallow 6.0.1

How to add a SettingsObserver to your Rom Android Marshmallow 6.0.1

in example PhoneStatusBar.smali

SystemUI.apk smali edits:

\smali\com\android\systemui\statusbar\phone\PhoneS tatusBar.smali

add new code is in BLUE

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$QuickConnectSoundPathViewObserver;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$ButtonBackgroundObserver;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$EmergencyModeObserver;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$DozeServiceHost;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$ShadeUpdates;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$H;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BatteryTextObserver;[COLOR="blue"][B][SIZE="3"],[/SIZE][/B][/COLOR]
[COLOR="blue"]Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;[/COLOR]
}
.end annotation

Note that, do not forget to insert a symbol ( , ) at the end in string Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BatteryTextObserver;

Same smali, in .method public start()V add new code in BLUE

.method public start()V
.
.
.
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mVowifiController:Lcom/android/systemui/statusbar/phone/VoWiFiStatusController;
[COLOR="Blue"]
:goto_0
new-instance v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;

iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHandler:Lcom/android/systemui/statusbar/BaseStatusBar$H;

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

.local v1, "observer":Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;
invoke-virtual {v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->observe()V[/COLOR]

new-instance v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;

iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
.
.
.
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mScreenPinningRequest:Lcom/android/systemui/recents/ScreenPinningRequest;

return-void

[COLOR="Blue"] .end local v1 # "observer":Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;
move-exception v2

goto/16 :goto_0
[/COLOR].end method

Add the PhoneStatusBar$SettingsObserver.smali file already attached at the bottom of this post to the same folder as PhoneStatusBar.smali.

Now lets look in the PhoneStatusBar$SettingsObserver.smali to see how we made the changes to it.

Note the text in BLUE, this where we check for changes to the key string and in the second method is where the new method gets launched to update the view if changes have been detected to that key.

Note the text in GREEN, this is how you would add two more mods to the settings observer with two additional methods to invoke in PhoneStatusBar. They are only present as an example.

.class Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;
.super Landroid/database/ContentObserver;
.source "PhoneStatusBar.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
.end annotation

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

# instance fields
.field final synthetic this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;

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

iput-object p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;

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/statusbar/phone/PhoneStatusBar$SettingsObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;

iget-object v1, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;

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

move-result-object v0

[COLOR="Blue"]const-string v1, "pulldown_date_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[/COLOR](Landroid/net/Uri;ZLandroid/database/ContentObserver;)V

[COLOR="Green"]const-string v1, "second_settings_key_goes_here"

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

const-string v1, "third_settings_key_goes_here"

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[/COLOR]

return-void
.end method

.method public onChange(Z)V
.locals 1

[COLOR="Blue"] iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;

invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setDateTextViewColor()V
[/COLOR]
[COLOR="Green"]iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;

invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setSecondMethod()V

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;

invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setThirdMethod()V

[/COLOR] return-void
.end method