Do not start suggestion loader if host isn't attached.
Change-Id: I1ab1de8f0bea6c66d8415e06aedcc7cbc6baf89c Fixes: 68759380 Test: robotests
This commit is contained in:
@@ -23,7 +23,6 @@ import static org.mockito.Mockito.when;
|
||||
|
||||
import android.app.LoaderManager;
|
||||
import android.content.Context;
|
||||
import android.database.MatrixCursor;
|
||||
|
||||
import com.android.settings.TestConfig;
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
@@ -88,4 +87,14 @@ public class SuggestionControllerMixinTest {
|
||||
verify(loaderManager).restartLoader(SuggestionLoader.LOADER_ID_SUGGESTIONS,
|
||||
null /* args */, mMixin /* callback */);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onServiceConnected_hostNotAttached_shouldDoNothing() {
|
||||
when(mHost.getLoaderManager()).thenReturn(null);
|
||||
|
||||
mMixin = new SuggestionControllerMixin(mContext, mHost, mLifecycle);
|
||||
mMixin.onServiceConnected();
|
||||
|
||||
verify(mHost).getLoaderManager();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user