Fix crash when starting daydream setting with wrong context

The context must be a UI context. This is a new requirement in P.

(Also converted the CurrentDream controller to be slice compatible)

Change-Id: I28874f296da617f4cedf6706b0663b76671f1780
Fixes: 111375261
Test: robotests
This commit is contained in:
Fan Zhang
2018-07-12 13:22:23 -07:00
parent 00d42c510d
commit 6269e50e8e
4 changed files with 26 additions and 28 deletions

View File

@@ -56,7 +56,7 @@ public class CurrentDreamPreferenceControllerTest {
public void setup() {
MockitoAnnotations.initMocks(this);
mController = new CurrentDreamPreferenceController(mContext);
mController = new CurrentDreamPreferenceController(mContext, "test");
ReflectionHelpers.setField(mController, "mBackend", mBackend);
}