LATEST   
Email

22 October, 2011

remove battery fully charged notification icon and sound

perhaps this is one of the most annoying issues, i cannot understand why we need two icons on the status bar if the battery is fully charged

although there are some how-to already, i wanna show you an alternative way to do it
here is an simplier way to remove the icon (plus the notification sound and screen on when the battery is fully charged if you want to). you can opt to disable all of them, or with any one of them enabled only

*this is for DEODEXED files ONLY!! tested on Android 2.3 KI8 and should work with other versions also


- decompile SystemUI.apk
- open StatusBarPolicy.smali under smali/com/android/systemui/statusbar/policy directory with your favorite text editor
- search for ".method private addFullChargeNotification()V" without quotes
- scroll down a bit and you will find something like:

.line 2300
    new-instance v2, Landroid/app/Notification;

    const v3, 0x7f02002a

    const-wide/16 v4, 0x0

    invoke-direct {v2, v3, v1, v4, v5}, Landroid/app/Notification;->(ILjava/lang/CharSequence;J)V

    .line 2301
    iget v3, v2, Landroid/app/Notification;->flags:I

    or-int/lit8 v3, v3, 0x2

    iput v3, v2, Landroid/app/Notification;->flags:I

those ".line xxxx" above should be different with yours, and
0x7f02002a is the ID of the battery full icon, you may find it differs and that's fine


for the tweak:

option 1 - replace 0x7f02002a with 0x0

for example, before change:
const v3, 0x7f02002a

after change:
const v3, 0x0


option 2 - add a hash sign (#) before the line const v3, 0x7f02002a and write a new line below it, just in case you want to roll it back

for example, before change:
const v3, 0x7f02002a

after change:
#const v3, 0x7f02002a
const v3, 0x0


also note that the number of hash signs or empty spaces before the line are NOT important!! so all of the lines below are valid:

# const v3, 0x7f02002a
# # const v3, 0x7f02002a
##### const v3, 0x7f02002a




how does this work?

after reading the souce code of Notification.smali, i found that it accepts notification without an icon by calling it with the icon parameter with a zero (which is the 0x0 above)



remove notification sound and screen on
in case you want to remove the notification sound as well, scroll down a bit more and put a # in front of the line as below:

# invoke-direct {p0, v0}, Lcom/android/systemui/statusbar/policy/StatusBarPolicy;->playTone(Landroid/net/Uri;)V



and for the screen on after fully charged, make these changes below the playTone found in above:

# .line 2308
# invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/StatusBarPolicy;->turnOnScreenWithForce()V



to see the result, upload the recompiled SystemUI.apk to /system/app/, and type in adb (no need to reboot/wipe, etc):

kill -HUP `pidof system_server`


and you should notice the changes immediately



Facebook Comments
1 Blogger Comments
Facebook Comments by Blogger Widgets

1 comment:

  1. I will try this method to see is it working or not and will be back soon. Thanks. notification software

    ReplyDelete

Note: Only a member of this blog may post a comment.

Loading