[Guide] Permanent Disable of Ongoing Notifications

Search This thread

majdinj

Senior Member
Nov 25, 2006
980
3,438
AlAhsa
Are annoyed with ongoing notifications in pull-down menu and status bar UI? :rolleyes:
If yes, then this tutorial is just for you :laugh:

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 ★

r5zu.png

- 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="[B][COLOR="Red"]fill_parent[/COLOR][/B]" android:layout_height="[B][COLOR="Red"]@dimen/status_bar_expanded_notification_category_height[/COLOR][/B]">
                    <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="[B][COLOR="Lime"]0.0dip[/COLOR][/B]" android:layout_height="[B][COLOR="Lime"]0.0dip[/COLOR][/B]">
                    <TextView android:textSize="@dimen/status_bar_expanded_notification_category_text_size" android:textColor="@color/notification_category_color" [B][COLOR="Blue"]android:visibility="gone"[/COLOR][/B] 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" [B][COLOR="Blue"]android:visibility="gone"[/COLOR][/B] 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 ★

prhf.png

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=[B][COLOR="Blue"]0[/COLOR][/B]
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
    [B][COLOR="Blue"]return-void[/COLOR][/B]
	
    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
    [B][COLOR="Blue"]return-void[/COLOR][/B]
	
    .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,,

 

majdinj

Senior Member
Nov 25, 2006
980
3,438
AlAhsa
The first part., its going to disable all ongoing ones right? Not app specific.

Yes, all of whatever in pull-down menu

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.
 
  • Like
Reactions: nokiamodeln91

Fender9770

Member
Oct 2, 2013
28
1
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!
 
  • Like
Reactions: ionutmaruta

Top Liked Posts

  • There are no posts matching your filters.
  • 12
    Are annoyed with ongoing notifications in pull-down menu and status bar UI? :rolleyes:
    If yes, then this tutorial is just for you :laugh:

    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 ★

    r5zu.png

    - 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="[B][COLOR="Red"]fill_parent[/COLOR][/B]" android:layout_height="[B][COLOR="Red"]@dimen/status_bar_expanded_notification_category_height[/COLOR][/B]">
                        <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="[B][COLOR="Lime"]0.0dip[/COLOR][/B]" android:layout_height="[B][COLOR="Lime"]0.0dip[/COLOR][/B]">
                        <TextView android:textSize="@dimen/status_bar_expanded_notification_category_text_size" android:textColor="@color/notification_category_color" [B][COLOR="Blue"]android:visibility="gone"[/COLOR][/B] 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" [B][COLOR="Blue"]android:visibility="gone"[/COLOR][/B] 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 ★

    prhf.png

    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=[B][COLOR="Blue"]0[/COLOR][/B]
    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
        [B][COLOR="Blue"]return-void[/COLOR][/B]
    	
        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
        [B][COLOR="Blue"]return-void[/COLOR][/B]
    	
        .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,,

    3

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



    Coming Soon....
    See this thread:
    http://forum.xda-developers.com/showthread.php?p=46565607#post46565607
    1
    The first part., its going to disable all ongoing ones right? Not app specific.

    Yes, all of whatever in pull-down menu

    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.
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