summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--assets/dependency.json55
-rwxr-xr-xres/drawable-hdpi/bar_beautify_rectangle_blue.pngbin0 -> 177 bytes
-rwxr-xr-xres/drawable-hdpi/bar_beautify_rectangle_white.pngbin0 -> 213 bytes
-rwxr-xr-xres/drawable-hdpi/ic_beautify_oval.pngbin0 -> 699 bytes
-rwxr-xr-xres/drawable-mdpi/bar_beautify_rectangle_blue.pngbin0 -> 125 bytes
-rwxr-xr-xres/drawable-mdpi/bar_beautify_rectangle_white.pngbin0 -> 133 bytes
-rwxr-xr-xres/drawable-mdpi/ic_beautify_oval.pngbin0 -> 348 bytes
-rwxr-xr-xres/drawable/beautify_progressbar_style.xml35
-rwxr-xr-x[-rw-r--r--]res/layout/one_ui_layout.xml49
-rwxr-xr-x[-rw-r--r--]rs/rotator.rs20
-rw-r--r--[-rwxr-xr-x]src/com/android/camera/AndroidCameraManagerImpl.java26
-rw-r--r--src/com/android/camera/CameraSettings.java4
-rw-r--r--src/com/android/camera/CaptureModule.java8
-rwxr-xr-x[-rw-r--r--]src/com/android/camera/CaptureUI.java42
-rw-r--r--src/com/android/camera/PhotoModule.java11
-rw-r--r--src/com/android/camera/PhotoUI.java2
-rw-r--r--src/com/android/camera/RecordLocationPreference.java11
-rw-r--r--src/com/android/camera/VideoModule.java6
-rw-r--r--src/com/android/camera/VideoUI.java2
-rw-r--r--src/com/android/camera/WideAnglePanoramaModule.java3
-rwxr-xr-x[-rw-r--r--]src/com/android/camera/imageprocessor/FrameProcessor.java9
-rw-r--r--src/com/android/camera/ui/CameraControls.java1
-rwxr-xr-x[-rw-r--r--]src/com/android/camera/ui/CountDownView.java11
-rwxr-xr-x[-rw-r--r--]src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java2
24 files changed, 245 insertions, 52 deletions
diff --git a/assets/dependency.json b/assets/dependency.json
index b8c396895..6c8584cad 100644
--- a/assets/dependency.json
+++ b/assets/dependency.json
@@ -42,15 +42,66 @@
"100":
{"pref_camera2_longshot_key":"off",
"pref_camera2_mono_only_key":"off",
- "pref_camera2_flashmode_key":"off"}
+ "pref_camera2_flashmode_key":"off",
+ "pref_camera2_coloreffect_key":"0"}
,
"0":
{"pref_camera2_clearsight_key":"off",
"pref_camera2_mono_preview_key":"off",
"pref_camera2_mpo_key":"off"}
,
+ "18":
+ {"pref_camera2_coloreffect_key":"0"}
+ ,
+ "102":
+ {"pref_camera2_coloreffect_key":"0"}
+ ,
+ "101":
+ {"pref_camera2_coloreffect_key":"0"}
+ ,
+ "3":
+ {"pref_camera2_coloreffect_key":"0"}
+ ,
+ "4":
+ {"pref_camera2_coloreffect_key":"0"}
+ ,
+ "13":
+ {"pref_camera2_coloreffect_key":"0"}
+ ,
+ "15":
+ {"pref_camera2_coloreffect_key":"0"}
+ ,
+ "10":
+ {"pref_camera2_coloreffect_key":"0"}
+ ,
+ "5":
+ {"pref_camera2_coloreffect_key":"0"}
+ ,
+ "8":
+ {"pref_camera2_coloreffect_key":"0"}
+ ,
+ "9":
+ {"pref_camera2_coloreffect_key":"0"}
+ ,
+ "103":
+ {"pref_camera2_coloreffect_key":"0"}
+ ,
+ "106":
+ {"pref_camera2_coloreffect_key":"0"}
+ ,
+ "107":
+ {"pref_camera2_coloreffect_key":"0"}
+ ,
+ "108":
+ {"pref_camera2_coloreffect_key":"0"}
+ ,
+ "104":
+ {"pref_camera2_coloreffect_key":"0"}
+ ,
"105":
- {"pref_camera2_flashmode_key":"off"}
+ {"pref_camera2_flashmode_key":"off",
+ "pref_camera2_coloreffect_key":"0",
+ "pref_camera2_longshot_key":"off"}
},
"pref_camera2_clearsight_key":
{
diff --git a/res/drawable-hdpi/bar_beautify_rectangle_blue.png b/res/drawable-hdpi/bar_beautify_rectangle_blue.png
new file mode 100755
index 000000000..37b6cdafb
--- /dev/null
+++ b/res/drawable-hdpi/bar_beautify_rectangle_blue.png
Binary files differ
diff --git a/res/drawable-hdpi/bar_beautify_rectangle_white.png b/res/drawable-hdpi/bar_beautify_rectangle_white.png
new file mode 100755
index 000000000..06bc65042
--- /dev/null
+++ b/res/drawable-hdpi/bar_beautify_rectangle_white.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_beautify_oval.png b/res/drawable-hdpi/ic_beautify_oval.png
new file mode 100755
index 000000000..be86fdc03
--- /dev/null
+++ b/res/drawable-hdpi/ic_beautify_oval.png
Binary files differ
diff --git a/res/drawable-mdpi/bar_beautify_rectangle_blue.png b/res/drawable-mdpi/bar_beautify_rectangle_blue.png
new file mode 100755
index 000000000..454787c9c
--- /dev/null
+++ b/res/drawable-mdpi/bar_beautify_rectangle_blue.png
Binary files differ
diff --git a/res/drawable-mdpi/bar_beautify_rectangle_white.png b/res/drawable-mdpi/bar_beautify_rectangle_white.png
new file mode 100755
index 000000000..70b4c951f
--- /dev/null
+++ b/res/drawable-mdpi/bar_beautify_rectangle_white.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_beautify_oval.png b/res/drawable-mdpi/ic_beautify_oval.png
new file mode 100755
index 000000000..373a99a28
--- /dev/null
+++ b/res/drawable-mdpi/ic_beautify_oval.png
Binary files differ
diff --git a/res/drawable/beautify_progressbar_style.xml b/res/drawable/beautify_progressbar_style.xml
new file mode 100755
index 000000000..962d8dedb
--- /dev/null
+++ b/res/drawable/beautify_progressbar_style.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (c) 2016, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@android:id/background"
+ android:drawable="@drawable/bar_beautify_rectangle_white" />
+ <item android:id="@android:id/progress">
+ <clip android:drawable="@drawable/bar_beautify_rectangle_blue" />
+ </item>
+</layer-list> \ No newline at end of file
diff --git a/res/layout/one_ui_layout.xml b/res/layout/one_ui_layout.xml
index de6c8b401..d87040cde 100644..100755
--- a/res/layout/one_ui_layout.xml
+++ b/res/layout/one_ui_layout.xml
@@ -96,42 +96,53 @@
android:id="@+id/makeup_seekbar_layout"
android:visibility="gone">
<ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:paddingLeft="5dp"
- android:paddingRight="5dp"
+ android:layout_width="12dp"
+ android:layout_height="20dp"
+ android:layout_marginLeft="23dp"
+ android:layout_marginRight="23dp"
android:id="@+id/seekbar_toggle">
</ImageView>
<RelativeLayout
- android:layout_width="match_parent"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/seekbar_body">
<com.android.camera.ui.RotateLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_width="24dp"
+ android:layout_height="24dp"
android:layout_alignParentLeft="true"
android:id="@+id/makeup_low_text">
<TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/makeup_seekbar_low">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:textSize="12sp"
+ android:gravity="center"
+ android:text="@string/makeup_seekbar_low"
+ android:textColor="@android:color/white">
</TextView>
</com.android.camera.ui.RotateLayout>
<SeekBar
- android:layout_width="match_parent"
+ android:layout_width="220dp"
android:layout_height="wrap_content"
- android:paddingLeft="100dp"
- android:paddingRight="100dp"
+ android:maxHeight="3dip"
+ android:minHeight="1dip"
+ android:layout_marginLeft="10dp"
+ android:layout_toRightOf="@+id/makeup_low_text"
+ android:progressDrawable="@drawable/beautify_progressbar_style"
+ android:thumb="@drawable/ic_beautify_oval"
android:id="@+id/makeup_seekbar"/>
<com.android.camera.ui.RotateLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
+ android:layout_width="24dp"
+ android:layout_height="24dp"
+ android:layout_toRightOf="@+id/makeup_seekbar"
+ android:layout_marginLeft="10dp"
android:id="@+id/makeup_high_text">
<TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/makeup_seekbar_high">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:textSize="12sp"
+ android:gravity="center"
+ android:text="@string/makeup_seekbar_high"
+ android:textColor="@android:color/white">
</TextView>
</com.android.camera.ui.RotateLayout>
</RelativeLayout>
diff --git a/rs/rotator.rs b/rs/rotator.rs
index 5a27e00f7..2c57951d6 100644..100755
--- a/rs/rotator.rs
+++ b/rs/rotator.rs
@@ -35,32 +35,42 @@ rs_allocation gIn;
uint32_t width;
uint32_t height;
uint32_t pad;
-bool gFlip;
+uint32_t degree;
uchar __attribute__((kernel)) rotate90andMerge(uint32_t x, uint32_t y) {
uchar yValue = rsGetElementAt_uchar(gIn, x + y*width);
- if(gFlip) {
+ if(degree == 180) {
if(x >= width - pad)
return (uchar)0;
rsSetElementAt_uchar(gOut, yValue, (width-1-x-pad)*height + height - 1 - y);
- } else {
+ } else if (degree == 90) {
rsSetElementAt_uchar(gOut, yValue, x*height + height - 1 - y);
+ } else if (degree == 270) {
+ if(x >= width - pad)
+ return (uchar)0;
+ rsSetElementAt_uchar(gOut, yValue, (width-1-x-pad)*height + y);
}
+
if(x%2 == 0 && y%2 == 0) {
uint32_t ySize = width*height;
uint32_t index = ySize + x + ((y/2) * width);
uchar vValue = rsGetElementAt_uchar(gIn, index);
uchar uValue = rsGetElementAt_uchar(gIn, index + 1);
- if(gFlip) {
+ if(degree == 180) {
if(x >= width - pad)
return (uchar)0;
rsSetElementAt_uchar(gOut, uValue, ySize + (width-2-x-pad)/2*height + height - 1 - y);
rsSetElementAt_uchar(gOut, vValue, ySize + (width-2-x-pad)/2*height + height - 1 - y - 1);
- } else {
+ } else if (degree == 90) {
rsSetElementAt_uchar(gOut, uValue, ySize + x/2*height + height - 1 - y);
rsSetElementAt_uchar(gOut, vValue, ySize + x/2*height + height - 1 - y - 1);
+ } else if (degree == 270) {
+ if(x >= (width - pad))
+ return (uchar)0;
+ rsSetElementAt_uchar(gOut, uValue, ySize + (width-1-x-pad)/2*height + y -1);
+ rsSetElementAt_uchar(gOut, vValue, ySize + (width-1-x-pad)/2*height + y);
}
}
return (uchar)0;
diff --git a/src/com/android/camera/AndroidCameraManagerImpl.java b/src/com/android/camera/AndroidCameraManagerImpl.java
index 486629895..438be2e90 100755..100644
--- a/src/com/android/camera/AndroidCameraManagerImpl.java
+++ b/src/com/android/camera/AndroidCameraManagerImpl.java
@@ -200,6 +200,30 @@ class AndroidCameraManagerImpl implements CameraManager {
return true;
}
+ public boolean waitDone(long timeout) {
+ final Object waitDoneLock = new Object();
+ final Runnable unlockRunnable = new Runnable() {
+ @Override
+ public void run() {
+ synchronized (waitDoneLock) {
+ waitDoneLock.notifyAll();
+ }
+ }
+ };
+
+ synchronized (waitDoneLock) {
+ mCameraHandler.post(unlockRunnable);
+ try {
+ waitDoneLock.wait(timeout);
+ mCameraHandler.removeCallbacks(unlockRunnable);
+ } catch (InterruptedException ex) {
+ Log.v(TAG, "waitDone interrupted");
+ return false;
+ }
+ }
+ return true;
+ }
+
/**
* This method does not deal with the API level check. Everyone should
* check first for supported operations before sending message to this handler.
@@ -499,7 +523,7 @@ class AndroidCameraManagerImpl implements CameraManager {
@Override
public void stopPreview() {
mCameraHandler.sendEmptyMessage(STOP_PREVIEW);
- mCameraHandler.waitDone();
+ mCameraHandler.waitDone(200);
}
@Override
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java
index 069fb8701..97c4eae0a 100644
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -1027,6 +1027,10 @@ public class CameraSettings {
return;
}
+ if (numOfCameras > 2 ) {
+ numOfCameras = 2;
+ }
+
CharSequence[] entryValues = new CharSequence[numOfCameras];
for (int i = 0; i < numOfCameras; ++i) {
entryValues[i] = "" + i;
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index c45496c1f..2fe7de35c 100644
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -912,6 +912,9 @@ public class CaptureModule implements CameraModule, PhotoController,
@Override
public void onConfigureFailed(CameraCaptureSession cameraCaptureSession) {
Log.e(TAG, "cameracapturesession - onConfigureFailed "+id);
+ if (mActivity.isFinishing()) {
+ return;
+ }
new AlertDialog.Builder(mActivity)
.setTitle("Camera Initialization Failed")
.setMessage("Closing SnapdragonCamera")
@@ -1183,6 +1186,7 @@ public class CaptureModule implements CameraModule, PhotoController,
mCaptureSession[id].capture(builder.build(), mCaptureCallback, mCameraHandler);
setAFModeToPreview(id, mControlAFMode);
Message message = mCameraHandler.obtainMessage(CANCEL_TOUCH_FOCUS, mCameraId[id]);
+ message.arg1 = id;
mCameraHandler.sendMessageDelayed(message, CANCEL_TOUCH_FOCUS_DELAY);
} catch (CameraAccessException e) {
e.printStackTrace();
@@ -1258,10 +1262,12 @@ public class CaptureModule implements CameraModule, PhotoController,
Location location = mLocationManager.getCurrentLocation();
if(location != null) {
- Log.d(TAG, "captureStillPicture gps: " + location.toString());
+ // make copy so that we don't alter the saved location since we may re-use it
+ location = new Location(location);
// workaround for Google bug. Need to convert timestamp from ms -> sec
location.setTime(location.getTime()/1000);
captureBuilder.set(CaptureRequest.JPEG_GPS_LOCATION, location);
+ Log.d(TAG, "captureStillPicture gps: " + location.toString());
} else {
Log.d(TAG, "captureStillPicture no location - getRecordLocation: " + getRecordLocation());
}
diff --git a/src/com/android/camera/CaptureUI.java b/src/com/android/camera/CaptureUI.java
index ed11807da..b026af892 100644..100755
--- a/src/com/android/camera/CaptureUI.java
+++ b/src/com/android/camera/CaptureUI.java
@@ -77,6 +77,7 @@ import org.codeaurora.snapcam.R;
import java.util.List;
import java.util.Locale;
+import java.util.Map;
public class CaptureUI implements FocusOverlayManager.FocusUI,
PreviewGestures.SingleTapListener,
@@ -280,6 +281,7 @@ public class CaptureUI implements FocusOverlayManager.FocusUI,
@Override
public void onClick(View v) {
toggleMakeup();
+ updateMenus();
}
});
setMakeupButtonIcon();
@@ -375,8 +377,8 @@ public class CaptureUI implements FocusOverlayManager.FocusUI,
String value = mSettingsManager.getValue(SettingsManager.KEY_MAKEUP);
if(value != null && !mIsVideoUI) {
if(value.equals("0")) {
- mSettingsManager.setValue(SettingsManager.KEY_MAKEUP, "10");
- mMakeupSeekBar.setProgress(10);
+ mSettingsManager.setValue(SettingsManager.KEY_MAKEUP, "50");
+ mMakeupSeekBar.setProgress(50);
mMakeupSeekBarLayout.setVisibility(View.VISIBLE);
mSeekbarBody.setVisibility(View.VISIBLE);
mSeekbarToggleButton.setImageResource(R.drawable.seekbar_hide);
@@ -491,6 +493,7 @@ public class CaptureUI implements FocusOverlayManager.FocusUI,
mFilterLayout = null;
}
}
+ updateMenus();
}
public void openSettingsMenu() {
@@ -552,16 +555,26 @@ public class CaptureUI implements FocusOverlayManager.FocusUI,
String value = mSettingsManager.getValue(SettingsManager.KEY_COLOR_EFFECT);
if (value == null) return;
+ enableView(mFilterModeSwitcher, SettingsManager.KEY_COLOR_EFFECT);
+
mFilterModeSwitcher.setVisibility(View.VISIBLE);
mFilterModeSwitcher.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
addFilterMode();
adjustOrientation();
+ updateMenus();
}
});
}
+ private void enableView(View view, String key) {
+ Map<String, SettingsManager.Values> map = mSettingsManager.getValuesMap();
+ SettingsManager.Values values = map.get(key);
+ boolean enabled = values.overriddenValue == null;
+ view.setEnabled(enabled);
+ }
+
public void showTimeLapseUI(boolean enable) {
if (mTimeLapseLabel != null) {
mTimeLapseLabel.setVisibility(enable ? View.VISIBLE : View.GONE);
@@ -874,9 +887,28 @@ public class CaptureUI implements FocusOverlayManager.FocusUI,
public void cleanUpMenus() {
showUI();
+ updateMenus();
mActivity.setSystemBarsVisibility(false);
}
+ public void updateMenus() {
+ boolean enableMakeupMenu = true;
+ boolean enableFilterMenu = true;
+ boolean enableSceneMenu = true;
+ String makeupValue = mSettingsManager.getValue(SettingsManager.KEY_MAKEUP);
+ int colorEffect = mSettingsManager.getValueIndex(SettingsManager.KEY_COLOR_EFFECT);
+ if (makeupValue != null && !makeupValue.equals("0")) {
+ enableSceneMenu = false;
+ enableFilterMenu = false;
+ } else if (colorEffect != 0 || mFilterMenuStatus == FILTER_MENU_ON){
+ enableSceneMenu = false;
+ enableMakeupMenu = false;
+ }
+ mMakeupButton.setEnabled(enableMakeupMenu);
+ mFilterModeSwitcher.setEnabled(enableFilterMenu);
+ mSceneModeSwitcher.setEnabled(enableSceneMenu);
+ }
+
public boolean arePreviewControlsVisible() {
return !mUIhidden;
}
@@ -1305,6 +1337,12 @@ public class CaptureUI implements FocusOverlayManager.FocusUI,
@Override
public void onSettingsChanged(List<SettingsManager.SettingState> settings) {
+ for( SettingsManager.SettingState state : settings) {
+ if( state.key.equals(SettingsManager.KEY_COLOR_EFFECT) ) {
+ enableView(mFilterModeSwitcher, SettingsManager.KEY_COLOR_EFFECT);
+ break;
+ }
+ }
}
public void startSelfieFlash() {
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index cfdd8af12..884fe142e 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -629,7 +629,7 @@ public class PhotoModule
private void locationFirstRun() {
/* Do not prompt if the preference is already set, this is a secure
* camera session, or the prompt has already been triggered. */
- if (RecordLocationPreference.isSet(mPreferences) ||
+ if (RecordLocationPreference.isSet(mPreferences, CameraSettings.KEY_RECORD_LOCATION) ||
mActivity.isSecureCamera() || mLocationPromptTriggered) {
return;
}
@@ -912,7 +912,8 @@ public class PhotoModule
}
// Initialize location service.
- boolean recordLocation = RecordLocationPreference.get(mPreferences);
+ boolean recordLocation = RecordLocationPreference.get(mPreferences,
+ CameraSettings.KEY_RECORD_LOCATION);
mLocationManager.recordLocation(recordLocation);
mUI.initializeFirstTime();
@@ -943,7 +944,8 @@ public class PhotoModule
// onResume.
private void initializeSecondTime() {
// Start location update if needed.
- boolean recordLocation = RecordLocationPreference.get(mPreferences);
+ boolean recordLocation = RecordLocationPreference.get(mPreferences,
+ CameraSettings.KEY_RECORD_LOCATION);
mLocationManager.recordLocation(recordLocation);
MediaSaveService s = mActivity.getMediaSaveService();
if (s != null) {
@@ -4673,7 +4675,8 @@ public class PhotoModule
// ignore the events after "onPause()"
if (mPaused) return;
- boolean recordLocation = RecordLocationPreference.get(mPreferences);
+ boolean recordLocation = RecordLocationPreference.get(mPreferences,
+ CameraSettings.KEY_RECORD_LOCATION);
mLocationManager.recordLocation(recordLocation);
if(needRestart()){
Log.v(TAG, "Restarting Preview... Camera Mode Changed");
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index 250bfa603..442c65d94 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -728,7 +728,7 @@ public class PhotoUI implements PieListener,
// make sure the correct value was found
// otherwise use auto index
mOnScreenIndicators.updateWBIndicator(wbIndex < 0 ? 2 : wbIndex);
- boolean location = RecordLocationPreference.get(prefs);
+ boolean location = RecordLocationPreference.get(prefs, CameraSettings.KEY_RECORD_LOCATION);
mOnScreenIndicators.updateLocationIndicator(location);
}
diff --git a/src/com/android/camera/RecordLocationPreference.java b/src/com/android/camera/RecordLocationPreference.java
index b88f5e4ed..088ff663f 100644
--- a/src/com/android/camera/RecordLocationPreference.java
+++ b/src/com/android/camera/RecordLocationPreference.java
@@ -40,18 +40,17 @@ public class RecordLocationPreference extends IconListPreference {
@Override
public String getValue() {
- return get(getSharedPreferences()) ? VALUE_ON : VALUE_OFF;
+ return get(getSharedPreferences(), getKey()) ? VALUE_ON : VALUE_OFF;
}
- public static boolean get(SharedPreferences pref) {
- String value = pref.getString(
- CameraSettings.KEY_RECORD_LOCATION, VALUE_NONE);
+ public static boolean get(SharedPreferences pref, String key) {
+ String value = pref.getString(key, VALUE_NONE);
return VALUE_ON.equals(value);
}
- public static boolean isSet(SharedPreferences pref) {
+ public static boolean isSet(SharedPreferences pref, String key) {
String value = pref.getString(
- CameraSettings.KEY_RECORD_LOCATION, VALUE_NONE);
+ key, VALUE_NONE);
return !VALUE_NONE.equals(value);
}
}
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 21ad36fcf..e420addcb 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -1158,7 +1158,8 @@ public class VideoModule implements CameraModule,
mOrientationManager.resume();
// Initialize location service.
- boolean recordLocation = RecordLocationPreference.get(mPreferences);
+ boolean recordLocation = RecordLocationPreference.get(mPreferences,
+ CameraSettings.KEY_RECORD_LOCATION);
mLocationManager.recordLocation(recordLocation);
if (mPreviewing) {
@@ -2798,7 +2799,8 @@ public class VideoModule implements CameraModule,
// startPreview().
if (mCameraDevice == null) return;
- boolean recordLocation = RecordLocationPreference.get(mPreferences);
+ boolean recordLocation = RecordLocationPreference.get(mPreferences,
+ CameraSettings.KEY_RECORD_LOCATION);
mLocationManager.recordLocation(recordLocation);
readVideoPreferences();
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java
index c68d895ea..e853783a6 100644
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -721,7 +721,7 @@ public class VideoUI implements PieRenderer.PieListener,
public void updateOnScreenIndicators(Parameters param, ComboPreferences prefs) {
mOnScreenIndicators.updateFlashOnScreenIndicator(param.getFlashMode());
- boolean location = RecordLocationPreference.get(prefs);
+ boolean location = RecordLocationPreference.get(prefs, CameraSettings.KEY_RECORD_LOCATION);
mOnScreenIndicators.updateLocationIndicator(location);
}
diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java
index 7a3b114d1..2d4ec1419 100644
--- a/src/com/android/camera/WideAnglePanoramaModule.java
+++ b/src/com/android/camera/WideAnglePanoramaModule.java
@@ -1046,7 +1046,8 @@ public class WideAnglePanoramaModule
mOrientationManager.resume();
// Initialize location service.
- boolean recordLocation = RecordLocationPreference.get(mPreferences);
+ boolean recordLocation = RecordLocationPreference.get(mPreferences,
+ CameraSettings.KEY_RECORD_LOCATION);
mLocationManager.recordLocation(recordLocation);
mUI.initDisplayChangeListener();
UsageStatistics.onContentViewChanged(
diff --git a/src/com/android/camera/imageprocessor/FrameProcessor.java b/src/com/android/camera/imageprocessor/FrameProcessor.java
index a2ae18c1c..5dc50c4e5 100644..100755
--- a/src/com/android/camera/imageprocessor/FrameProcessor.java
+++ b/src/com/android/camera/imageprocessor/FrameProcessor.java
@@ -40,6 +40,7 @@ import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.RenderScript;
import android.renderscript.Type;
+import android.util.Log;
import android.util.Size;
import android.view.Surface;
import android.widget.Toast;
@@ -155,10 +156,12 @@ public class FrameProcessor {
mRsRotator.set_width(width);
mRsRotator.set_height(height);
mRsRotator.set_pad(stridePad);
- if(mModule.getMainCameraCharacteristics() != null &&
- mModule.getMainCameraCharacteristics().get(CameraCharacteristics.SENSOR_ORIENTATION) == 270) {
- mRsRotator.set_gFlip(true);
+ int degree = 90;
+ if(mModule.getMainCameraCharacteristics() != null) {
+ degree = mModule.getMainCameraCharacteristics().
+ get(CameraCharacteristics.SENSOR_ORIENTATION);
}
+ mRsRotator.set_degree(degree);
mRsYuvToRGB.set_gIn(mProcessAllocation);
mRsYuvToRGB.set_width(height);
mRsYuvToRGB.set_height(width);
diff --git a/src/com/android/camera/ui/CameraControls.java b/src/com/android/camera/ui/CameraControls.java
index 9039a9dce..b85d7f1ca 100644
--- a/src/com/android/camera/ui/CameraControls.java
+++ b/src/com/android/camera/ui/CameraControls.java
@@ -247,7 +247,6 @@ public class CameraControls extends RotatableLayout {
} else {
mHdrSwitcher.setEnabled(enable);
}
- mSceneModeSwitcher.setEnabled(enable);
mPreview.setEnabled(enable);
}
diff --git a/src/com/android/camera/ui/CountDownView.java b/src/com/android/camera/ui/CountDownView.java
index 6420fd2c3..7e1f28d52 100644..100755
--- a/src/com/android/camera/ui/CountDownView.java
+++ b/src/com/android/camera/ui/CountDownView.java
@@ -153,16 +153,21 @@ public class CountDownView extends FrameLayout {
public void setOrientation(int orientation) {
mRemainingSecondsView.setRotation(-orientation);
-
mCountDownTitle.setRotation(-orientation);
+ int width = getResources().getDisplayMetrics().widthPixels;
+ int height = mCountDownTitle.getMeasuredHeight();
+ if (height == 0) {
+ measure(MeasureSpec.UNSPECIFIED,MeasureSpec.UNSPECIFIED);
+ height = mCountDownTitle.getMeasuredHeight();
+ }
int dx = 0, dy = 0;
switch (orientation) {
case 90:
- dy = (mCountDownTitle.getWidth() - mCountDownTitle.getHeight()) / 2;
+ dy = (width - height) / 2;
dx = -dy;
break;
case 270:
- dx = dy = (mCountDownTitle.getWidth() - mCountDownTitle.getHeight()) / 2;
+ dx = dy = (width - height) / 2;
break;
case 180:
break;
diff --git a/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java b/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java
index 595df8122..f1a082f75 100644..100755
--- a/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java
+++ b/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java
@@ -1028,6 +1028,8 @@ public class ClearSightImageProcessor {
}, null);
} catch (CameraAccessException e) {
e.printStackTrace();
+ } catch (IllegalStateException e1) {
+ e1.printStackTrace();
}
}
}