[Galaxy S II Android Development] remuntada78:
Hi, i'm trying to make this http://xdaforums.com/showpost.php?p=60279800&postcount=796 in real time

working with QSPanel.smali we have this method

.method private getButtonNumberFromDB()I
.locals 5

.prologue
.line 764
const/16 v0, 0xa

.line 766
.local v0, "ButtonNumber":I
:try_start_0
iget-object v2, p0, Lcom/android/systemui/qs/QSPanel;->mContentResolver:Landroid/content/ContentResolver;

const-string v3, "notification_panel_active_number_of_apps"

const/4 v4, -0x2

invoke-static {v2, v3, v4}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v2

if-lez v2, :cond_0

.line 767
iget-object v2, p0, Lcom/android/systemui/qs/QSPanel;->mContentResolver:Landroid/content/ContentResolver;

const-string v3, "notification_panel_active_number_of_apps"

const/4 v4, -0x2

invoke-static {v2, v3, v4}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;I)I
:try_end_0
.catch Landroid/provider/Settings$SettingNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

move-result v0

.line 773
:cond_0
:goto_0
const-string v2, "StatusBar-QSPanel"

new-instance v3, Ljava/lang/StringBuilder;

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

const-string v4, "Button Number from DB : = "

invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

move-result-object v3

invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

move-result-object v3

invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

move-result-object v3

invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

.line 774
return v0

.line 769
:catch_0
move-exception v1

.line 770
.local v1, "e":Landroid/provider/Settings$SettingNotFoundException;
const-string v2, "StatusBar-QSPanel"

const-string v3, "getButtonNumberFromDB() - SettingNotFoundException"

invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

goto :goto_0
.end method

in the line with const/16 v0, 0xa I assumed that 0xa is 10 in decimal value so i added the following red code

.method private getButtonNumberFromDB()I
.locals[COLOR="Red"]8[/COLOR]

.prologue
.line 764[COLOR="Red"]
iget-object v5, p0, Lcom/android/systemui/qs/QSPanel;->mContentResolver:Landroid/content/ContentResolver;

const-string v6, "notification_panel_active_number_of_apps"

const/4 v7, 0x0

invoke-static {v5, v6, v7}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v5

const v7, 0x1

if-eq v7, v5, :cond_new

const v7, 0x2

if-eq v7, v5, :cond_new1

const v7, 0x3

if-eq v7, v5, :cond_new2

const/16 v0, 0xa [COLOR="Blue"]stock value =10 tiles[/COLOR]

goto:goto_new

:cond_new
const/16 v0, 0xb [COLOR="Blue"]second choice value =11 tiles[/COLOR]

goto:goto_new

:cond_new1
const/16 v0, 0xc [COLOR="Blue"]third choice value =12 tiles[/COLOR]

goto:goto_new

:cond_new2
const/16 v0, 0xd [COLOR="Blue"]fourth choice value =13 tiles[/COLOR]

:goto_new[/COLOR]
.line 766
.local v0, "ButtonNumber":I
:try_start_0
iget-object v2, p0, Lcom/android/systemui/qs/QSPanel;->mContentResolver:Landroid/content/ContentResolver;

const-string v3, "notification_panel_active_number_of_apps"

const/4 v4, -0x2

invoke-static {v2, v3, v4}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v2

if-lez v2, :cond_0

.line 767
iget-object v2, p0, Lcom/android/systemui/qs/QSPanel;->mContentResolver:Landroid/content/ContentResolver;

const-string v3, "notification_panel_active_number_of_apps"

const/4 v4, -0x2

invoke-static {v2, v3, v4}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;I)I
:try_end_0
.catch Landroid/provider/Settings$SettingNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

move-result v0

but as you can see, I have not had success

[YOUTUBE]MiJoeDRX9VQ[/YOUTUBE]

some suggestion?

thanks

edit:

solved with the following code

.method private getButtonNumberFromDB()I
.locals [COLOR="Red"]8[/COLOR]

.prologue
.line 764[COLOR="Red"]
iget-object v5, p0, Lcom/android/systemui/qs/QSPanel;->mContentResolver:Landroid/content/ContentResolver;

const-string v6, "notification_panel_active_number_of_apps"

const/4 v7, 0x0

invoke-static {v5, v6, v7}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v5

const v7, 0x1

if-eq v7, v5, :cond_new

const v7, 0x2

if-eq v7, v5, :cond_new1

const v7, 0x3

if-eq v7, v5, :cond_new2

const/16 v0, 0xa

goto:goto_new

:cond_new
const/16 v0, 0xb

goto:goto_new

:cond_new1
const/16 v0, 0xc

goto:goto_new

:cond_new2
const/16 v0, 0xd

goto:goto_new[/COLOR]
.line 766
.local v0, "ButtonNumber":I
:try_start_0
iget-object v2, p0, Lcom/android/systemui/qs/QSPanel;->mContentResolver:Landroid/content/ContentResolver;

const-string v3, "notification_panel_active_number_of_apps"

const/4 v4, -0x2

invoke-static {v2, v3, v4}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v2

if-lez v2, :cond_0

.line 767
iget-object v2, p0, Lcom/android/systemui/qs/QSPanel;->mContentResolver:Landroid/content/ContentResolver;

const-string v3, "notification_panel_active_number_of_apps"

const/4 v4, -0x2

invoke-static {v2, v3, v4}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;I)I
:try_end_0
.catch Landroid/provider/Settings$SettingNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

move-result v0

.line 773
:cond_0
:goto_0
const-string v2, "StatusBar-QSPanel"

new-instance v3, Ljava/lang/StringBuilder;

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

const-string v4, "Button Number from DB : = "

invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

move-result-object v3

invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

move-result-object v3

invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

move-result-object v3

invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

.line 774
[COLOR="Red"]:goto_new[/COLOR]
return v0

.line 769
:catch_0
move-exception v1