Android M reflection method freeStorageAndNotify exception
问题 I'm using reflection method freeStorageAndNotify: Method freeStorageAndNotify = null; freeStorageAndNotify = service.packageManager.getClass().getMethod( "freeStorageAndNotify", long.class, IPackageDataObserver.class); freeStorageAndNotify.invoke(PackageManager.class, maxCache + freeSpace, packageDataObserver); This causes InvocationTargetException: java.lang.SecurityException: Neither user 10199 nor current process has android.permission.CLEAR_APP_CACHE. Some points: - I already have android