Merge "Remove error slice from Settings in rendering time" into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e128d27a7a
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.android.settings.homepage.contextualcards.slices;
|
||||
|
||||
import static android.app.slice.Slice.HINT_ERROR;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
@@ -117,6 +119,14 @@ public class SliceContextualCardRenderer implements ContextualCardRenderer, Life
|
||||
return;
|
||||
}
|
||||
|
||||
if (slice.hasHint(HINT_ERROR)) {
|
||||
Log.w(TAG, "Slice has HINT_ERROR, skipping rendering. uri=" + slice.getUri());
|
||||
mSliceLiveDataMap.get(slice.getUri()).removeObservers(mLifecycleOwner);
|
||||
mContext.getContentResolver().notifyChange(CardContentProvider.REFRESH_CARD_URI,
|
||||
null);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (holder.getItemViewType()) {
|
||||
case VIEW_TYPE_DEFERRED_SETUP:
|
||||
mDeferredSetupCardHelper.bindView(holder, card, slice);
|
||||
|
Reference in New Issue
Block a user