[4.1+] PinNotif - Pin Important Notifications To Avoid Clearing Them Accidentally

Search This thread

calebcabob

Senior Member
Jul 14, 2013
1,477
2,251
Massachusetts
Brilliant!! Its the little xposed modules like this one that make me realize my phone is way cooler than most peoples:)

I've only said this about a few mods, but WHY THE HELL IS THIS NOT A STOCK FEATURE??! Google, watch and learn!
 

androidified

Senior Member
Sep 11, 2011
71
95
Crashing SystemUI

After the recent SlimKat weekly 8.2 update my SYSTEM UI crashes like crazy when this module is active. I believe this will be fixed soon.
 

benthe

Senior Member
Dec 1, 2011
200
74
Using a OnePlus One on CM11S 38R, PinNotif overrides a feature of Cyanogen.
As seen here (view the two comments made to me, they show a detailed video & screenshot), there should be a "Ignore messages like this" option, but when PinNotif is enabled, the only option apart from App Info is Pin.

I narrowed down the issue to PinNotif, since that when keeping Xposed enabled (read, installed) and only disabling this module, the option appears and works.

I think the issue is that when you go ahead and put an extra option for the context menu there, you put it in (hardcoded) index 1, and not in index length - 1, but this is only an educated guess as a programmer. I'm not an Android developer, and hardly had time to look at the code for PinNotif unfortunately anyway.
 

w0rinal

Senior Member
May 9, 2014
329
88
Bamberg
And when you're working on this module to make ready for LP,
Could you try to fix this error?
It only happens when I long click a notification (and not just like that when opening the notification drawer)

Code:
02-24 22:05:40.120 E/AndroidRuntime(5242): FATAL EXCEPTION: main
02-24 22:05:40.120 E/AndroidRuntime(5242): Process: com.android.systemui, PID: 5242
02-24 22:05:40.120 E/AndroidRuntime(5242): java.lang.NoSuchFieldError: java.lang.String#notification
02-24 22:05:40.120 E/AndroidRuntime(5242): at de.robv.android.xposed.XposedHelpers.findField(XposedHelpers.java:80)
02-24 22:05:40.120 E/AndroidRuntime(5242): at de.robv.android.xposed.XposedHelpers.getObjectField(XposedHelpers.java:611)
02-24 22:05:40.120 E/AndroidRuntime(5242): at com.germainz.pinnotif.XposedMod$3$1.onLongClick(XposedMod.java:209)
02-24 22:05:40.120 E/AndroidRuntime(5242): at com.android.systemui.SwipeHelper$1.run(SwipeHelper.java:228)
02-24 22:05:40.120 E/AndroidRuntime(5242): at android.os.Handler.handleCallback(Handler.java:733)
02-24 22:05:40.120 E/AndroidRuntime(5242): at android.os.Handler.dispatchMessage(Handler.java:95)
02-24 22:05:40.120 E/AndroidRuntime(5242): at android.os.Looper.loop(Looper.java:136)
02-24 22:05:40.120 E/AndroidRuntime(5242): at android.app.ActivityThread.main(ActivityThread.java:5034)
02-24 22:05:40.120 E/AndroidRuntime(5242): at java.lang.reflect.Method.invokeNative(Native Method)
02-24 22:05:40.120 E/AndroidRuntime(5242): at java.lang.reflect.Method.invoke(Method.java:515)
02-24 22:05:40.120 E/AndroidRuntime(5242): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
02-24 22:05:40.120 E/AndroidRuntime(5242): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:611)
02-24 22:05:40.120 E/AndroidRuntime(5242): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
02-24 22:05:40.120 E/AndroidRuntime(5242): at dalvik.system.NativeStart.main(Native Method)

This module used to work on SlimKat but after flashing a new version (can't tell which one was the latest it worked on) I forgot about it and now this happens. ATM I'm on SlimKat 9

Sent from my Boeffla powered Slim (4.4.4) GT-I9300
 

Ronii10

Senior Member
Feb 13, 2015
392
34
Nice module
Can you add so that I can pin in recent app switcher?
Thanks!
[emoji4]
 
Last edited:

Gggggas

Senior Member
Dec 9, 2013
636
342
With all the respect for you and your work,

I have always been searching for something like this. It would be very helpful if you could make this module work on lollipop!!!
 

Donarsson

Member
Sep 17, 2015
10
3
Vienna
Is this still being maintained?
I have an idea how the UI design could be on Lollipop, now someone™ needs to implement it :p
The new notifications don't have a context menu any more, instead they have a "back side" with icons for options related to the app or its notifications. This would be the perfect place for a little pin toggle like shown in the pictures.
I'll have a look at the source of this module and the AOSP notifications and maybe send a pull request, but I can't promise anything.

Unpinned:
HvlADjr.png

Pinned:
LXTx2Kc.png
 
Last edited:

aarowm

Member
Jul 30, 2014
7
0
Does not work on Note 4 running DP 5.0.X / Emotion kernal. Causes System UI TO FC every 2 to 3 seconds.
 

D4nkster

New member
Apr 3, 2016
1
0
Got me stuck in a bootloop. Would be nice if you would update this module or then just remove it from the installer and the repo so that people won't break their phones because you won't maintain this module. (I'm using a Samsung Galaxy S5 on CM13 ROM {Marshmallow 6.0})
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 38
    Introduction
    This module allows you to pin important notifications to avoid clearing them by mistake. You do that by long pressing a notification then selecting "Pin." You can unpin pinned notification in a similar manner.
    This will not prevent notifications from being cleared by the application when you open them, and the application can still control the notification at any time (including clearing it). It simply prevents them from being cleared when you tap the "clear all" button or when you try to swipe them away.
    Originally requested here: http://www.reddit.com/r/xposed/comments/267hbt/request_pin_any_notification_so_that_it_cannot_be/

    Download
    http://repo.xposed.info/module/com.germainz.pinnotif

    Source Code
    https://github.com/GermainZ/PinNotif

    Notes
    • I have to override the long press menu for the notifications. In other words, if your ROM adds custom items, those will be lost.
    • This module is not compatible with XHaloFloatingWindow's feature that alters the notification long press menu. If you enable both, there's no guarantee which will override the notification menu first, so you might end up with XHaloFloatingWindow's long press menu (App Info/Open In Halo) or this module's (App Info/Pin.)
    • The goal of this module is to pin important notifications - not pin/unpin any notification at will. As such, ongoing notifications cannot be unpinned. This is by design.

    Changelog:
    1.3:
    • Compatibility fixes for 4.1.x and LG devices.
    1.1:
    • Compatibility fixes for pre-4.3 devices.
    • Don't fail when the notification contains large data (e.g. large icon.)
    • Other crash fixes.
    1.0:
    • Initial release.

    Attributions
    Icon made by Freepik from www.flaticon.com.

    Thanks
    • rovo89 and Tungstwenty for the Xposed framework;
    • zst123 for XHaloFloatingWindows from which this module takes some code.
    2
    Does the pinning survive a reboot?

    Sent from my Nexus 4 using XDA Free mobile app
    2
    Unfortunately, System UI has stopped. - Still doesn't work on SGNII 4.1.2 if I select App Info instead Pin/Unpin.
    Pin/Unpin works.
    Is it enough?
    I need your SystemUI.apk as well, please. It's usually in /system/app/ or /system/priv-app/.
    Alright, try the attached build and let me know if it works. If not, I need a log as before.
    It might be cm specific. I'm on beanstalk but I know it isn't on the new slim (or wasn't a while back).
    I'll look into it once the compatibility bugs are fixed.
    1
    I'd just like to let the dev know that I spent the last 2.5 hours attempting to recover my device which was stuck in a loop of "Unfortunately, system UI has stopped" messages every 2 seconds.

    I was about to perform a factory reset and repeatable flash my entire ROM, but thankfully I doubt a way to disable this module from TWRP. Even so, I had to go through a series of file deletes and a couple dozen reboot cycles to determine that this module was the one causing problems.

    This message is also for anyone that happens to stumble upon it before enabling this module to spare them stress. I am on a rooted OnePlus One with TWRP on COS 13.1 based on Android M and Xposed Framework v85.

    If the dev could please write a note in the module description warning about boot loops on Android M, I think that would be great. Thanks.


    +1.
    Went through the same just now.


    did uninstalling this app solve the crashing?
    i disabled xposed and the uninstalled this.still getting systemui crashes


    EDIT:turns out it was actually not uninstalled.Thought xposed installer did it.