Separating methods for updating the model to a sepatate class.

Removing static access to model update methods, to allow for better
access control and testing

Change-Id: I9afe004dbf1b2fe50df422fd28bceea9230a4704
This commit is contained in:
Sunny Goyal
2017-02-02 13:52:53 -08:00
parent 5a2edd65f2
commit 43bf11d9c9
17 changed files with 450 additions and 372 deletions
@@ -37,6 +37,7 @@ import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.List;
import static org.mockito.Matchers.anyBoolean;
import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
@@ -54,6 +55,8 @@ public class BaseModelUpdateTaskTestCase extends ProviderTestCase2<TestLauncherP
public InvariantDeviceProfile idp;
public LauncherAppState appState;
public LauncherModel model;
public ModelWriter modelWriter;
public MyIconCache iconCache;
public BgDataModel bgDataModel;
@@ -70,6 +73,11 @@ public class BaseModelUpdateTaskTestCase extends ProviderTestCase2<TestLauncherP
callbacks = mock(Callbacks.class);
appState = mock(LauncherAppState.class);
model = mock(LauncherModel.class);
modelWriter = mock(ModelWriter.class);
when(appState.getModel()).thenReturn(model);
when(model.getWriter(anyBoolean())).thenReturn(modelWriter);
myUser = Process.myUserHandle();
bgDataModel = new BgDataModel();