10

I have an Android app that should list all installed apps on a device (no root). I have tried both getInstalledApplications(0) and getInstalledPackages(0) methods of PackageManager, but on some devices, which do apparently have too many apps installed, I'm getting "Package manager has died" RuntimeException (I receive them via error reporting service of Google Play). This is due to a well-known limitation of 1MB per 1 call in IPC used internally by Android.

How to workaround this? I don't mind to request the long list by chunks, but I don't see any means for that. Only 2 abovementioned methods are available.

Stan
  • 8,683
  • 9
  • 58
  • 102
  • Wow, how many apps do you have on the device? Anyway, the 1MB per call I think is per all calls ongoing? So, do you have other IPCs going on?like Content Provider or Intents? If you have large other transactions going on, then the limit for this call will be much lower. – Kaediil Jun 12 '14 at 13:07
  • That's not my devices. This app is published on Google Play, and having thousands of installs I receive approx. 1 such exception per week. I don't have any other transactions - just a single call to `getInstalledPackages(0)`. AFAIK from Internet/Google groups, the limit of 1MB is for a single call. – Stan Jun 12 '14 at 16:15
  • Wow, I don't have much to help you then, But if it is a TransactionTooLarge exception, from the page on that exception at Google it is stated: The Binder transaction buffer has a limited fixed size, currently 1Mb, which is shared by all transactions in progress for the process. Consequently this exception can be thrown when there are many transactions in progress even when most of the individual transactions are of moderate size. – Kaediil Jun 12 '14 at 19:47

1 Answers1

3

The issue has been fixed since Android 5.1. You may find details in the Android issuetracker.

Stan
  • 8,683
  • 9
  • 58
  • 102