Allow onGetSliceDescendants to be slow
Because sometimes it needs to be Test: existing tests Bug: 79132845 Bug: 77873463 Change-Id: I93aa8553c48c856bf96c347a229be6e770751708
This commit is contained in:
@@ -23,6 +23,7 @@ import android.annotation.Nullable;
|
||||
import android.annotation.SdkConstant;
|
||||
import android.annotation.SdkConstant.SdkConstantType;
|
||||
import android.annotation.SystemService;
|
||||
import android.annotation.WorkerThread;
|
||||
import android.content.ContentProviderClient;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
@@ -217,6 +218,7 @@ public class SliceManager {
|
||||
* @return All slices within the space.
|
||||
* @see SliceProvider#onGetSliceDescendants(Uri)
|
||||
*/
|
||||
@WorkerThread
|
||||
public @NonNull Collection<Uri> getSliceDescendants(@NonNull Uri uri) {
|
||||
ContentResolver resolver = mContext.getContentResolver();
|
||||
try (ContentProviderClient provider = resolver.acquireContentProviderClient(uri)) {
|
||||
|
||||
@@ -398,12 +398,7 @@ public abstract class SliceProvider extends ContentProvider {
|
||||
|
||||
private Collection<Uri> handleGetDescendants(Uri uri) {
|
||||
mCallback = "onGetSliceDescendants";
|
||||
Handler.getMain().postDelayed(mAnr, SLICE_BIND_ANR);
|
||||
try {
|
||||
return onGetSliceDescendants(uri);
|
||||
} finally {
|
||||
Handler.getMain().removeCallbacks(mAnr);
|
||||
}
|
||||
return onGetSliceDescendants(uri);
|
||||
}
|
||||
|
||||
private void handlePinSlice(Uri sliceUri) {
|
||||
|
||||
Reference in New Issue
Block a user