Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cf5b13cc authored by Mark Harman's avatar Mark Harman
Browse files

Add vendor extension auto.

parent 82983750
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -5434,6 +5434,9 @@ public class MainActivity extends AppCompatActivity {
            case Panorama:
                photo_mode_string = getResources().getString(R.string.photo_mode_panorama_full);
                break;
            case X_Auto:
                photo_mode_string = getResources().getString(R.string.photo_mode_x_auto_full);
                break;
            case X_HDR:
                photo_mode_string = getResources().getString(R.string.photo_mode_x_hdr_full);
                break;
+9 −2
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ public class MyApplicationInterface extends BasicApplicationInterface {
        NoiseReduction,
        Panorama,
        // camera vendor extensions:
        X_Auto,
        X_HDR,
        X_Night,
        X_Bokeh,
@@ -1551,14 +1552,17 @@ public class MyApplicationInterface extends BasicApplicationInterface {
    @Override
    public boolean isCameraExtensionPref() {
        PhotoMode photo_mode = getPhotoMode();
        return photo_mode == PhotoMode.X_HDR || photo_mode == PhotoMode.X_Night || photo_mode == PhotoMode.X_Bokeh || photo_mode == PhotoMode.X_Beauty;
        return photo_mode == PhotoMode.X_Auto || photo_mode == PhotoMode.X_HDR || photo_mode == PhotoMode.X_Night || photo_mode == PhotoMode.X_Bokeh || photo_mode == PhotoMode.X_Beauty;
    }

    @Override
    @RequiresApi(api = Build.VERSION_CODES.S)
    public int getCameraExtensionPref() {
        PhotoMode photo_mode = getPhotoMode();
        if( photo_mode == PhotoMode.X_HDR ) {
        if( photo_mode == PhotoMode.X_Auto ) {
            return CameraExtensionCharacteristics.EXTENSION_AUTOMATIC;
        }
        else if( photo_mode == PhotoMode.X_HDR ) {
            return CameraExtensionCharacteristics.EXTENSION_HDR;
        }
        else if( photo_mode == PhotoMode.X_Night ) {
@@ -1688,6 +1692,9 @@ public class MyApplicationInterface extends BasicApplicationInterface {
        boolean panorama = photo_mode_pref.equals("preference_photo_mode_panorama");
        if( panorama && !main_activity.getPreview().isVideo() && main_activity.supportsPanorama() )
            return PhotoMode.Panorama;
        boolean x_auto = photo_mode_pref.equals("preference_photo_mode_x_auto");
        if( x_auto && !main_activity.getPreview().isVideo() && main_activity.supportsCameraExtension(CameraExtensionCharacteristics.EXTENSION_AUTOMATIC) )
            return PhotoMode.X_Auto;
        boolean x_hdr = photo_mode_pref.equals("preference_photo_mode_x_hdr");
        if( x_hdr && !main_activity.getPreview().isVideo() && main_activity.supportsCameraExtension(CameraExtensionCharacteristics.EXTENSION_HDR) )
            return PhotoMode.X_HDR;
+10 −0
Original line number Diff line number Diff line
@@ -220,6 +220,10 @@ public class PopupView extends LinearLayout {
                photo_modes.add( getResources().getString(use_expanded_menu ? R.string.photo_mode_focus_bracketing_full : R.string.photo_mode_focus_bracketing) );
                photo_mode_values.add( MyApplicationInterface.PhotoMode.FocusBracketing );
            }
            if( main_activity.supportsCameraExtension(CameraExtensionCharacteristics.EXTENSION_AUTOMATIC) ) {
                photo_modes.add( getResources().getString(use_expanded_menu ? R.string.photo_mode_x_auto_full : R.string.photo_mode_x_auto) );
                photo_mode_values.add( MyApplicationInterface.PhotoMode.X_Auto );
            }
            if( main_activity.supportsCameraExtension(CameraExtensionCharacteristics.EXTENSION_HDR) ) {
                photo_modes.add( getResources().getString(use_expanded_menu ? R.string.photo_mode_x_hdr_full : R.string.photo_mode_x_hdr) );
                photo_mode_values.add( MyApplicationInterface.PhotoMode.X_HDR );
@@ -1131,6 +1135,9 @@ public class PopupView extends LinearLayout {
                case Panorama:
                    toast_message = getResources().getString(R.string.photo_mode_panorama_full);
                    break;
                case X_Auto:
                    toast_message = getResources().getString(R.string.photo_mode_x_auto_full);
                    break;
                case X_HDR:
                    toast_message = getResources().getString(R.string.photo_mode_x_hdr_full);
                    break;
@@ -1171,6 +1178,9 @@ public class PopupView extends LinearLayout {
                case Panorama:
                    editor.putString(PreferenceKeys.PhotoModePreferenceKey, "preference_photo_mode_panorama");
                    break;
                case X_Auto:
                    editor.putString(PreferenceKeys.PhotoModePreferenceKey, "preference_photo_mode_x_auto");
                    break;
                case X_HDR:
                    editor.putString(PreferenceKeys.PhotoModePreferenceKey, "preference_photo_mode_x_hdr");
                    break;
+2 −0
Original line number Diff line number Diff line
@@ -996,6 +996,8 @@
    <string name="permission_rationale_bluetooth_scan_connect">Bluetooth scan/connect permissions are required for discovering and connecting to Bluetooth LE remote control devices.</string>
    <string name="unknown_device_no_permission">Unknown device (bluetooth connect permission not available)</string>

    <string name="photo_mode_x_auto">X-Auto</string> <!-- keep short, as this shows in the popup menu -->
    <string name="photo_mode_x_auto_full">Extension: Auto</string>
    <string name="photo_mode_x_hdr">X-HDR</string> <!-- keep short, as this shows in the popup menu -->
    <string name="photo_mode_x_hdr_full">Extension: HDR</string>
    <string name="photo_mode_x_night">X-Night</string> <!-- keep short, as this shows in the popup menu -->