I'm using method freeStorageAndNotify()
with permission android.permission.CLEAR_APP_CACHE
to delete system cache of all installed applications. But the method started throwing InvocationTargetException
from the android marshmallow 6.0 version.
After googling the issues I found the same issue as reported here:
Android M reflection method freeStorageAndNotify exception
So here the conclusion was, freeStorageAndNotify()
stopped working since google has raised the method's signature level now to signature|system.
But now the question is how other third-party apps like 'Clean master' are still able to delete system cache of all installed applications by taking accessibility permission from the user for 6.0 devices?