I used to get the package size of all installed app with
Method getPackageSizeInfo = null;
try {
getPackageSizeInfo = pm.getClass().getMethod(
"getPackageSizeInfo", String.class,
IPackageStatsObserver.class);
} catch (NoSuchMethodException e) {
LogIt.e(this, e.toString());
}
Nevertheless this is not possible in Android O anymore and Android feels offended:
D/ApplicationPackageManager: Shame on you for calling the hidden API getPackageSizeInfoAsUser(). Shame!
Is there a workaround to get the size of the other apps?