FORUMS
Remove All Ads from XDA

[Guide] Remove Mobile Data Toggle off Warning Dialogue

980 posts
Thanks Meter: 3,318
 
By majdinj, Senior Member on 12th October 2013, 07:58 PM
Post Reply Email Thread
Hell xda-er,,
It is me again

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


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

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
    goto :cond_2d
	
    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
    :cond_2d    <!-- Make sure the new blue goto command above has the same cond value as this one
    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.
Quote:

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

The Following 12 Users Say Thank You to majdinj For This Useful Post: [ View ] Gift majdinj Ad-Free
 
 
12th October 2013, 09:23 PM |#2  
Winterlove's Avatar
Senior Member
Thanks Meter: 1,052
 
More
Thanks buddy!

Your Guides are useful as always! Thanks for your digging!
12th October 2013, 09:45 PM |#3  
majdinj's Avatar
OP Senior Member
Flag AlAhsa
Thanks Meter: 3,318
 
More
Quote:
Originally Posted by Winterlove

Thanks buddy!

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

Thank you mate,,
Next time I will dig for gold
The Following User Says Thank You to majdinj For This Useful Post: [ View ] Gift majdinj Ad-Free
13th October 2013, 03:02 AM |#4  
mjrifath's Avatar
Senior Member
Flag Colombo
Thanks Meter: 876
 
More
Let us know if u find some gold..

Sent from my GT-N7000 using xda premium
The Following User Says Thank You to mjrifath For This Useful Post: [ View ] Gift mjrifath Ad-Free
13th October 2013, 05:48 AM |#5  
Senior Member
Thanks Meter: 535
 
More
@majdinj
Why don't you make a ROM with all of your mods combined ?
The Following User Says Thank You to M3TALLICA For This Useful Post: [ View ] Gift M3TALLICA Ad-Free
13th October 2013, 06:04 AM |#6  
mjrifath's Avatar
Senior Member
Flag Colombo
Thanks Meter: 876
 
More
Quote:
Originally Posted by M3TALLICA

@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

Sent from my GT-N7000 using xda premium
The Following User Says Thank You to mjrifath For This Useful Post: [ View ] Gift mjrifath Ad-Free
13th October 2013, 09:04 AM |#7  
Kamy's Avatar
Recognized Contributor
Flag Beijing
Thanks Meter: 17,840
 
Donate to Me
More
Quote:
Originally Posted by M3TALLICA

@majdinj
Why don't you make a ROM with all of your mods combined ?

That would be awesome!
The Following User Says Thank You to Kamy For This Useful Post: [ View ] Gift Kamy Ad-Free
13th October 2013, 09:27 AM |#8  
majdinj's Avatar
OP Senior Member
Flag AlAhsa
Thanks Meter: 3,318
 
More
Quote:
Originally Posted by M3TALLICA

@majdinj
Why don't you make a ROM with all of your mods combined ?

Quote:
Originally Posted by mjrifath

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

It's time for Glory LTA

Sent from my GT-N7000 using xda premium

Quote:
Originally Posted by kmokhtar79

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.
The Following 2 Users Say Thank You to majdinj For This Useful Post: [ View ] Gift majdinj Ad-Free
13th October 2013, 05:12 PM |#9  
mjrifath's Avatar
Senior Member
Flag Colombo
Thanks Meter: 876
 
More
Quote:
Originally Posted by majdinj

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






Sent from my GT-N7000 using xda premium
The Following User Says Thank You to mjrifath For This Useful Post: [ View ] Gift mjrifath Ad-Free
13th October 2013, 07:16 PM |#10  
Senior Member
Thanks Meter: 35
 
More
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.
13th October 2013, 07:41 PM |#11  
Senior Member
Thanks Meter: 535
 
More
Quote:
Originally Posted by mjrifath

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






Sent from my GT-N7000 using xda premium

add spell checker and volume rocker to skip tracks.
The Following User Says Thank You to M3TALLICA For This Useful Post: [ View ] Gift M3TALLICA Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes