I can execute it with just MacroDroid, with helper it saysinstead of package usage stats permission.Code:
Permission Denial: can't dump ActivityManager from from pid=22719, uid=10312 due to missing android.permission.DUMP permission
Indeed, it works just fine with MacroDroid. I was just testing the helper to see if it's 100% reliable or not, the native one has only about 90% successful rate.
Anyway, what happens to you is that you haven't granted android.permission.DUMP yet for the helper. Once granted, give
dumpsys media_session a run, it will dump the correct data.
I forgot to mention that android.permission.PACKAGE_USAGE_STATS is not declared in the helper's manifest. So I couldn't grant the permission either by running
pm grant com.arlosoft.macrodroid.helper android.permission.PACKAGE_USAGE_STATS.
This permission seems to be required to query existing apps information. The dev may need to add the said permission, otherwise dumpsys activity activities will always thrown an error.