Assigned
Status Update
Comments
ra...@google.com <ra...@google.com>
ru...@gmail.com <ru...@gmail.com> #2
Any updates on this? It's been a month already since I reported it, and it seems this crash is occurring quite frequently for my users.
Description
1. My library is being consumed by an app developer. I am using the startup content provider to init my library. So this is hidden from the developer.
2. The app developer is creating his own content provider which requires my library. He adds his own ContentProvider with initOrder=MAX (for whatever reason).
3. When the app starts, it will now crash, because his ContentProvider runs before the startup provided one does.
Possible solution:
Since this is probably a very niche use case that will only happen with relatively advanced apps, we can probably get away with a solution that works in 99% of cases:
1. Define the largest possible initOrder for the provider exposed by the startup library.
2. Add a lint rule that detects if multiple providers exist with the same initOrder and instruct the developer that this value is taken and he should lower his own value.
In this case, the startup library will work automatically for the majority of app developers, and only require extra work in the (rare) scenario where there is a conflict with the value of initOrder.