[Xposed Framework Modules] Publiuss:
Hi

OK, trying with all logging on and app notification set off.

When triggering media scanner I have some android.process.media ANR and this logs (from full logcat):

[...]
I/Xposed (10133): XMSO: Intent Intent { act=com.thomashofmann.xposed.mediascanneroptimizer.SCAN_EXTERNAL flg=0x10 } received.
I/Xposed (10133): XMSO: Request to rescan external volume.
D/XMSO (10133): Request for ApplicationContext for PID 10.133. Returning android.app.ContextImpl@4250c360.
D/XMSO (10133): ContextImpl#android.app.ContextImpl called with result null
I/Xposed (10133): XMSO: Executing hooked method android.app.ContextImpl on android.app.ContextImpl@4267ead0. Capturing some Context. Stacktrace is java.la
ng.RuntimeException: Determine Stacktrace
I/Xposed (10133): at com.thomashofmann.xposed.lib.XposedModule.getCurrentStackTraceString(XposedModule.java:419)
I/Xposed (10133): at com.thomashofmann.xposed.lib.XposedModule$5.apply(XposedModule.java:125)
I/Xposed (10133): at com.thomashofmann.xposed.lib.XposedModule$5.apply(XposedModule.java:122)
I/Xposed (10133): at com.thomashofmann.xposed.lib.AfterMethodHook.afterHookedMethod(AfterMethodHook.java:17)
I/Xposed (10133): at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:645)
I/Xposed (10133): at android.app.ContextImpl.<init>(Native Method)
I/Xposed (10133): at android.app.ContextImpl.createAppContext(ContextImpl.java:2044)
I/Xposed (10133): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2602)
I/Xposed (10133): at android.app.ActivityThread.access$1800(ActivityThread.java:144)
I/Xposed (10133): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1287)
I/Xposed (10133): at android.os.Handler.dispatchMessage(Handler.java:102)
I/Xposed (10133): at android.os.Looper.loop(Looper.java:136)
I/Xposed (10133): at android.app.ActivityThread.main(ActivityThread.java:5158)
I/Xposed (10133): at java.lang.reflect.Method.invokeNative(Native Method)
I/Xposed (10133): at java.lang.reflect.Method.invoke(Method.java:515)
I/Xposed (10133): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
I/Xposed (10133): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
I/Xposed (10133): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
I/Xposed (10133): at dalvik.system.NativeStart.main(Native Method)
D/XMSO (10133): ContextImpl#android.app.ContextImpl returns with result null
I/Xposed (10133): XMSO: onStartCommand is called with Intent Intent { cmp=com.android.providers.media/.MediaScannerService (has extras) }, startId 1, file
path null, mimetype null and volume external on com.android.providers.media.MediaScannerService@4267e460
D/XMSO (10133): startIdsByPid is {10133=1}
I/Xposed (10133): Reloaded preferences: {pref_run_media_scanner_as_foreground_service_state=true, pref_prevent_repetetive_scans_state=true, pref_restrict_
directories_to_scan_state=false, pref_log_to_xposed_log_state=true, pref_show_results_state=false, pref_logging_enabled_state=true, pref_restrict_to_certai
n_media_types_state=false, pref_run_media_scanner_with_background_thread_priority_state=true}
I/XMSO (10133): Number of start commands for external volume is 1
I/Xposed (10133): XMSO: Number of start commands for external volume is 1
I/XMSO (10133): Number of successful runs for external volume is 0
I/Xposed (10133): XMSO: Number of successful runs for external volume is 0
I/XMSO (10133): scan is called for directories [/storage/emulated/0, /storage/sdcard1, /storage/usbdisk] on volume external
I/Xposed (10133): XMSO: scan is called for directories [/storage/emulated/0, /storage/sdcard1, /storage/usbdisk] on volume external
I/XMSO (10133): Set service to foreground
I/Xposed (10133): XMSO: Set service to foreground
I/XMSO (10133): createSimpleNotification with title Media Scanner Optimizer, text Processing volume external, subText null
I/Xposed (10133): XMSO: createSimpleNotification with title Media Scanner Optimizer, text Processing volume external, subText null
D/XMSO (10133): Request for ApplicationContext for PID 10.133. Returning android.app.ContextImpl@4250c360.
I/XMSO (10133): The following directories will be scanned by MediaScanner: [/storage/emulated/0, /storage/sdcard1, /storage/usbdisk]
I/Xposed (10133): XMSO: The following directories will be scanned by MediaScanner: [/storage/emulated/0, /storage/sdcard1, /storage/usbdisk]
D/flow ( 2712): ********** onNotificationPosted
D/flow ( 2712): ID :1 t: null p: com.android.providers.media
W/ResourceType( 3128): getEntry failing because entryIndex 65281 is beyond type entryCount 4
W/ResourceType( 3128): Failure getting entry for 0x7f02ff01 (t=1 e=65281) in package 0 (error -2147483647)
W/StatusBarIconView( 3128): Icon not found in 2130902785: 7f02ff01
W/StatusBarIconView( 3128): No icon for slot com.android.providers.media/0x1
W/StatusBar( 3128): removeNotification for unknown key: android.os.BinderProxy@42f53d00
D/NotificationService( 1553): onNotification error pkg=com.android.providers.media tag=null id=1; will crashApplication(uid=10006, pid=10133)
D/AndroidRuntime(10133): Shutting down VM
W/dalvikvm(10133): threadid=1: thread exiting with uncaught exception (group=0x417cace0)
W/StatusBar( 3128): removeNotification for unknown key: android.os.BinderProxy@42f53d00
E/AndroidRuntime(10133): FATAL EXCEPTION: main
E/AndroidRuntime(10133): Process: android.process.media, PID: 10133
E/AndroidRuntime(10133): android.app.RemoteServiceException: Bad notification posted from package com.android.providers.media: Couldn't create icon: Status
BarIcon(pkg=com.android.providers.mediauser=0 id=0x7f02ff01 level=0 visible=true num=0 )
E/AndroidRuntime(10133): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1372)
E/AndroidRuntime(10133): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(10133): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(10133): at android.app.ActivityThread.main(ActivityThread.java:5158)
E/AndroidRuntime(10133): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(10133): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(10133): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
E/AndroidRuntime(10133): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
E/AndroidRuntime(10133): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
E/AndroidRuntime(10133): at dalvik.system.NativeStart.main(Native Method)

[...]

D/XMSO (10133): Not restricting scan to certain media types <--A LOT OF THIS
I/brcm-gr ( 5196): [gralloc_lock]: new usage 0x933
I/brcm-gr ( 5196): [gralloc_lock]: new usage 0x933
D/XMSO (10133): In android.media.MediaScanner#processDirectory beforeHookedMethod
I/XMSO (10133): createSimpleNotification with title Media Scanner Optimizer, text Scanning /storage/sdcard1, subText null
I/Xposed (10133): XMSO: createSimpleNotification with title Media Scanner Optimizer, text Scanning /storage/sdcard1, subText null
D/XMSO (10133): Request for ApplicationContext for PID 10.133. Returning android.app.ContextImpl@4250c360.
D/XMSO (10133): Request for ApplicationContext for PID 10.133. Returning android.app.ContextImpl@4250c360.
D/flow ( 2712): ********** onNotificationPosted
D/flow ( 2712): ID :1 t: null p: com.android.providers.media
D/flow ( 2712): Notification id is 1414509355716
D/Event ( 2712): No subscribers registered for event class com.larvalabs.flow.event.NotificationAddedEvent
D/Event ( 2712): No subscribers registered for event class de.greenrobot.event.NoSubscriberEvent
W/ResourceType( 3128): getEntry failing because entryIndex 65281 is beyond type entryCount 4
W/ResourceType( 3128): Failure getting entry for 0x7f02ff01 (t=1 e=65281) in package 0 (error -2147483647)
W/StatusBarIconView( 3128): Icon not found in 2130902785: 7f02ff01
W/StatusBarIconView( 3128): No icon for slot com.android.providers.media/0x1
W/StatusBar( 3128): removeNotification for unknown key: android.os.BinderProxy@424fff68
D/flow ( 2712): ********** onNOtificationRemoved
D/flow ( 2712): ID :1tnulltcom.android.providers.media
D/NotificationService( 1553): onNotification error pkg=com.android.providers.media tag=null id=1; will crashApplication(uid=10006, pid=10133)
D/flow ( 2712): Notification id is 1414509355716
D/Event ( 2712): No subscribers registered for event class com.larvalabs.flow.event.NotificationRemovedEvent
D/Event ( 2712): No subscribers registered for event class de.greenrobot.event.NoSubscriberEvent
W/StatusBar( 3128): removeNotification for unknown key: android.os.BinderProxy@424fff68
D/XMSO (10133): Not restricting scan to certain media types

[...]