[Samsung Galaxy S 5 Unified Development] sieuan:
Hi all, i need a help to made settings observer for signal level mod:

In NetworkControllerImpl.smali, i added:

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/android/systemui/statusbar/policy/NetworkControllerImpl$4;,
Lcom/android/systemui/statusbar/policy/NetworkControllerImpl$NWBoosterObserver;,
Lcom/android/systemui/statusbar/policy/NetworkControllerImpl$MobileDataObserver;,
Lcom/android/systemui/statusbar/policy/NetworkControllerImpl$DataRoamingObserver;,
Lcom/android/systemui/statusbar/policy/NetworkControllerImpl$Operator;,
Lcom/android/systemui/statusbar/policy/NetworkControllerImpl$WifiHandler;,
Lcom/android/systemui/statusbar/policy/NetworkControllerImpl$NetworkControllerHandler;,
[COLOR="Blue"]Lcom/android/systemui/statusbar/policy/NetworkControllerImpl$SettingsObserver;,[/COLOR]
Lcom/android/systemui/statusbar/policy/NetworkControllerImpl$SignalCluster;
}
.end annotation
.
.
.
.method private updateStatusBarNetworkSettings()V
.locals 2

[COLOR="Blue"]invoke-virtual {p0}, Lcom/android/systemui/statusbar/policy/NetworkControllerImpl;->GetSignalStyle()I[/COLOR]

move-result v0

iput v0, p0, Lcom/android/systemui/statusbar/policy/NetworkControllerImpl;->mMaxLevelOfSignalStrengthIndicator:I
.
.
.
.
# virtual methods
[COLOR="blue"].method public GetSignalStyle()I
.locals 3

const/4 v2, 0x4

iget-object v1, p0, Lcom/android/systemui/statusbar/policy/NetworkControllerImpl;->mContext:Landroid/content/Context;

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

move-result-object v0

const-string v1, "signal_style"

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

move-result v1

return v1
.end method[/COLOR]
.
.
.
.
const-string v4, "smart_bonding"

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

move-result-object v4

iget-object v5, p0, Lcom/android/systemui/statusbar/policy/NetworkControllerImpl;->mNWBoosterObserver:Lcom/android/systemui/statusbar/policy/NetworkControllerImpl$NWBoosterObserver;

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

[COLOR="blue"]:cond_5
new-instance v1, Lcom/android/systemui/statusbar/policy/NetworkControllerImpl$SettingsObserver;

new-instance v2, Landroid/os/Handler;

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

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

invoke-virtual {v1}, Lcom/android/systemui/statusbar/policy/NetworkControllerImpl$SettingsObserver;->observe()V[/COLOR]

return-void

:cond_6
move v3, v6

goto :goto_0
.end method

Then made new NetworkControllerImpl$SettingsObserver.smali file:

.class public Lcom/android/systemui/statusbar/policy/NetworkControllerImpl$SettingsObserver;
.super Landroid/database/ContentObserver;
.source "NetworkControllerImpl.java"

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

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

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

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

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

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

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

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

move-result-object v0

const-string v1, "signal_style"

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

invoke-virtual {v0}, Lcom/android/systemui/statusbar/policy/NetworkControllerImpl;->GetSignalStyle()I

return-void
.end method

But when i select on rom control, signal level not change on observer, still need restart systemui to active.

I also tried with add in NetworkControllerImpl.smali:

.method static synthetic access$001(Lcom/android/systemui/statusbar/policy/NetworkControllerImpl;)Landroid/content/Context;
.locals 1

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

return-object v0
.end method

then change in NetworkControllerImpl$SettingsObserver.smali:

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

const/4 v2, 0x0

[COLOR="blue"]iget-object v1, p0, Lcom/android/systemui/statusbar/policy/NetworkControllerImpl$SettingsObserver;->this$0:Lcom/android/systemui/statusbar/policy/NetworkControllerImpl;

# getter for: Lcom/android/systemui/statusbar/policy/NetworkControllerImpl;->mContext:Landroid/content/Context;
invoke-static {v1}, Lcom/android/systemui/statusbar/policy/NetworkControllerImpl;->access$001(Lcom/android/systemui/statusbar/policy/NetworkControllerImpl;)Landroid/content/Context;

move-result-object v1

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

move-result-object v0[/COLOR]

const-string v1, "signal_style"

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

but it still can not change on observer, still need systemUI restart to active.

Can someone help me? Thanks!