summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bestas <mkbestas@lineageos.org>2020-03-11 20:22:40 +0200
committerMichael Bestas <mkbestas@lineageos.org>2020-03-11 20:22:56 +0200
commit6ac25e2ff58e3766d9e1e8bbc1553576a2402ed9 (patch)
tree79573649b1d7c3d308883c011e57b0525cc09a0c
parentea2dcc833be54e6d12ef2d15b5980884e729bbc2 (diff)
parentc09bffb2b864dfdea0be88bc85f528c1e80f103d (diff)
downloadandroid_packages_apps_Snap-6ac25e2ff58e3766d9e1e8bbc1553576a2402ed9.zip
android_packages_apps_Snap-6ac25e2ff58e3766d9e1e8bbc1553576a2402ed9.tar.gz
android_packages_apps_Snap-6ac25e2ff58e3766d9e1e8bbc1553576a2402ed9.tar.bz2
Merge tag 'LA.UM.8.1.r1-14300-sm8150.0' of https://source.codeaurora.org/quic/la/platform/packages/apps/SnapdragonCamera into lineage-17.1
"LA.UM.8.1.r1-14300-sm8150.0" Conflicts: src/com/android/camera/CameraHolder.java src/com/android/camera/CaptureModule.java Change-Id: Ifc0f89fcc36e8ce225cda91b1e6fe8c44e9bee29
-rwxr-xr-x[-rw-r--r--]AndroidManifest.xml4
-rwxr-xr-xres/layout/capture_module.xml13
-rwxr-xr-xsrc/com/android/camera/CameraActivity.java3
-rwxr-xr-xsrc/com/android/camera/CameraHolder.java5
-rwxr-xr-xsrc/com/android/camera/CaptureModule.java39
-rwxr-xr-xsrc/com/android/camera/CaptureUI.java3
-rwxr-xr-xsrc/com/android/camera/SettingsActivity.java46
-rwxr-xr-xsrc/com/android/camera/SettingsManager.java83
-rwxr-xr-xsrc/com/android/camera/imageprocessor/FrameProcessor.java15
-rwxr-xr-x[-rw-r--r--]src/com/android/camera/ui/FlashToggleButton.java15
-rwxr-xr-xsrc/com/android/camera/ui/OneUICameraControls.java1
-rwxr-xr-xversion.mk2
12 files changed, 188 insertions, 41 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 678a903..a2102c3 100644..100755
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -72,21 +72,25 @@
<intent-filter>
<action android:name="android.media.action.VIDEO_CAMERA" />
<category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.VOICE"/>
</intent-filter>
<intent-filter>
<action android:name="android.media.action.VIDEO_CAPTURE" />
<category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.VOICE"/>
</intent-filter>
<intent-filter>
<action android:name="android.media.action.IMAGE_CAPTURE" />
<category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.VOICE"/>
</intent-filter>
<intent-filter>
<action android:name="android.media.action.STILL_IMAGE_CAMERA" />
<category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.VOICE"/>
</intent-filter>
<meta-data
diff --git a/res/layout/capture_module.xml b/res/layout/capture_module.xml
index 8600ddd..7ebaee6 100755
--- a/res/layout/capture_module.xml
+++ b/res/layout/capture_module.xml
@@ -169,6 +169,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/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index f92f7b2..37ed7f1 100755
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -681,7 +681,8 @@ public class CameraActivity extends Activity
View decorView = getWindow().getDecorView();
int currentSystemUIVisibility = decorView.getSystemUiVisibility();
int systemUIVisibility = DEFAULT_SYSTEM_UI_VISIBILITY;
- int systemUINotVisible = View.SYSTEM_UI_FLAG_LOW_PROFILE | View.SYSTEM_UI_FLAG_FULLSCREEN;
+ int systemUINotVisible = View.SYSTEM_UI_FLAG_LOW_PROFILE | View.SYSTEM_UI_FLAG_FULLSCREEN |
+ View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
int newSystemUIVisibility = systemUIVisibility
| (visible ? View.SYSTEM_UI_FLAG_VISIBLE : systemUINotVisible);
diff --git a/src/com/android/camera/CameraHolder.java b/src/com/android/camera/CameraHolder.java
index 4daf843..8ecc672 100755
--- a/src/com/android/camera/CameraHolder.java
+++ b/src/com/android/camera/CameraHolder.java
@@ -24,6 +24,7 @@ import android.hardware.Camera.CameraInfo;
import android.hardware.Camera.Parameters;
import android.hardware.camera2.CameraAccessException;
import android.hardware.camera2.CameraCharacteristics;
+import android.hardware.camera2.CameraMetadata;
import android.os.Build;
import android.os.Handler;
import android.os.HandlerThread;
@@ -186,10 +187,10 @@ public class CameraHolder {
= manager.getCameraCharacteristics(cameraId);
Log.d(TAG,"cameraIdList size ="+cameraIdList.length);
int facing = characteristics.get(CameraCharacteristics.LENS_FACING);
- if (facing == CameraCharacteristics.LENS_FACING_FRONT) {
+ if (mFrontCameraId == -1 && facing == CameraCharacteristics.LENS_FACING_FRONT) {
CaptureModule.FRONT_ID = i;
mFrontCameraId = i;
- } else if (mBackCameraId != -1) {
+ } else if (mBackCameraId != -1 && facing == CameraMetadata.LENS_FACING_BACK) {
mBackCameraId = i;
}
addCameraInfo(i, characteristics);
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index 5cd9715..b0fe080 100755
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -839,6 +839,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);
}
}
};
@@ -1890,7 +1892,8 @@ public class CaptureModule implements CameraModule, PhotoController,
if (myExtras != null) {
mSaveUri = (Uri) myExtras.getParcelable(MediaStore.EXTRA_OUTPUT);
mCropValue = myExtras.getString("crop");
- mUseFrontCamera = myExtras.getBoolean("android.intent.extra.USE_FRONT_CAMERA", false);
+ mUseFrontCamera = myExtras.getBoolean("android.intent.extra.USE_FRONT_CAMERA", false) ||
+ myExtras.getBoolean("com.google.assistant.extra.USE_FRONT_CAMERA", false);
mTimer = myExtras.getInt("android.intent.extra.TIMER_DURATION_SECONDS", 0);
Log.d(TAG, "mUseFrontCamera :" + mUseFrontCamera + ", mTimer :" + mTimer);
}
@@ -2379,6 +2382,7 @@ public class CaptureModule implements CameraModule, PhotoController,
if (mLongshotActive) {
checkAndPlayShutterSound(getMainCameraId());
}
+ mLongshoting = false;
}
@Override
@@ -2404,6 +2408,7 @@ public class CaptureModule implements CameraModule, PhotoController,
CaptureRequest request,
CaptureFailure result) {
Log.d(TAG, "captureStillPictureForLongshot onCaptureFailed.");
+ mLongshoting = false;
}
@Override
@@ -2497,6 +2502,7 @@ public class CaptureModule implements CameraModule, PhotoController,
} else {
enableShutterAndVideoOnUiThread(id);
}
+ Log.d(TAG,"onShutterButtonRelease");
if (mSettingsManager.getSavePictureFormat() == SettingsManager.HEIF_FORMAT) {
if (mHeifImage != null) {
try {
@@ -2963,7 +2969,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");
}
}
@@ -3001,7 +3007,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);
@@ -3143,7 +3149,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();
@@ -3997,7 +4003,8 @@ public class CaptureModule implements CameraModule, PhotoController,
if (scene == null) return false;
int mode = Integer.parseInt(scene);
if (mode != CaptureRequest.CONTROL_SCENE_MODE_DISABLED
- && mode < SettingsManager.SCENE_MODE_CUSTOM_START)
+ && mode < SettingsManager.SCENE_MODE_CUSTOM_START
+ && mode != SettingsManager.SCENE_MODE_HDR_INT)
return true;
return false;
}
@@ -5048,17 +5055,16 @@ public class CaptureModule implements CameraModule, PhotoController,
applyVideoFlash(mVideoPausePreviewRequestBuilder);
CaptureRequest captureRequest = null;
try {
- if (mMediaRecorderPausing) {
- captureRequest = mVideoPausePreviewRequestBuilder.build();
- } else {
- captureRequest = mVideoRequestBuilder.build();
- }
+ captureRequest = mVideoRequestBuilder.build();
if (mCurrentSession instanceof CameraConstrainedHighSpeedCaptureSession) {
CameraConstrainedHighSpeedCaptureSession session =
(CameraConstrainedHighSpeedCaptureSession) mCurrentSession;
List requestList = session.createHighSpeedRequestList(captureRequest);
session.setRepeatingBurst(requestList, mCaptureCallback, mCameraHandler);
} else {
+ if (mMediaRecorderPausing) {
+ captureRequest = mVideoPausePreviewRequestBuilder.build();
+ }
mCurrentSession.setRepeatingRequest(captureRequest, mCaptureCallback,
mCameraHandler);
}
@@ -5186,7 +5192,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);
}
@@ -5508,12 +5520,12 @@ public class CaptureModule implements CameraModule, PhotoController,
if (mCaptureTimeLapse) {
size = CameraSettings.getTimeLapseQualityFor(size);
}
-
Bundle myExtras = intent.getExtras();
if (mMediaRecorder == null) mMediaRecorder = new MediaRecorder();
updateHFRSetting();
+ mHighSpeedCapture = mHighSpeedCapture && (myExtras == null); //MMS not support high speed
boolean hfr = mHighSpeedCapture && !mHighSpeedRecordingMode;
if (CamcorderProfile.hasProfile(cameraId, size)) {
@@ -5646,7 +5658,6 @@ public class CaptureModule implements CameraModule, PhotoController,
if (requestedSizeLimit > 0 && requestedSizeLimit < maxFileSize) {
maxFileSize = requestedSizeLimit;
}
-
if (Storage.isSaveSDCard() && maxFileSize > SDCARD_SIZE_LIMIT) {
maxFileSize = SDCARD_SIZE_LIMIT;
}
@@ -5709,6 +5720,7 @@ public class CaptureModule implements CameraModule, PhotoController,
+ mActivity.getStorageSpaceBytes());
return;
}
+ Log.d(TAG,"onShutterButtonClick");
if (mIsRecordingVideo) {
if (mUI.isShutterEnabled()) {
@@ -6090,6 +6102,7 @@ public class CaptureModule implements CameraModule, PhotoController,
int colorTempValue = Integer.parseInt(pref.getString(
SettingsManager.KEY_MANUAL_WB_TEMPERATURE_VALUE, "-1"));
if (colorTempValue != -1) {
+ request.set(CaptureRequest.CONTROL_AWB_MODE, CaptureRequest.CONTROL_AWB_MODE_OFF);
VendorTagUtil.setWbColorTemperatureValue(request, colorTempValue);
}
} else if (manualWBMode.equals(gainMode)) {
diff --git a/src/com/android/camera/CaptureUI.java b/src/com/android/camera/CaptureUI.java
index ef0e5fd..51138a2 100755
--- a/src/com/android/camera/CaptureUI.java
+++ b/src/com/android/camera/CaptureUI.java
@@ -688,6 +688,9 @@ public class CaptureUI implements PreviewGestures.SingleTapListener,
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 cdfb9d6..a06dc5c 100755
--- a/src/com/android/camera/SettingsActivity.java
+++ b/src/com/android/camera/SettingsActivity.java
@@ -115,7 +115,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;
@@ -143,13 +146,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_DIS) ||
+ pref.getKey().equals(SettingsManager.KEY_EIS_VALUE)) {
+ 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
@@ -169,6 +186,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();
@@ -783,14 +823,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 febba2b..5b4bb8c 100755
--- a/src/com/android/camera/SettingsManager.java
+++ b/src/com/android/camera/SettingsManager.java
@@ -1243,6 +1243,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);
@@ -1691,10 +1712,26 @@ public class SettingsManager implements ListMenu.SettingsListener {
res.add(getSupportedQcfaDimension(cameraId));
}
+ VideoCapabilities heifCap = null;
+ if (isHeifEnabled) {
+ MediaCodecList list = new MediaCodecList(MediaCodecList.REGULAR_CODECS);
+ for (MediaCodecInfo info :list.getCodecInfos()) {
+ if (info.isEncoder() && info.getName().contains("heic")){
+ heifCap = info.getCapabilitiesForType(
+ MediaFormat.MIMETYPE_IMAGE_ANDROID_HEIC).getVideoCapabilities();
+ Log.d(TAG,"supported heif height range ="+heifCap.getSupportedHeights().toString() +
+ " width range ="+heifCap.getSupportedWidths().toString());
+ }
+ }
+ }
+
if (sizes != null) {
for (int i = 0; i < sizes.length; i++) {
- if (isHeifEnabled && (Math.min(sizes[i].getWidth(),sizes[i].getHeight()) < 512)) {
- continue;
+ if (isHeifEnabled && heifCap != null ){
+ if (!heifCap.getSupportedWidths().contains(sizes[i].getWidth()) ||
+ !heifCap.getSupportedHeights().contains(sizes[i].getHeight())){
+ continue;
+ }
}
if (isDeepportrait &&
(Math.min(sizes[i].getWidth(),sizes[i].getHeight()) < 720 ||
@@ -1707,8 +1744,15 @@ public class SettingsManager implements ListMenu.SettingsListener {
}
Size[] highResSizes = map.getHighResolutionOutputSizes(ImageFormat.JPEG);
+
if (highResSizes != null) {
for (int i = 0; i < highResSizes.length; i++) {
+ if (isHeifEnabled && heifCap != null) {
+ if (!heifCap.getSupportedWidths().contains(highResSizes[i].getWidth()) ||
+ !heifCap.getSupportedHeights().contains(highResSizes[i].getHeight())){
+ continue;
+ }
+ }
res.add(highResSizes[i].toString());
}
}
@@ -1730,18 +1774,46 @@ public class SettingsManager implements ListMenu.SettingsListener {
public Size[] getSupportedOutputSize(int cameraId, Class cl) {
StreamConfigurationMap map = mCharacteristics.get(cameraId).get(
CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
- return map.getOutputSizes(cl);
+ Size[] normal = map.getOutputSizes(cl);
+ Size[] high = map.getHighResolutionOutputSizes(ImageFormat.PRIVATE);
+ Size[] ret = new Size[normal.length+high.length];
+ System.arraycopy(normal,0,ret,0,normal.length);
+ System.arraycopy(high,0,ret,normal.length,high.length);
+ return ret;
}
private List<String> getSupportedVideoSize(int cameraId) {
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) {
+ MediaCodecList list = new MediaCodecList(MediaCodecList.REGULAR_CODECS);
+ for (MediaCodecInfo info :list.getCodecInfos()) {
+ if (info.isEncoder() && info.getName().contains("heic")){
+ heifCap = info.getCapabilitiesForType(
+ MediaFormat.MIMETYPE_IMAGE_ANDROID_HEIC).getVideoCapabilities();
+ Log.d(TAG,"supported heif height range ="+heifCap.getSupportedHeights().toString() +
+ " width range ="+heifCap.getSupportedWidths().toString());
+ }
+ }
+ }
List<String> res = new ArrayList<>();
for (int i = 0; i < sizes.length; i++) {
- if (isHeifEnabled && (Math.min(sizes[i].getWidth(),sizes[i].getHeight()) < 512)) {
- continue;
+ if (isHeifEnabled && heifCap != null ){
+ if (!heifCap.getSupportedWidths().contains(sizes[i].getWidth()) ||
+ !heifCap.getSupportedHeights().contains(sizes[i].getHeight())){
+ 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());
@@ -1956,6 +2028,7 @@ public class SettingsManager implements ListMenu.SettingsListener {
}
}
}
+
return supported;
}
diff --git a/src/com/android/camera/imageprocessor/FrameProcessor.java b/src/com/android/camera/imageprocessor/FrameProcessor.java
index 6397229..cd1a5f8 100755
--- a/src/com/android/camera/imageprocessor/FrameProcessor.java
+++ b/src/com/android/camera/imageprocessor/FrameProcessor.java
@@ -81,8 +81,6 @@ public class FrameProcessor {
private ListeningTask mListeningTask;
private RenderScript mRs;
private Activity mActivity;
- ScriptC_YuvToRgb mRsYuvToRGB;
- ScriptC_rotator mRsRotator;
private Size mSize;
private Object mAllocationLock = new Object();
private boolean mIsAllocationEverUsed;
@@ -108,8 +106,6 @@ public class FrameProcessor {
mFinalFilters = new ArrayList<ImageFilter>();
mRs = RenderScript.create(mActivity);
- mRsYuvToRGB = new ScriptC_YuvToRgb(mRs);
- mRsRotator = new ScriptC_rotator(mRs);
}
private void init(Size previewDim) {
@@ -158,11 +154,6 @@ public class FrameProcessor {
Type.Builder nv21TypeBuilder = new Type.Builder(mRs, Element.U8(mRs));
nv21TypeBuilder.setX(width * height * 3 / 2);
mProcessAllocation = Allocation.createTyped(mRs, nv21TypeBuilder.create(), Allocation.USAGE_SCRIPT);
- mRsRotator.set_gIn(mInputAllocation);
- mRsRotator.set_gOut(mProcessAllocation);
- mRsRotator.set_width(width);
- mRsRotator.set_height(height);
- mRsRotator.set_pad(stridePad);
int degree = 90;
if(mModule.getMainCameraCharacteristics() != null) {
degree = mModule.getMainCameraCharacteristics().
@@ -171,10 +162,6 @@ public class FrameProcessor {
degree = Math.abs(degree - 90);
}
}
- mRsRotator.set_degree(degree);
- mRsYuvToRGB.set_gIn(mProcessAllocation);
- mRsYuvToRGB.set_width(height);
- mRsYuvToRGB.set_height(width);
}
public ArrayList<ImageFilter> getFrameFilters() {
@@ -491,8 +478,6 @@ public class FrameProcessor {
createAllocation(stride, height, stride - width);
}
mInputAllocation.copyFrom(yvuBytes);
- mRsRotator.forEach_rotate90andMerge(mInputAllocation);
- mRsYuvToRGB.forEach_nv21ToRgb(mOutputAllocation);
mOutputAllocation.ioSend();
if (mVideoOutputAllocation != null) {
mVideoOutputAllocation.copyFrom(mOutputAllocation);
diff --git a/src/com/android/camera/ui/FlashToggleButton.java b/src/com/android/camera/ui/FlashToggleButton.java
index fa766bf..abeedef 100644..100755
--- a/src/com/android/camera/ui/FlashToggleButton.java
+++ b/src/com/android/camera/ui/FlashToggleButton.java
@@ -71,8 +71,21 @@ public class FlashToggleButton extends RotateImageView {
String userSetting = mContext.getString(
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);
+ if (mode == SettingsManager.SCENE_MODE_PROMODE_INT) {
+ promode = true;
+ }
+ }
if (mIndex == -1 || (redeye != null && redeye.equals("on")) ||
- manualExposureMode.equals(userSetting)) {
+ manualExposureMode.equals(userSetting) || promode || mfnrEnable) {
setVisibility(GONE);
return;
} else {
diff --git a/src/com/android/camera/ui/OneUICameraControls.java b/src/com/android/camera/ui/OneUICameraControls.java
index 994c108..9ede510 100755
--- a/src/com/android/camera/ui/OneUICameraControls.java
+++ b/src/com/android/camera/ui/OneUICameraControls.java
@@ -593,6 +593,7 @@ public class OneUICameraControls extends RotatableLayout {
mProModeCloseButton.setVisibility(INVISIBLE);
return;
}
+ setProModeParameters();
mProModeLayout.setVisibility(VISIBLE);
mProModeCloseButton.setVisibility(VISIBLE);
mProModeLayout.setY(mHeight - mBottom - mProModeLayout.getHeight());
diff --git a/version.mk b/version.mk
index e64719d..72d4ffb 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 := 033
+base_version_build := 037
#####################################################
#####################################################