.class public Landroidx/lifecycle/MediatorLiveData; .super Landroidx/lifecycle/MutableLiveData; .source "MediatorLiveData.java" # annotations .annotation system Ldalvik/annotation/MemberClasses; value = { Landroidx/lifecycle/MediatorLiveData$Source; } .end annotation .annotation system Ldalvik/annotation/Signature; value = { "", "Landroidx/lifecycle/MutableLiveData<", "TT;>;" } .end annotation # instance fields .field private mSources:Landroidx/arch/core/internal/SafeIterableMap; .annotation system Ldalvik/annotation/Signature; value = { "Landroidx/arch/core/internal/SafeIterableMap<", "Landroidx/lifecycle/LiveData<", "*>;", "Landroidx/lifecycle/MediatorLiveData$Source<", "*>;>;" } .end annotation .end field # direct methods .method public constructor ()V .registers 2 .line 69 invoke-direct {p0}, Landroidx/lifecycle/MutableLiveData;->()V .line 70 new-instance v0, Landroidx/arch/core/internal/SafeIterableMap; invoke-direct {v0}, Landroidx/arch/core/internal/SafeIterableMap;->()V iput-object v0, p0, Landroidx/lifecycle/MediatorLiveData;->mSources:Landroidx/arch/core/internal/SafeIterableMap; return-void .end method # virtual methods .method public addSource(Landroidx/lifecycle/LiveData;Landroidx/lifecycle/Observer;)V .registers 5 .annotation system Ldalvik/annotation/Signature; value = { "(", "Landroidx/lifecycle/LiveData<", "TS;>;", "Landroidx/lifecycle/Observer<", "-TS;>;)V" } .end annotation .line 86 new-instance v0, Landroidx/lifecycle/MediatorLiveData$Source; invoke-direct {v0, p1, p2}, Landroidx/lifecycle/MediatorLiveData$Source;->(Landroidx/lifecycle/LiveData;Landroidx/lifecycle/Observer;)V .line 87 iget-object v1, p0, Landroidx/lifecycle/MediatorLiveData;->mSources:Landroidx/arch/core/internal/SafeIterableMap; invoke-virtual {v1, p1, v0}, Landroidx/arch/core/internal/SafeIterableMap;->putIfAbsent(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; move-result-object p1 check-cast p1, Landroidx/lifecycle/MediatorLiveData$Source; if-eqz p1, :cond_1c .line 88 iget-object v1, p1, Landroidx/lifecycle/MediatorLiveData$Source;->mObserver:Landroidx/lifecycle/Observer; if-ne v1, p2, :cond_14 goto :goto_1c .line 89 :cond_14 new-instance p1, Ljava/lang/IllegalArgumentException; const-string p2, "This source was already added with the different observer" invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;->(Ljava/lang/String;)V throw p1 :cond_1c :goto_1c if-eqz p1, :cond_1f return-void .line 95 :cond_1f invoke-virtual {p0}, Landroidx/lifecycle/MediatorLiveData;->hasActiveObservers()Z move-result p1 if-eqz p1, :cond_28 .line 96 invoke-virtual {v0}, Landroidx/lifecycle/MediatorLiveData$Source;->plug()V :cond_28 return-void .end method .method protected onActive()V .registers 3 .line 117 iget-object v0, p0, Landroidx/lifecycle/MediatorLiveData;->mSources:Landroidx/arch/core/internal/SafeIterableMap; invoke-virtual {v0}, Landroidx/arch/core/internal/SafeIterableMap;->iterator()Ljava/util/Iterator; move-result-object v0 :goto_6 invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z move-result v1 if-eqz v1, :cond_1c invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v1 check-cast v1, Ljava/util/Map$Entry; .line 118 invoke-interface {v1}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object; move-result-object v1 check-cast v1, Landroidx/lifecycle/MediatorLiveData$Source; invoke-virtual {v1}, Landroidx/lifecycle/MediatorLiveData$Source;->plug()V goto :goto_6 :cond_1c return-void .end method .method protected onInactive()V .registers 3 .line 125 iget-object v0, p0, Landroidx/lifecycle/MediatorLiveData;->mSources:Landroidx/arch/core/internal/SafeIterableMap; invoke-virtual {v0}, Landroidx/arch/core/internal/SafeIterableMap;->iterator()Ljava/util/Iterator; move-result-object v0 :goto_6 invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z move-result v1 if-eqz v1, :cond_1c invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v1 check-cast v1, Ljava/util/Map$Entry; .line 126 invoke-interface {v1}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object; move-result-object v1 check-cast v1, Landroidx/lifecycle/MediatorLiveData$Source; invoke-virtual {v1}, Landroidx/lifecycle/MediatorLiveData$Source;->unplug()V goto :goto_6 :cond_1c return-void .end method .method public removeSource(Landroidx/lifecycle/LiveData;)V .registers 3 .annotation system Ldalvik/annotation/Signature; value = { "(", "Landroidx/lifecycle/LiveData<", "TS;>;)V" } .end annotation .line 108 iget-object v0, p0, Landroidx/lifecycle/MediatorLiveData;->mSources:Landroidx/arch/core/internal/SafeIterableMap; invoke-virtual {v0, p1}, Landroidx/arch/core/internal/SafeIterableMap;->remove(Ljava/lang/Object;)Ljava/lang/Object; move-result-object p1 check-cast p1, Landroidx/lifecycle/MediatorLiveData$Source; if-eqz p1, :cond_d .line 110 invoke-virtual {p1}, Landroidx/lifecycle/MediatorLiveData$Source;->unplug()V :cond_d return-void .end method