Enforce a timeout for Content Providers to be published.

ActivityManagerService: In the case where we are launching
an application on behalf of a Content Provider request,
enforce a timeout inbetween the application attaching and
the content providers being published. Consider that a defective
content provider may block in ContentProvider::onCreate
indefinitely: in such a case the PROC_START_TIMEOUT has already
been removed as the activity manager must have called bindApplication.

In these cases, there will be nothing to wake threads blocking
on the (non timed) wait for provider to be published at the end of
ActivityManagerService::getContentProviderImpl. This can cause binder
threads to block 1 by 1 until eventually AMS runs out and becomes
unresponsive.

Bug: 22141958
Change-Id: I2226da5df5c79b37f0b896423b3c1eaa4a7ecbba
(cherry picked from commit da33c13434cb20a11b522374411a5b819503e4e0)
1 file changed