Revert "Prevents an NPE when content provider is slow to start"

This reverts commit 140fc2e9c9.

Reason for revert: b/149176266

Change-Id: I4015fcc1624ee116c4a013c99816d43ce7b24834
This commit is contained in:
Daniel Chapin
2020-02-10 22:12:44 +00:00
parent 140fc2e9c9
commit 3a54effffd
5 changed files with 18 additions and 112 deletions

View File

@@ -700,27 +700,6 @@ public abstract class ContentResolver implements ContentInterface {
/** @hide */
public static final String REMOTE_CALLBACK_RESULT = "result";
/**
* How long we wait for an attached process to publish its content providers
* before we decide it must be hung.
* @hide
*/
public static final int CONTENT_PROVIDER_PUBLISH_TIMEOUT_MILLIS = 10 * 1000;
/**
* How long we wait for an provider to be published. Should be longer than
* {@link #CONTENT_PROVIDER_PUBLISH_TIMEOUT_MILLIS}.
* @hide
*/
public static final int CONTENT_PROVIDER_WAIT_TIMEOUT_MILLIS =
CONTENT_PROVIDER_PUBLISH_TIMEOUT_MILLIS + 10 * 1000;
// Should be >= {@link #CONTENT_PROVIDER_WAIT_TIMEOUT_MILLIS}, because that's how
// long ActivityManagerService is giving a content provider to get published if a new process
// needs to be started for that.
private static final int GET_TYPE_TIMEOUT_MILLIS =
CONTENT_PROVIDER_WAIT_TIMEOUT_MILLIS + 5 * 1000;
public ContentResolver(@Nullable Context context) {
this(context, null);
}
@@ -870,6 +849,8 @@ public abstract class ContentResolver implements ContentInterface {
}
}
private static final int GET_TYPE_TIMEOUT_MILLIS = 3000;
private static class GetTypeResultListener implements RemoteCallback.OnResultListener {
@GuardedBy("this")
public boolean done;