summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xres/layout/capture_module.xml13
-rwxr-xr-xsrc/com/android/camera/CaptureModule.java20
-rwxr-xr-xsrc/com/android/camera/CaptureUI.java3
-rwxr-xr-xsrc/com/android/camera/SettingsActivity.java46
-rwxr-xr-xsrc/com/android/camera/SettingsManager.java48
-rwxr-xr-xsrc/com/android/camera/ui/FlashToggleButton.java7
-rwxr-xr-xversion.mk2
7 files changed, 108 insertions, 31 deletions
diff --git a/res/layout/capture_module.xml b/res/layout/capture_module.xml
index afc1995..2319b97 100755
--- a/res/layout/capture_module.xml
+++ b/res/layout/capture_module.xml
@@ -166,6 +166,19 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
+ <TextView
+ android:id="@+id/zoom_switch"
+ android:layout_width="1dp"
+ android:layout_height="1dp"
+ android:layout_gravity="center_vertical|right"
+ android:layout_marginRight="20dp"
+ android:text="1x"
+ android:textColor="@android:color/transparent"
+ android:alpha="0.7"
+ android:gravity="center"
+ android:clickable="true"
+ android:background="#00000000"
+ android:textSize="12sp"/>
<FrameLayout
android:layout_width="match_parent"
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index 6d85ca3..d8a5b75 100755
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -833,6 +833,8 @@ public class CaptureModule implements CameraModule, PhotoController,
SettingsManager.KEY_STATS_VISUALIZER_VALUE);
if (stats_visualizer != null) {
updateStatsView(stats_visualizer,result);
+ } else {
+ mUI.updateAWBInfoVisibility(View.GONE);
}
}
};
@@ -2375,6 +2377,7 @@ public class CaptureModule implements CameraModule, PhotoController,
}
});
}
+ mLongshoting = false;
}
@Override
@@ -2408,6 +2411,7 @@ public class CaptureModule implements CameraModule, PhotoController,
}
});
}
+ mLongshoting = false;
}
@Override
@@ -2501,6 +2505,7 @@ public class CaptureModule implements CameraModule, PhotoController,
} else {
enableShutterAndVideoOnUiThread(id);
}
+ Log.d(TAG,"onShutterButtonRelease");
if (mSettingsManager.getSavePictureFormat() == SettingsManager.HEIF_FORMAT) {
if (mHeifImage != null) {
try {
@@ -2938,7 +2943,7 @@ public class CaptureModule implements CameraModule, PhotoController,
CaptureRequest.CONTROL_AF_MODE_OFF : afMode);
mTakingPicture[id] = false;
enableShutterAndVideoOnUiThread(id);
- } catch (NullPointerException | IllegalStateException | CameraAccessException e) {
+ } catch (NullPointerException | IllegalStateException | CameraAccessException | IllegalArgumentException e) {
Log.w(TAG, "Session is already closed");
}
}
@@ -2976,7 +2981,7 @@ public class CaptureModule implements CameraModule, PhotoController,
}
}
- private boolean isMFNREnabled() {
+ public boolean isMFNREnabled() {
boolean mfnrEnable = false;
if (mSettingsManager != null) {
String mfnrValue = mSettingsManager.getValue(SettingsManager.KEY_CAPTURE_MFNR_VALUE);
@@ -3118,7 +3123,7 @@ public class CaptureModule implements CameraModule, PhotoController,
} catch (InterruptedException e) {
mCameraOpenCloseLock.release();
throw new RuntimeException("Interrupted while trying to lock camera closing.", e);
- } catch (CameraAccessException e) {
+ } catch (CameraAccessException | IllegalStateException e) {
e.printStackTrace();
} finally {
mCameraOpenCloseLock.release();
@@ -5179,7 +5184,13 @@ public class CaptureModule implements CameraModule, PhotoController,
boolean noNeedEndOfStreamInHFR = mHighSpeedCapture &&
((int)mHighSpeedFPSRange.getUpper() >= HIGH_SESSION_MAX_FPS);
if (noNeedEndofStreamWhenPause || noNeedEndOfStreamInHFR) {
- mMediaRecorder.pause();
+ try{
+ mMediaRecorder.pause();
+ } catch (IllegalStateException e){
+ e.printStackTrace();
+ mMediaRecorderPausing = false;
+ }
+
} else {
setEndOfStream(false, false);
}
@@ -5701,6 +5712,7 @@ public class CaptureModule implements CameraModule, PhotoController,
+ mActivity.getStorageSpaceBytes());
return;
}
+ Log.d(TAG,"onShutterButtonClick");
if (mIsRecordingVideo) {
if (mUI.isShutterEnabled()) {
diff --git a/src/com/android/camera/CaptureUI.java b/src/com/android/camera/CaptureUI.java
index dcfd74b..fc6ebe3 100755
--- a/src/com/android/camera/CaptureUI.java
+++ b/src/com/android/camera/CaptureUI.java
@@ -689,6 +689,9 @@ public class CaptureUI implements FocusOverlayManager.FocusUI,
mSurfaceViewMono.setVisibility(View.GONE);
}
}
+ if(mModule.isMFNREnabled() && mModule.getMainCameraId() == android.hardware.Camera.CameraInfo.CAMERA_FACING_FRONT){
+ mFilterModeSwitcher.setVisibility(View.INVISIBLE);
+ }
}
public void initializeProMode(boolean promode) {
diff --git a/src/com/android/camera/SettingsActivity.java b/src/com/android/camera/SettingsActivity.java
index 3fef924..dc7ddd6 100755
--- a/src/com/android/camera/SettingsActivity.java
+++ b/src/com/android/camera/SettingsActivity.java
@@ -128,7 +128,10 @@ public class SettingsActivity extends PreferenceActivity {
Map<String, SettingsManager.Values> map = mSettingsManager.getValuesMap();
for( SettingsManager.SettingState state : settings) {
SettingsManager.Values values = map.get(state.key);
- boolean enabled = values.overriddenValue == null;
+ boolean enabled = false;
+ if (values != null) {
+ enabled = values.overriddenValue == null;
+ }
Preference pref = findPreference(state.key);
if ( pref == null ) return;
@@ -156,19 +159,27 @@ public class SettingsActivity extends PreferenceActivity {
pref, "Off", "0");
}
+ if ((pref.getKey().equals(SettingsManager.KEY_ZSL) ||
+ pref.getKey().equals(SettingsManager.KEY_PICTURE_FORMAT)) ||
+ pref.getKey().equals(SettingsManager.KEY_SELFIEMIRROR)) {
+ updateFormatPreference();
+ }
+
if ( (pref.getKey().equals(SettingsManager.KEY_MANUAL_WB)) ) {
updateManualWBSettings();
}
- if (pref.getKey().equals(SettingsManager.KEY_VIDEO_QUALITY) ||
- pref.getKey().equals(SettingsManager.KEY_DIS) ||
+ if (pref.getKey().equals(SettingsManager.KEY_DIS) ||
pref.getKey().equals(SettingsManager.KEY_EIS_VALUE)) {
- updatePreference(SettingsManager.KEY_VIDEO_ENCODER);
+ mSettingsManager.filterEISVideQualityOptions();
+ updatePreference(SettingsManager.KEY_VIDEO_QUALITY);
}
+
}
}
};
+
/**
* This method is to enable or disable the option which is conflict with changed setting
* @param conflictKey key you want to change after setting is changed
@@ -188,6 +199,29 @@ public class SettingsActivity extends PreferenceActivity {
}
}
+ private void updateFormatPreference() {
+ ListPreference formatPref = (ListPreference)findPreference(SettingsManager.KEY_PICTURE_FORMAT);
+ ListPreference ZSLPref = (ListPreference) findPreference(SettingsManager.KEY_ZSL);
+ ListPreference mfnrPref = (ListPreference) findPreference(SettingsManager.KEY_CAPTURE_MFNR_VALUE);
+ SwitchPreference selfiePref = (SwitchPreference) findPreference(SettingsManager.KEY_SELFIEMIRROR);
+ if (formatPref == null) {
+ return;
+ }
+ if((ZSLPref != null && "app-zsl".equals(ZSLPref.getValue())) ||
+ (selfiePref != null && selfiePref.isChecked())){
+ formatPref.setValue("0");
+ formatPref.setEnabled(false);
+ if (mfnrPref != null) {
+ mfnrPref.setEnabled(false);
+ }
+ } else {
+ formatPref.setEnabled(true);
+ if (mfnrPref != null) {
+ mfnrPref.setEnabled(true);
+ }
+ }
+ }
+
private void UpdateManualExposureSettings() {
//dismiss all popups first, because we need to show edit dialog
int cameraId = mSettingsManager.getCurrentCameraId();
@@ -804,14 +838,14 @@ public class SettingsActivity extends PreferenceActivity {
pref.setEntries(mSettingsManager.getEntries(key));
pref.setEntryValues(mSettingsManager.getEntryValues(key));
String values = mSettingsManager.getValue(key);
+ Set<String> valueSet = new HashSet<String>();
if (values != null) {
- Set<String> valueSet = new HashSet<String>();
String[] splitValues = values.split(";");
for (String str : splitValues) {
valueSet.add(str);
}
- pref.setValues(valueSet);
}
+ pref.setValues(valueSet);
}
}
}
diff --git a/src/com/android/camera/SettingsManager.java b/src/com/android/camera/SettingsManager.java
index 532eae8..8e55459 100755
--- a/src/com/android/camera/SettingsManager.java
+++ b/src/com/android/camera/SettingsManager.java
@@ -1091,9 +1091,6 @@ public class SettingsManager implements ListMenu.SettingsListener {
filterVideoEncoderProfileOptions();
} else if (pref.getKey().equals(KEY_PICTURE_FORMAT)) {
filterHeifSizeOptions();
- } else if (pref.getKey().equals(KEY_DIS) ||
- pref.getKey().equals(KEY_EIS_VALUE)) {
- filterVideoEncoderOptions();
}
}
@@ -1264,6 +1261,27 @@ public class SettingsManager implements ListMenu.SettingsListener {
}
}
+ private boolean getEISEnabled() {
+ boolean result = false;
+ ListPreference disPref = mPreferenceGroup.findPreference(KEY_DIS);
+ ListPreference eisPref = mPreferenceGroup.findPreference(KEY_EIS_VALUE);
+ if (disPref != null && eisPref != null) {
+ result = ("on".equals(disPref.getValue()) &&
+ !("disable".equals(eisPref.getValue())));
+ }
+ return result;
+ }
+
+ public void filterEISVideQualityOptions() {
+ ListPreference videoQualityPref = mPreferenceGroup.findPreference(KEY_VIDEO_QUALITY);
+ if (videoQualityPref == null) return;
+ videoQualityPref.reloadInitialEntriesAndEntryValues();
+ if (filterUnsupportedOptions(videoQualityPref, getSupportedVideoSize(
+ getCurrentCameraId()))) {
+ mFilteredKeys.add(videoQualityPref.getKey());
+ }
+ }
+
private void filterChromaflashPictureSizeOptions() {
String scene = getValue(SettingsManager.KEY_SCENE_MODE);
ListPreference picturePref = mPreferenceGroup.findPreference(KEY_PICTURE_SIZE);
@@ -1765,6 +1783,7 @@ public class SettingsManager implements ListMenu.SettingsListener {
StreamConfigurationMap map = mCharacteristics.get(cameraId).get(
CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
Size[] sizes = map.getOutputSizes(MediaRecorder.class);
+ boolean eisEnabled = getEISEnabled();
boolean isHeifEnabled = getSavePictureFormat() == HEIF_FORMAT;
VideoCapabilities heifCap = null;
if (isHeifEnabled) {
@@ -1786,6 +1805,13 @@ public class SettingsManager implements ListMenu.SettingsListener {
continue;
}
}
+ if (eisEnabled) {
+ // eis didn`t support less than 720P
+ if (Math.min(sizes[i].getWidth(),sizes[i].getHeight()) < 720 ||
+ Math.max(sizes[i].getWidth(),sizes[i].getHeight()) < 1280) {
+ continue;
+ }
+ }
if (CameraSettings.VIDEO_QUALITY_TABLE.containsKey(sizes[i].toString())) {
Integer profile = CameraSettings.VIDEO_QUALITY_TABLE.get(sizes[i].toString());
if (profile != null) {
@@ -1988,22 +2014,6 @@ public class SettingsManager implements ListMenu.SettingsListener {
}
}
- ListPreference videoQuality = mPreferenceGroup.findPreference(KEY_VIDEO_QUALITY);
- String videoSize = videoQuality.getValue();
- int indexX = videoSize.indexOf('x');
- int width = Integer.parseInt(videoSize.substring(0, indexX));
- int height = Integer.parseInt(videoSize.substring(indexX + 1));
- // Video quality less than 720P
- boolean isLess720P = width < 1280 && height < 720;
-
- ListPreference disPref = mPreferenceGroup.findPreference(KEY_DIS);
- ListPreference eisPref = mPreferenceGroup.findPreference(KEY_EIS_VALUE);
- if (isLess720P &&
- "on".equals(disPref.getValue()) &&
- !("disable".equals(eisPref.getValue()))) {
- supported.remove("mpeg-4-sp");
- }
-
return supported;
}
diff --git a/src/com/android/camera/ui/FlashToggleButton.java b/src/com/android/camera/ui/FlashToggleButton.java
index fca76b7..abeedef 100755
--- a/src/com/android/camera/ui/FlashToggleButton.java
+++ b/src/com/android/camera/ui/FlashToggleButton.java
@@ -72,6 +72,11 @@ public class FlashToggleButton extends RotateImageView {
R.string.pref_camera_manual_exp_value_user_setting);
String manualExposureMode = mSettingsManager.getValue(SettingsManager.KEY_MANUAL_EXPOSURE);
String scene = mSettingsManager.getValue(SettingsManager.KEY_SCENE_MODE);
+ boolean mfnrEnable = false;
+ String mfnrValue = mSettingsManager.getValue(SettingsManager.KEY_CAPTURE_MFNR_VALUE);
+ if (mfnrValue != null) {
+ mfnrEnable = mfnrValue.equals("1");
+ }
boolean promode = false;
if (scene != null) {
int mode = Integer.parseInt(scene);
@@ -80,7 +85,7 @@ public class FlashToggleButton extends RotateImageView {
}
}
if (mIndex == -1 || (redeye != null && redeye.equals("on")) ||
- manualExposureMode.equals(userSetting) || promode) {
+ manualExposureMode.equals(userSetting) || promode || mfnrEnable) {
setVisibility(GONE);
return;
} else {
diff --git a/version.mk b/version.mk
index 548001e..7ec39db 100755
--- a/version.mk
+++ b/version.mk
@@ -40,7 +40,7 @@
# base_version_build is 3 digits and auto-increment for fixing CR.
base_version_major := 2
base_version_minor := 02
-base_version_build := 035
+base_version_build := 036
#####################################################
#####################################################