FORUMS

Analysis & Opinion

Top Forum Discussions

[Guide] Permanent Disable of Ongoing Notifications

980 posts
Thanks Meter: 3,184
 
By majdinj, Senior Member on 10th October 2013, 07:04 PM
Post Reply Subscribe to Thread Email Thread
Are annoyed with ongoing notifications in pull-down menu and status bar UI?
If yes, then this tutorial is just for you

In this tutorial, I will show you how to get rid of ongoing notifications in pull-down menu and the built-in ongoing notifications for status bar PERMANENTLY... This will not affect foreground ongoing activity..!! So here we go..


★ Disable Ongoing Notifications in Pull-down Menu ★


- Decompile SystemUI.apk.
- Navigate to res/layout folder and open tw_status_bar_expanded.xml file.
- Now, locate this section:
Code:
                <LinearLayout android:orientation="vertical" android:id="@id/onGoingCart" android:background="#ff293945" android:focusable="true" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="@dimen/status_bar_expanded_notification_category_height">
                    <TextView android:textSize="@dimen/status_bar_expanded_notification_category_text_size" android:textColor="@color/notification_category_color" android:gravity="left|center" android:id="@id/onGoingNotificationText" android:paddingLeft="11.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="@string/status_bar_ongoing_events_title" />
                </LinearLayout>
                <com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/onGoingItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/tw_notification_row_min_height" />
- Change the red texts in the previous codes to the new green one bellow and add the new blue codes..
Code:
                <LinearLayout android:orientation="vertical" android:id="@id/onGoingCart" android:background="#ff293945" android:focusable="true" android:visibility="gone" android:layout_width="0.0dip" android:layout_height="0.0dip">
                    <TextView android:textSize="@dimen/status_bar_expanded_notification_category_text_size" android:textColor="@color/notification_category_color" android:visibility="gone" android:gravity="left|center" android:id="@id/onGoingNotificationText" android:paddingLeft="11.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="@string/status_bar_ongoing_events_title" />
                </LinearLayout>
                <com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/onGoingItems" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/tw_notification_row_min_height" />
- Save changes, recompile, push to phone, fix permissions (644) and reboot.


★ Disable Built-in Ongoing Notifications in Status Bar ★


Ok, this part is only for built-in ongoing notifications, since market apps ongoing notifications can be disabled from application manager settings..!!!

A. Disable USB Debugging Notification:
This is quiet simple. In your phone, go to /system partition folder and open build.prop file and add this line if it is not there or edit the pre-existent one to be like this one:
Code:
persist.adb.notify=0
So.. 0 means disable and 1 means enable.


B. Disable Full Battery Notification:
- Baksmali SystemUI.apk.
- Go to classes/com/android/systemui/power/ folder and open PowerUI.smali.
- Search for this method ".method notifyFullBatteryNotification()V" and just add the following line (the blue line):
Code:
.method notifyFullBatteryNotification()V
    .registers 12

    .prologue
    return-void
	
    const/4 v10, 0x0

    .line 827
    iget-object v7, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;

    const-string v8, "notification"
Explanation: the method will return to nothing (exit) as it is just void.
- Save changes.. smali (recompile).. push to phone.. fix permissions (644) and reboot.


C. Disable Keyboard Input Notification:
- Baksmali services.jar.
- Navigate to classout/com/android/server/ folder and open InputMethodManagerService.smali
- Search for this method ".method public setImeWindowStatus(Landroid/os/IBinder;II)V" and just add the following line (the blue line):
Code:
.method public setImeWindowStatus(Landroid/os/IBinder;II)V
    .registers 23
    .param p1, "token"    # Landroid/os/IBinder;
    .param p2, "vis"    # I
    .param p3, "backDisposition"    # I

    .prologue
    return-void
	
    .line 1640
    invoke-static {}, Landroid/os/Binder;->getCallingUid()I
Explanation: the method will return to nothing (exit) as it is just void.
- Save changes.. smali (recompile).. push to phone.. fix permissions (644) and reboot.


D. Disable USB Connection Notification:
This method is inspired by this thread here by @Didact74
- Decompile framework-res.apk.
- Go to res/values/ folder and open drawables.xml and add this line at the end before </resources> line:
Code:
<item type="drawable" name="stat_sys_data_usb">false</item>
- Now delete this image resource "stat_sys_data_usb.png" from both res/drawables-hdpi and drawables-xhdpi folders.
- Recompile, push to phone, fix permissions (644) and reboot.


And that's all folks for this tutorial,,, and until next tutorial,, please stay safe,,,

Yours,,

The Following 11 Users Say Thank You to majdinj For This Useful Post: [ View ]
 
 
10th October 2013, 07:08 PM |#2  
majdinj's Avatar
OP Senior Member
Flag AlAhsa
Thanks Meter: 3,184
 
More

<< Adding toggle to switch on and off full battery notification and keyboard notification >>



Coming Soon....
See this thread:
http://forum.xda-developers.com/show...7#post46565607
Last edited by majdinj; 17th October 2013 at 08:03 PM.
The Following 3 Users Say Thank You to majdinj For This Useful Post: [ View ]
10th October 2013, 07:37 PM |#3  
nokiamodeln91's Avatar
Senior Member
Thanks Meter: 2,748
 
More
Ho Ho Ho!
The Following User Says Thank You to nokiamodeln91 For This Useful Post: [ View ]
10th October 2013, 08:28 PM |#4  
majdinj's Avatar
OP Senior Member
Flag AlAhsa
Thanks Meter: 3,184
 
More
Quote:
Originally Posted by nokiamodeln91

Ho Ho Ho!

lol.. Yei Yei
The Following User Says Thank You to majdinj For This Useful Post: [ View ]
10th October 2013, 10:31 PM |#5  
nokiamodeln91's Avatar
Senior Member
Thanks Meter: 2,748
 
More
The first part., its going to disable all ongoing ones right? Not app specific.
10th October 2013, 10:37 PM |#6  
nokiamodeln91's Avatar
Senior Member
Thanks Meter: 2,748
 
More
I just want to remove the one that shows speed in the screenshot.
Attached Thumbnails
Click image for larger version

Name:	uploadfromtaptalk1381440993682.jpg
Views:	369
Size:	20.6 KB
ID:	2316345  
11th October 2013, 12:45 PM |#7  
majdinj's Avatar
OP Senior Member
Flag AlAhsa
Thanks Meter: 3,184
 
More
Quote:
Originally Posted by nokiamodeln91

The first part., its going to disable all ongoing ones right? Not app specific.

Yes, all of whatever in pull-down menu

Quote:
Originally Posted by nokiamodeln91

I just want to remove the one that shows speed in the screenshot.

If you want to remove that in both status bar and pull-down then uncheck show notification in application manager for that app
If you want only one of them, then you need to decompile the app and look to its smali method that invoke notification and you need to debug the <if :condition> for that method so you will have notification in status bar but not in pull-down. Yes it could be time consuming but if you are patient enough you will do it.
The Following User Says Thank You to majdinj For This Useful Post: [ View ]
3rd November 2013, 12:13 PM |#8  
Junior Member
Thanks Meter: 1
 
More
Thanks thats great! is there a way to stop the screen turning on and fully charged beep. the phone's screen lights up during the night when i am asleep and sometimes wakes me up!
The Following User Says Thank You to Fender9770 For This Useful Post: [ View ]
3rd November 2013, 12:27 PM |#9  
nokiamodeln91's Avatar
Senior Member
Thanks Meter: 2,748
 
More
Use xposed with gravitybox.
9th March 2015, 07:43 PM |#10  
Senior Member
Thanks Meter: 103
 
Donate to Me
More
Quote:
Originally Posted by Fender9770

Thanks thats great! is there a way to stop the screen turning on and fully charged beep. the phone's screen lights up during the night when i am asleep and sometimes wakes me up!

+1
The Following User Says Thank You to ionutmaruta For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes