[Galaxy S II Android Development] remuntada78:
not as easy as it seemed , after i implemented the listpreferencein SecSettings, i thried to work with SystemUI,to try I worked only with wifi section in WifiQuickSettingButton.smali

original

.method public constructor <init>(Landroid/content/Context;)V
.locals 10
.parameter "context"

.prologue
const/4 v7, 0x0

.line 82
const/4 v2, 0x0

const v3, 0x7f0a00ea

const v4, 0x7f0201f8

const v5, 0x7f0201f7

const v6, 0x7f0201f6

move-object v0, p0

move-object v1, p1

move v8, v7

invoke-direct/range {v0 .. v8}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;IIIIII)V

.line 69

modded

[/.method public constructor <init>(Landroid/content/Context;)V
.locals [COLOR="Red"]13[/COLOR]
.parameter "context"

.prologue
const/4 v7, 0x0

.line 82
const/4 v2, 0x0

const v3, 0x7f0a00ea

[COLOR="Red"]iget-object v10, p0, Lcom/android/systemui/statusbar/policy/quicksetting/WifiQuickSettingButton;->mContext:Landroid/content/Context;

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

move-result-object v10

const-string v11, "toggles_chooser"

const v12, 0x0

invoke-static {v10, v11, v12}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v10

const v12, 0x1

if-eq v10, v12, :cond_themes5

const v12, 0x2

if-eq v10, v12, :cond_green

const v4, 0x7f0201f8

const v5, 0x7f0201f7

const v6, 0x7f0201f6

goto :goto_new

:cond_themes5

const v4, 0x7f021133

const v5, 0x7f021132

const v6, 0x7f021131

goto :goto_new

:cond_green

const v4, 0x7f021101

const v5, 0x7f021100

const v6, 0x7f0210ff

:goto_new[/COLOR]

move-object v0, p0

move-object v1, p1

move v8, v7

invoke-direct/range {v0 .. v8}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;IIIIII)V

.line 69
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/WifiQuickSettingButton$1;

invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/WifiQuickSettingButton$1;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/WifiQuickSettingButton;)V

iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/WifiQuickSettingButton;->mIntentReceiver:Landroid/content/BroadcastReceiver;

.line 89
iput-object p1, p0, Lcom/android/systemui/statusbar/policy/quicksetting/WifiQuickSettingButton;->mContext:Landroid/content/Context;

.line 90
invoke-virtual {p0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->setListener(Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton$Listener;)V

.line 91
const-string v0, "wifi"

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

move-result-object v0

check-cast v0, Landroid/net/wifi/WifiManager;

iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/WifiQuickSettingButton;->mWifiManager:Landroid/net/wifi/WifiManager;

.line 95
:try_start_0
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/WifiQuickSettingButton;->mContext:Landroid/content/Context;

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

move-result-object v0

const v1, 0x7f09000b

invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getBoolean(I)Z

move-result v0

iput-boolean v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/WifiQuickSettingButton;->mBlockWifiInFlightMode:Z
:try_end_0
.catch Landroid/content/res/Resources$NotFoundException; {:try_start_0 .. :try_end_0} :catch_0

.line 101
:goto_0
iget-boolean v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/WifiQuickSettingButton;->mBlockWifiInFlightMode:Z

if-eqz v0, :cond_0

.line 102
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/WifiQuickSettingButton;->mContext:Landroid/content/Context;

const v1, 0x7f0a0074

invoke-static {v0, v1, v7}, Landroid/widget/Toast;->makeText(Landroid/content/Context;II)Landroid/widget/Toast;

move-result-object v0

iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/WifiQuickSettingButton;->toastAlert:Landroid/widget/Toast;

.line 106
:cond_0
return-void

.line 97
:catch_0
move-exception v9

.line 98
.local v9, ex:Landroid/content/res/Resources$NotFoundException;
iput-boolean v7, p0, Lcom/android/systemui/statusbar/policy/quicksetting/WifiQuickSettingButton;->mBlockWifiInFlightMode:Z

goto :goto_0
.end methodCODE][/HIDE]
after reboot i lost wifi toggle
[HIDE][CODE]D/KeyguardViewMediator( 2211): setHidden false

D/AndroidRuntime( 2350): Shutting down VM

W/dalvikvm( 2350): threadid=1: thread exiting with uncaught exception (group=0x40f122a0)

E/AndroidRuntime( 2350): FATAL EXCEPTION: main

E/AndroidRuntime( 2350): java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.CONFIGURATION_CHANGED flg=0x60000010 } in com.android.systemui.statusbar.policy.quicksetting.QuickSettingPanel$1@41b41bf8

E/AndroidRuntime( 2350):	at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:766)

E/AndroidRuntime( 2350):	at android.os.Handler.handleCallback(Handler.java:615)

E/AndroidRuntime( 2350):	at android.os.Handler.dispatchMessage(Handler.java:92)

E/AndroidRuntime( 2350):	at android.os.Looper.loop(Looper.java:137)

E/AndroidRuntime( 2350):	at android.app.ActivityThread.main(ActivityThread.java:4921)

E/AndroidRuntime( 2350):	at java.lang.reflect.Method.invokeNative(Native Method)

E/AndroidRuntime( 2350):	at java.lang.reflect.Method.invoke(Method.java:511)

E/AndroidRuntime( 2350):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)

i hope that Goldie can give us an explanation;)