4

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?

Anthea
  • 3,741
  • 5
  • 40
  • 64

1 Answers1

0

Obviously Google doesn't want us to read other apps' size and is making sure we won't get any information. Most certainly for security reasons, like CPU % and so much other information that are no longer available on Android O! They say reading CPU % could give information about apps' activities on the device LOL.

And referring to this, it'll only get worse:

https://www.xda-developers.com/google-undocumented-hidden-apis-android-p/

3c71
  • 4,313
  • 31
  • 43