[Solved] bring back Notification Importance settings to hide icons from ONLY status bar


sanoayyk

Members
Jan 4, 2021
7
15
I loved to minimize notifications from some background services so that they don't appear on statusbar while I can check if they were running by peeking notification shade.
Now it became impossible.
From MIUI12 on Android11, Xiaomi deleted notification importance settings from any notification channel.
That is the most terrible thing about current MIUI.

I know the minimized view is stiil alive because when I upgrade from Android10, the apps have minimized notification importance in Android10 still keep minimized after being updated to Android11.
We just lost the "access" to notification importance setting.

So, can we trick notification importance on current MIUI?
I did some research then found, notification impotance is defined on any notification channel by like
"val importance = NotificationManager.IMPORTANCE_DEFAULT"
If we can override importance to IMPORTANCE_MIN, we should get minimized notification.

However, I have no idea how to override it.
Is it stored in xml or something? Or any adb shell command to do it?
Any solution include root method is welcome.


EDIT:
I browsed root storage and found "/data/system/notification_policy.xml" has notification priority value!!
Copied an line from another MIUI phone, which has working minimized notification, worked.
Just change notification priority seems not working. Some additional values needed to add.

For example, This line successfully minimized greenify notification.
<channel flags="0" id="background_service" name="Background Service" orig_imp="2" content_type="4" usage="5" importance="1" fgservice="true" locked="6" desc="To hide the sticky notification, please turn off this notification category completely." visibility="-1"/>

important:
Replacing xml must be done on TWRP and so on, when MIUI is not running. Or change will be reverted.
If just changing priority value doesn't work, try changing also orig_imp to 1.
 
Last edited:
I tried this trick in miui 12.5 android 11 but no success.
If I edit "/data/system/notification_policy.xml", then every time when the target app starts, this file resets to original.
 
I tried this trick in miui 12.5 android 11 but no success.
If I edit "/data/system/notification_policy.xml", then every time when the target app starts, this file resets to original.

I forgot to mention.
You have to replace xml when MIUI is not running.
I copy it to PC or internal storage, edit it, then replace on TWRP file manager.
If your editing is appropriate, it should have effect.
 
I forgot to mention.
You have to replace xml when MIUI is not running.
I copy it to PC or internal storage, edit it, then replace on TWRP file manager.
If your editing is appropriate, it should have effect.

I tried to replace the xml in TWRP, the notification is not actually "minimized" (it still shows all content instead of one single line with an expand arrow), but its icon is successfully hidden from the status bar.
Anyway it's a useful trick, for those who don't want these notification icon to mess up their status bar.

But, for new phone which doesn't have TWRP, I don't know how to replace the xml outside MIUI.
 
I tried to replace the xml in TWRP, the notification is not actually "minimized" (it still shows all content instead of one single line with an expand arrow), but its icon is successfully hidden from the status bar.
Anyway it's a useful trick, for those who don't want these notification icon to mess up their status bar.

But, for new phone which doesn't have TWRP, I don't know how to replace the xml outside MIUI.

Yeah the true minimized view is missing. Fortunately customiuizer does the trick.

For devices with no TWRP, creating magisk module folder to virtually replace it might work.
 
  • Like
Reactions: katerpanne
I finally successfully to change the xml without TWRP. Just put a executable shell script to modify the xml in "/data/adb/service.d", and magisk will run it during boot and modify the xml.
ps. I don't think using a magisk module to replace the file is a solution, since this file will change if new app installed or app created new notification channel.
ps2. In my tries, only change "importance" and "orig_imp" to 1 is not enough, "locked" also needs to be changed to 6 to minimize the notification.
 
  • Like
Reactions: ralphgaming
I finally successfully to change the xml without TWRP. Just put a executable shell script to modify the xml in "/data/adb/service.d", and magisk will run it during boot and modify the xml.
ps. I don't think using a magisk module to replace the file is a solution, since this file will change if new app installed or app created new notification channel.
ps2. In my tries, only change "importance" and "orig_imp" to 1 is not enough, "locked" also needs to be changed to 6 to minimize the notification.

Thank you for your additional methods, must be helpful for others.
I myself didn’t know it is possible to modify XML with script.

I didn’t trick “locked” but installed Customiuizer and go to System/Notifications/Bugfixes to enable the options so that true minimized view to be enabled.
 
Thank you for your additional methods, must be helpful for others.
I myself didn’t know it is possible to modify XML with script.

I didn’t trick “locked” but installed Customiuizer and go to System/Notifications/Bugfixes to enable the options so that true minimized view to be enabled.

In MIUI 12.5, the minimized view is there. I just changed the xml and notification minimized in one line.
MIUI 12.0 doesn't have minimized view.
 
I found another way to change this:
- Replace /system/product/priv-app/Settings.apk with the one in MIUI11
However, this method have some side effect: some MIUI12 settings disappeared, and settings app will FC when entering some setting item.
 
In MIUI 12.5, the minimized view is there. I just changed the xml and notification minimized in one line.
MIUI 12.0 doesn't have minimized view.

How do you enable minimized view in 12.5? I can't find it. And the setting in Customiuizer doesn't seem to work?
 
How do you enable minimized view in 12.5? I can't find it. And the setting in Customiuizer doesn't seem to work?

See the first post.
There are two ways:
- One way is by edit /data/system/notification_policy.xml outside MIUI, either by TWRP or by startup script. You can open that file, find the desired notification item, and change its "importance" to "1", add or change its "locked" to "6"
- Another way is to replace Settings app with the one in MIUI11. Settings.apk is located in /system/product/priv-app. This way has side effect: you won't be able to use some other setting items. But you can just replace it back after setting notification importance.
 
Hey, thanks for the suggestions. I'm using customiuizer on MIUI 12 (Android 10), 12.0.8 stable and have been waiting for a fix for this until I update.

Can I change the notification visibility from the status bar using only customiuizer or do I still need to change the XML?

Thanks!
 
Hey, thanks for the suggestions. I'm using customiuizer on MIUI 12 (Android 10), 12.0.8 stable and have been waiting for a fix for this until I update.

Can I change the notification visibility from the status bar using only customiuizer or do I still need to change the XML?

Thanks!

You must trick the XML if you want to KEEP notification in notification shade.

No need for any tweak if you want to clean BOTH status bar and noticifation shade.
 
It has been long since you guys discuss this yet Xiaomi still don't fix their notification behaviour
 
Last edited:
Any way to hide statusbar icons like Bluetooth, Hotspot... in MIUI 12.5

Edit: nvm... Was able to find a solution
 
Last edited:
yeah something like that, I know if I used other XML it will be useless. I just need an example even if 1 app settings
Here's an example:

<channel id="notification_channel_foreground_service" name="Battery Level Monitor Service" desc="" importance="1" visibility="-1" usage="5" content_type="4" flags="0" locked="6" fgservice="true" show_badge="true" orig_imp="1" />

changing/adding ----> visibility="-1" and locked="6" did the trick for me.
 

Similar threads

  • Locked
HyperOS 1.0 24.7.1
Replies
54
Views
41K
Replies
51
Views
38K
  • Locked
HyperOS 1.0 24.6.3
Replies
46
Views
41K
  • Locked
HyperOS 1.0 24.7.15/17
Replies
87
Views
42K