I found the ActivityManager has the same issue when we get the ActivityManager instance via an Activity context and keep it with a static variable.
No leakage if we get the ActivityManager instance via the Application context. I.e.
ctx.getApplicationContext().getSystemService(Context.ACTIVITY_SERVICE)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I found the ActivityManager has the same issue when we get the ActivityManager instance via an Activity context and keep it with a static variable.
No leakage if we get the ActivityManager instance via the Application context. I.e.
ctx.getApplicationContext().getSystemService(Context.ACTIVITY_SERVICE)