@Test public void checkLevel3SurfaceCombinationNotSupportedInFullDevice() { SupportedSurfaceCombination supportedSurfaceCombination = new SupportedSurfaceCombination( mContext, FULL_CAMERA_ID, mMockCamcorderProfileHelper); List<SurfaceCombination> combinationList = supportedSurfaceCombination.getLevel3SupportedCombinationList(); for (SurfaceCombination combination : combinationList) { boolean isSupported = mSurfaceManager.checkSupported( FULL_CAMERA_ID, combination.getSurfaceConfigList()); assertFalse(isSupported); } }
@Override public boolean checkSupported( String cameraId, List<SurfaceConfig> surfaceConfigList) { boolean isSupported = false; if (!mIsInitialized) { throw new IllegalStateException("Camera2DeviceSurfaceManager is not initialized."); } if (surfaceConfigList == null || surfaceConfigList.isEmpty()) { return true; } SupportedSurfaceCombination supportedSurfaceCombination = mCameraSupportedSurfaceCombinationMap.get(cameraId); if (supportedSurfaceCombination != null) { isSupported = supportedSurfaceCombination.checkSupported(surfaceConfigList); } return isSupported; }
Camera2DeviceSurfaceManager implements CameraDeviceSurfaceManager { @Override public boolean checkSupported( String cameraId, List<SurfaceConfig> surfaceConfigList) { boolean isSupported = false; if (!mIsInitialized) { throw new IllegalStateException("Camera2DeviceSurfaceManager is not initialized."); } if (surfaceConfigList == null || surfaceConfigList.isEmpty()) { return true; } SupportedSurfaceCombination supportedSurfaceCombination = mCameraSupportedSurfaceCombinationMap.get(cameraId); if (supportedSurfaceCombination != null) { isSupported = supportedSurfaceCombination.checkSupported(surfaceConfigList); } return isSupported; } }
Camera2DeviceSurfaceManager implements CameraDeviceSurfaceManager { @Override public boolean checkSupported( String cameraId, List<SurfaceConfig> surfaceConfigList) { boolean isSupported = false; if (!mIsInitialized) { throw new IllegalStateException("Camera2DeviceSurfaceManager is not initialized."); } if (surfaceConfigList == null || surfaceConfigList.isEmpty()) { return true; } SupportedSurfaceCombination supportedSurfaceCombination = mCameraSupportedSurfaceCombinationMap.get(cameraId); if (supportedSurfaceCombination != null) { isSupported = supportedSurfaceCombination.checkSupported(surfaceConfigList); } return isSupported; } Camera2DeviceSurfaceManager(Context context); @VisibleForTesting  Camera2DeviceSurfaceManager(Context context, CamcorderProfileHelper camcorderProfileHelper); }
Camera2DeviceSurfaceManager implements CameraDeviceSurfaceManager { @Override public boolean checkSupported( String cameraId, List<SurfaceConfig> surfaceConfigList) { boolean isSupported = false; if (!mIsInitialized) { throw new IllegalStateException("Camera2DeviceSurfaceManager is not initialized."); } if (surfaceConfigList == null || surfaceConfigList.isEmpty()) { return true; } SupportedSurfaceCombination supportedSurfaceCombination = mCameraSupportedSurfaceCombinationMap.get(cameraId); if (supportedSurfaceCombination != null) { isSupported = supportedSurfaceCombination.checkSupported(surfaceConfigList); } return isSupported; } Camera2DeviceSurfaceManager(Context context); @VisibleForTesting  Camera2DeviceSurfaceManager(Context context, CamcorderProfileHelper camcorderProfileHelper); @Override boolean checkSupported(
            String cameraId, List<SurfaceConfig> surfaceConfigList); @Override SurfaceConfig transformSurfaceConfig(String cameraId, int imageFormat, Size size); @Override Map<UseCase, Size> getSuggestedResolutions(
            String cameraId, List<UseCase> originalUseCases, List<UseCase> newUseCases); @Override Size getMaxOutputSize(String cameraId, int imageFormat); @Override Size getPreviewSize(); @Override boolean requiresCorrectedAspectRatio(@NonNull UseCaseConfig<?> useCaseConfig); @Nullable @Override Rational getCorrectedAspectRatio(@NonNull UseCaseConfig<?> useCaseConfig); }
Camera2DeviceSurfaceManager implements CameraDeviceSurfaceManager { @Override public boolean checkSupported( String cameraId, List<SurfaceConfig> surfaceConfigList) { boolean isSupported = false; if (!mIsInitialized) { throw new IllegalStateException("Camera2DeviceSurfaceManager is not initialized."); } if (surfaceConfigList == null || surfaceConfigList.isEmpty()) { return true; } SupportedSurfaceCombination supportedSurfaceCombination = mCameraSupportedSurfaceCombinationMap.get(cameraId); if (supportedSurfaceCombination != null) { isSupported = supportedSurfaceCombination.checkSupported(surfaceConfigList); } return isSupported; } Camera2DeviceSurfaceManager(Context context); @VisibleForTesting  Camera2DeviceSurfaceManager(Context context, CamcorderProfileHelper camcorderProfileHelper); @Override boolean checkSupported(
            String cameraId, List<SurfaceConfig> surfaceConfigList); @Override SurfaceConfig transformSurfaceConfig(String cameraId, int imageFormat, Size size); @Override Map<UseCase, Size> getSuggestedResolutions(
            String cameraId, List<UseCase> originalUseCases, List<UseCase> newUseCases); @Override Size getMaxOutputSize(String cameraId, int imageFormat); @Override Size getPreviewSize(); @Override boolean requiresCorrectedAspectRatio(@NonNull UseCaseConfig<?> useCaseConfig); @Nullable @Override Rational getCorrectedAspectRatio(@NonNull UseCaseConfig<?> useCaseConfig);  }