[Guide] Remove Mobile Data Toggle off Warning Dialogue

Search This thread

majdinj

Senior Member
Nov 25, 2006
980
3,438
AlAhsa
Hell xda-er,,
It is me again :silly:

I took my shovel and start digging where could I disable this annoying dialogue when I toggle off mobile data connection from quick toggle panel... see the pictures

xmj4.png
x3h3.png

Now I can toggle off mobile data connection from quick toggle panel without seeing that dialogue anymore :cool:

Needed tools:
1) Baksmali tool from here.
2) Notepad++ from here.

The procedure:
- Baksmali SystemUI.apk.
- Go to classout/com/android/systemui/statusbar/policy/quicksetting folder and open MobileDataQuickSettingButton.smali
- Search for this method ".method private setMobileData(Z)V" and then go to its end and add this (goto) blue line:
Code:
.method private setMobileData(Z)V
    .registers 6
    .param p1, "on"    # Z

    .prologue
    .line 248
    iget-object v1, p0, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->mContext:Landroid/content/Context;

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

    move-result-object v1

    const-string v2, "quickpanel_mobiledata_checked"

    const/4 v3, 0x0

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

    move-result v0

    .line 250
    .local v0, "mChecked":I
    const-string v1, "STATUSBAR-MobileDataQuickSettingButton"

    new-instance v2, Ljava/lang/StringBuilder;

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

    const-string v3, "Mobile data waring checked : "

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

    move-result-object v2

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

    move-result-object v2

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

    move-result-object v2

    invoke-static {v1, v2}, Landroid/util/Slog;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 252
    [B][COLOR="Blue"]goto :cond_2d[/COLOR][/B]
	
    if-nez p1, :cond_2d

    if-nez v0, :cond_2d

    .line 253
    invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->onDisplayMobileDataOffAlert()V

    .line 257
    :goto_2c
    return-void

    .line 255
    [B][COLOR="Red"]:cond_2d[/COLOR][/B]    [B][COLOR="Green"]<!-- Make sure the new blue goto command above has the same cond value as this one[/COLOR][/B]
    invoke-direct {p0, p1}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->setMobileDataEnabled(Z)V

    goto :goto_2c
.end method
- Make sure of the blue :cond value in the new goto command to be the same as the red :cond value in the code. Here, the red value is :cond_2d so the blue will be :cond_2d as well.
Explanation:
By adding this goto command, we are telling the code to jump over the invoke alert dialogue command to the mobile data boolean directly then jump to void.
- Save changes.. smali (recompile).. push to phone.. fix permissions (644) and reboot.

Cheers

 

majdinj

Senior Member
Nov 25, 2006
980
3,438
AlAhsa
@majdinj
Why don't you make a ROM with all of your mods combined ? :)

Even if was thinking same thing after seeing of your many new guides n mods.

It's time for Glory LTA:D

Sent from my GT-N7000 using xda premium

That would be awesome!

Thanks guys for your warm feeling towards me,,, A lot of excellent ROMs are here in our forum, so I think you can stick to one of them since I myself like to discover more about source and resource coding, so I can give a good support to other ROMs.
 

mjrifath

Senior Member
May 13, 2012
1,791
953
Colombo
Thanks guys for your warm feeling towards me,,, A lot of excellent ROMs are here in our forum, so I think you can stick to one of them since I myself like to discover more about source and resource coding, so I can give a good support to other ROMs.

Agreed.. there is many plenty of TW base awesome roms available here. But it's hard to find a rom with complete mods. Example.. extended power menu, torch mod in lock screen, aosp lockscreen... maybe this is not required mods. But people need more customization with latest updates:D






Sent from my GT-N7000 using xda premium
 
  • Like
Reactions: Rocheau

Rocheau

Senior Member
May 1, 2006
223
35
I would like also to see a Rom with all your mods in. So in case you have enough time I would like to ask you to make one as many of the ROMS in the Android Development menu are out of date

Thank you for your mods.
 

M3TALLICA

Senior Member
Nov 14, 2011
1,507
499
Agreed.. there is many plenty of TW base awesome roms available here. But it's hard to find a rom with complete mods. Example.. extended power menu, torch mod in lock screen, aosp lockscreen... maybe this is not required mods. But people need more customization with latest updates:D






Sent from my GT-N7000 using xda premium
add spell checker and volume rocker to skip tracks.
 
  • Like
Reactions: mjrifath

tomekb4

New member
Apr 21, 2014
1
0
what about i9305

I've tried this on i9305. It seem like I did all steps but no effect. Any idea? My corrected smalied and baksmalied again looks like this:
Code:
.method private setMobileData(Z)V
    .locals 5
    .param p1, "on"    # Z

    .prologue
    .line 349
    iget-object v1, p0, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->mContext:Landroid/content/Context;

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

    move-result-object v1

    const-string v2, "quickpanel_mobiledata_checked"

    const/4 v3, 0x0

    const/4 v4, -0x2

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

    move-result v0

    .line 351
    .local v0, "mChecked":I
    const-string v1, "STATUSBAR-MobileDataQuickSettingButton"

    new-instance v2, Ljava/lang/StringBuilder;

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

    const-string v3, "Mobile data waring checked : "

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

    move-result-object v2

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

    move-result-object v2

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

    move-result-object v2

    invoke-static {v1, v2}, Landroid/util/secutil/Log;->secD(Ljava/lang/String;Ljava/lang/String;)I

    .line 353
    goto :goto_39

    if-nez p1, :cond_2f

    if-nez v0, :cond_2f

    .line 354
    invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->onDisplayMobileDataOffAlert()V

    .line 363
    :goto_2e
    return-void

    .line 356
    :cond_2f
    if-eqz p1, :cond_39

    sget-boolean v1, Lcom/android/systemui/statusbar/Feature;->mUseDataOnConfirmPopup:Z

    if-eqz v1, :cond_39

    .line 357
    invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->onORGDisplayMobileDataOnAlert()V

    goto :goto_2e

    .line 360
    :cond_39
    :goto_39
    invoke-direct {p0, p1}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->setMobileDataEnabled(Z)V

    goto :goto_2e
.end method
 

josephpatrick

Senior Member
Jan 24, 2012
1,179
233
Bangalore
does not work with dn4 mod 10

Fix is to make this change:

goto :cond_0 ====> this shud jump to line of setMobileDataEnabled

.line 375
if-nez p1, :cond_0

.line 376
if-nez v0, :cond_0

.line 377
invoke-direct {p0, v4}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->onDisplayMobileDataAlert(I)V

.line 384
:goto_0
return-void

.line 379
:cond_0
invoke-direct {p0, p1}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->setMobileDataEnabled(Z)V

goto :goto_0

.line 381
:cond_1
const/4 v1, 0x1

invoke-direct {p0, v1}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->onDisplayMobileDataAlert(I)V

goto :goto_0
.end method
 
Last edited:

lukas9519

Member
Apr 18, 2017
7
1
Hi, I have a problem. I did all steps, changed everything like shown and smali into .apk
When I changed my oryginal systemUI.apk with new one it says that sysyemUI has stopped.
Can you tell me what could went wrong ? Maby my backsmali compiled apk with errors ? Any ideas, help how to fix that ?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 12
    Hell xda-er,,
    It is me again :silly:

    I took my shovel and start digging where could I disable this annoying dialogue when I toggle off mobile data connection from quick toggle panel... see the pictures

    xmj4.png
    x3h3.png

    Now I can toggle off mobile data connection from quick toggle panel without seeing that dialogue anymore :cool:

    Needed tools:
    1) Baksmali tool from here.
    2) Notepad++ from here.

    The procedure:
    - Baksmali SystemUI.apk.
    - Go to classout/com/android/systemui/statusbar/policy/quicksetting folder and open MobileDataQuickSettingButton.smali
    - Search for this method ".method private setMobileData(Z)V" and then go to its end and add this (goto) blue line:
    Code:
    .method private setMobileData(Z)V
        .registers 6
        .param p1, "on"    # Z
    
        .prologue
        .line 248
        iget-object v1, p0, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->mContext:Landroid/content/Context;
    
        invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
    
        move-result-object v1
    
        const-string v2, "quickpanel_mobiledata_checked"
    
        const/4 v3, 0x0
    
        invoke-static {v1, v2, v3}, Landroid/provider/Settings$Secure;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
    
        move-result v0
    
        .line 250
        .local v0, "mChecked":I
        const-string v1, "STATUSBAR-MobileDataQuickSettingButton"
    
        new-instance v2, Ljava/lang/StringBuilder;
    
        invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
    
        const-string v3, "Mobile data waring checked : "
    
        invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    
        move-result-object v2
    
        invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
    
        move-result-object v2
    
        invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    
        move-result-object v2
    
        invoke-static {v1, v2}, Landroid/util/Slog;->i(Ljava/lang/String;Ljava/lang/String;)I
    
        .line 252
        [B][COLOR="Blue"]goto :cond_2d[/COLOR][/B]
    	
        if-nez p1, :cond_2d
    
        if-nez v0, :cond_2d
    
        .line 253
        invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->onDisplayMobileDataOffAlert()V
    
        .line 257
        :goto_2c
        return-void
    
        .line 255
        [B][COLOR="Red"]:cond_2d[/COLOR][/B]    [B][COLOR="Green"]<!-- Make sure the new blue goto command above has the same cond value as this one[/COLOR][/B]
        invoke-direct {p0, p1}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->setMobileDataEnabled(Z)V
    
        goto :goto_2c
    .end method
    - Make sure of the blue :cond value in the new goto command to be the same as the red :cond value in the code. Here, the red value is :cond_2d so the blue will be :cond_2d as well.
    Explanation:
    By adding this goto command, we are telling the code to jump over the invoke alert dialogue command to the mobile data boolean directly then jump to void.
    - Save changes.. smali (recompile).. push to phone.. fix permissions (644) and reboot.

    Cheers

    2
    does not work with dn4 mod 10

    Fix is to make this change:

    goto :cond_0 ====> this shud jump to line of setMobileDataEnabled

    .line 375
    if-nez p1, :cond_0

    .line 376
    if-nez v0, :cond_0

    .line 377
    invoke-direct {p0, v4}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->onDisplayMobileDataAlert(I)V

    .line 384
    :goto_0
    return-void

    .line 379
    :cond_0
    invoke-direct {p0, p1}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->setMobileDataEnabled(Z)V

    goto :goto_0

    .line 381
    :cond_1
    const/4 v1, 0x1

    invoke-direct {p0, v1}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->onDisplayMobileDataAlert(I)V

    goto :goto_0
    .end method
    2
    @majdinj
    Why don't you make a ROM with all of your mods combined ? :)

    Even if was thinking same thing after seeing of your many new guides n mods.

    It's time for Glory LTA:D

    Sent from my GT-N7000 using xda premium

    That would be awesome!

    Thanks guys for your warm feeling towards me,,, A lot of excellent ROMs are here in our forum, so I think you can stick to one of them since I myself like to discover more about source and resource coding, so I can give a good support to other ROMs.
    1
    Thanks buddy! :good:

    Your Guides are useful as always! Thanks for your digging! ;)

    Thank you mate,,
    Next time I will dig for gold ;)
    1
    Let us know if u find some gold.. :D:D

    Sent from my GT-N7000 using xda premium
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone