Merge "LocalDisplayAdapterTest - fixed issue with real DDC loading for fake display" into udc-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
38645f3450
@@ -496,7 +496,7 @@ final class LocalDisplayAdapter extends DisplayAdapter {
|
||||
private void loadDisplayDeviceConfig() {
|
||||
// Load display device config
|
||||
final Context context = getOverlayContext();
|
||||
mDisplayDeviceConfig = DisplayDeviceConfig.create(context, mPhysicalDisplayId,
|
||||
mDisplayDeviceConfig = mInjector.createDisplayDeviceConfig(context, mPhysicalDisplayId,
|
||||
mIsFirstDisplay);
|
||||
|
||||
// Load brightness HWC quirk
|
||||
@@ -1336,6 +1336,11 @@ final class LocalDisplayAdapter extends DisplayAdapter {
|
||||
public SurfaceControlProxy getSurfaceControlProxy() {
|
||||
return new SurfaceControlProxy();
|
||||
}
|
||||
|
||||
public DisplayDeviceConfig createDisplayDeviceConfig(Context context,
|
||||
long physicalDisplayId, boolean isFirstDisplay) {
|
||||
return DisplayDeviceConfig.create(context, physicalDisplayId, isFirstDisplay);
|
||||
}
|
||||
}
|
||||
|
||||
public interface DisplayEventListener {
|
||||
|
||||
@@ -1257,6 +1257,17 @@ public class LocalDisplayAdapterTest {
|
||||
public LocalDisplayAdapter.SurfaceControlProxy getSurfaceControlProxy() {
|
||||
return mSurfaceControlProxy;
|
||||
}
|
||||
|
||||
// Instead of using DisplayDeviceConfig.create(context, physicalDisplayId, isFirstDisplay)
|
||||
// we should use DisplayDeviceConfig.create(context, isFirstDisplay) for the test to ensure
|
||||
// that real device DisplayDeviceConfig is not loaded for FakeDisplay and we are getting
|
||||
// consistent behaviour. Please also note that context passed to this method, is
|
||||
// mMockContext and values will be loaded from mMockResources.
|
||||
@Override
|
||||
public DisplayDeviceConfig createDisplayDeviceConfig(Context context,
|
||||
long physicalDisplayId, boolean isFirstDisplay) {
|
||||
return DisplayDeviceConfig.create(context, isFirstDisplay);
|
||||
}
|
||||
}
|
||||
|
||||
private class TestListener implements DisplayAdapter.Listener {
|
||||
|
||||
Reference in New Issue
Block a user