Fix volume panel hang

SliceLiveData changed its behavior, if slice is null, it will not
notify LiveData observer but callback to onErrorListener. We only
reduce PanelSlicesLoaderCountdownLatch in LiveData observer.
Therefore the error slice caused PanelSlicesLoaderCountdownLatch
never count to 0, the UI was not displayed. It is solved by reducing
PanelSlicesLoaderCountdownLatch in onErrorListener and also not return
null in MediaOutputIndicatorSlice.

Test: manual
Fixes: 141084035
Change-Id: Iddb2dbdc0e0d2ac3e26071960bb667937f181121
This commit is contained in:
Raff Tsai
2019-09-17 23:47:07 +08:00
parent a9177ca0eb
commit d9cfbaf3b5
6 changed files with 67 additions and 41 deletions

View File

@@ -65,7 +65,9 @@ public class MediaOutputIndicatorSlice implements CustomSliceable {
@Override
public Slice getSlice() {
if (!isVisible()) {
return null;
return new ListBuilder(mContext, MEDIA_OUTPUT_INDICATOR_SLICE_URI, ListBuilder.INFINITY)
.setIsError(true)
.build();
}
final IconCompat icon = IconCompat.createWithResource(mContext,
com.android.internal.R.drawable.ic_settings_bluetooth);