xie
2024-11-23 3fdfdea0721fe7a36f6aaa509075f01a194f6748
android/packages/apps/Camera2/src/com/android/camera/one/config/OneCameraFeatureConfigCreator.java
....@@ -28,6 +28,7 @@
2828 import com.android.camera.util.GservicesHelper;
2929 import com.google.common.base.Function;
3030 import com.google.common.base.Optional;
31
+import android.os.SystemProperties;
3132
3233 /**
3334 * Creates the OneCamera feature configurations for the GoogleCamera app.
....@@ -35,6 +36,7 @@
3536 public class OneCameraFeatureConfigCreator {
3637 private static final Log.Tag TAG = new Log.Tag("OneCamFtrCnfgCrtr");
3738
39
+ private static final String ANDROID_UVC_PROPERTY = "ro.camera.uvcfacing";
3840 /**
3941 * Create the default camera feature config.
4042 */
....@@ -119,7 +121,14 @@
119121 // On LIMITED devices starting with L-MR1 we run a simple YUV
120122 // capture mode.
121123 if (supportedLevel == CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED) {
122
- return CaptureSupportLevel.LIMITED_JPEG;
124
+ // return CaptureSupportLevel.LIMITED_JPEG;
125
+ String uvcProperty = SystemProperties.get(ANDROID_UVC_PROPERTY, "");
126
+ if(uvcProperty.equals("")){
127
+ return CaptureSupportLevel.LIMITED_JPEG;
128
+ }
129
+ else{
130
+ return CaptureSupportLevel.LIMITED_YUV;
131
+ }
123132 }
124133
125134 // We should never get here. If we do, let's fall back to a mode