summaryrefslogtreecommitdiff
path: root/src/com/android/camera/SettingsManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/SettingsManager.java')
-rwxr-xr-x[-rw-r--r--]src/com/android/camera/SettingsManager.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/com/android/camera/SettingsManager.java b/src/com/android/camera/SettingsManager.java
index 208d5a5c5..cfe42dfcd 100644..100755
--- a/src/com/android/camera/SettingsManager.java
+++ b/src/com/android/camera/SettingsManager.java
@@ -130,6 +130,7 @@ public class SettingsManager implements ListMenu.SettingsListener {
public static final String SCENE_MODE_DUAL_STRING = "100";
public static final String SCENE_MODE_SUNSET_STRING = "10";
public static final String SCENE_MODE_LANDSCAPE_STRING = "4";
+ public static final String KEY_CAMERA_SAVEPATH = "pref_camera2_savepath_key";
public static final String KEY_RECORD_LOCATION = "pref_camera2_recordlocation_key";
public static final String KEY_JPEG_QUALITY = "pref_camera2_jpegquality_key";
public static final String KEY_FOCUS_MODE = "pref_camera2_focusmode_key";
@@ -250,6 +251,7 @@ public class SettingsManager implements ListMenu.SettingsListener {
private boolean mIsFrontCameraPresent = false;
private boolean mHasMultiCamera = false;
private boolean mIsHFRSupported = false;
+ private boolean mIsHFRSupportedOnCurrentResolution = false;
private JSONObject mDependency;
private int mCameraId;
private Set<String> mFilteredKeys;
@@ -1076,6 +1078,7 @@ public class SettingsManager implements ListMenu.SettingsListener {
}
}
// filter unsupported preferences
+ ListPreference savePath = mPreferenceGroup.findPreference(KEY_CAMERA_SAVEPATH);
ListPreference forceAUX = mPreferenceGroup.findPreference(KEY_FORCE_AUX);
ListPreference whiteBalance = mPreferenceGroup.findPreference(KEY_WHITE_BALANCE);
ListPreference flashMode = mPreferenceGroup.findPreference(KEY_FLASH_MODE);
@@ -1116,6 +1119,13 @@ public class SettingsManager implements ListMenu.SettingsListener {
}
buildCameraId();
+ if (savePath != null) {
+ if (filterUnsupportedOptions(savePath, getSupportedSavePaths(cameraId))) {
+ mFilteredKeys.add(savePath.getKey());
+ }
+ }
+
+
if (whiteBalance != null) {
if (filterUnsupportedOptions(whiteBalance, getSupportedWhiteBalanceModes(cameraId))) {
mFilteredKeys.add(whiteBalance.getKey());
@@ -1526,6 +1536,10 @@ public class SettingsManager implements ListMenu.SettingsListener {
return mIsHFRSupported;
}
+ public boolean isHFRSupportedOnCurrentResolution() {
+ return mIsHFRSupportedOnCurrentResolution;
+ }
+
private void filterVideoEncoderProfileOptions() {
ListPreference videoEncoderProfilePref =
mPreferenceGroup.findPreference(KEY_VIDEO_ENCODER_PROFILE);
@@ -1696,12 +1710,14 @@ public class SettingsManager implements ListMenu.SettingsListener {
rate = String.valueOf(r.getUpper());
supported.add("hfr" + rate);
supported.add("hsr" + rate);
+ mIsHFRSupportedOnCurrentResolution = true;
}
}
}
}
} catch (IllegalArgumentException ex) {
Log.w(TAG, "HFR is not supported for this resolution " + ex);
+ mIsHFRSupportedOnCurrentResolution = false;
}
if (mExtendedHFRSize != null && mExtendedHFRSize.length >= 3) {
for (int i = 0; i < mExtendedHFRSize.length; i += 3) {
@@ -2117,6 +2133,16 @@ public class SettingsManager implements ListMenu.SettingsListener {
.get(CameraCharacteristics.LENS_INFO_MINIMUM_FOCUS_DISTANCE);
}
+ private List<String> getSupportedSavePaths(int cameraId) {
+ boolean writeable = SDCard.instance().isWriteable();
+ List<String> savePaths = new ArrayList<>();
+ savePaths.add("" + 0);
+ if (writeable) {
+ savePaths.add("" + 1);
+ }
+ return savePaths;
+ }
+
private List<String> getSupportedWhiteBalanceModes(int cameraId) {
try {
List<String> modes = new ArrayList<>();