Program: 38120
Project: 38120
Buggy source:
/** 
 * This can run on a background thread, so don't do UI updates here.
 */
private void qcomUpdateCameraParametersPreference(){
  mParameters.set("String_Node_Str",String.valueOf(mbrightness));
  String longshot_enable=mPreferences.getString(CameraSettings.KEY_LONGSHOT,mActivity.getString(R.string.pref_camera_longshot_default));
  mParameters.set("String_Node_Str",longshot_enable);
  String optizoomOn=mActivity.getString(R.string.pref_camera_advanced_feature_value_optizoom_on);
  if (Parameters.SCENE_MODE_AUTO.equals(mSceneMode) || CameraUtil.SCENE_MODE_HDR.equals(mSceneMode) || optizoomOn.equals(mSceneMode)) {
    String touchAfAec=mPreferences.getString(CameraSettings.KEY_TOUCH_AF_AEC,mActivity.getString(R.string.pref_camera_touchafaec_default));
    if (CameraUtil.isSupported(touchAfAec,ParametersWrapper.getSupportedTouchAfAec(mParameters))) {
      mCurrTouchAfAec=touchAfAec;
      ParametersWrapper.setTouchAfAec(mParameters,touchAfAec);
    }
  }
 else {
    ParametersWrapper.setTouchAfAec(mParameters,ParametersWrapper.TOUCH_AF_AEC_OFF);
    mFocusManager.resetTouchFocus();
  }
  try {
    if (ParametersWrapper.getTouchAfAec(mParameters).equals(ParametersWrapper.TOUCH_AF_AEC_ON))     this.mTouchAfAecFlag=true;
 else     this.mTouchAfAecFlag=false;
  }
 catch (  Exception e) {
    Log.e(TAG,"String_Node_Str");
  }
  String pictureFormat=mPreferences.getString(CameraSettings.KEY_PICTURE_FORMAT,mActivity.getString(R.string.pref_camera_picture_format_default));
  if (mIsImageCaptureIntent && !pictureFormat.equals(PIXEL_FORMAT_JPEG)) {
    pictureFormat=PIXEL_FORMAT_JPEG;
    Editor editor=mPreferences.edit();
    editor.putString(CameraSettings.KEY_PICTURE_FORMAT,mActivity.getString(R.string.pref_camera_picture_format_value_jpeg));
    editor.apply();
  }
  Log.v(TAG,"String_Node_Str" + pictureFormat);
  mParameters.set(KEY_PICTURE_FORMAT,pictureFormat);
  String jpegQuality=mPreferences.getString(CameraSettings.KEY_JPEG_QUALITY,mActivity.getString(R.string.pref_camera_jpegquality_default));
  Size pic_size=mParameters.getPictureSize();
  if (pic_size == null) {
    Log.e(TAG,"String_Node_Str");
  }
 else {
    if ("String_Node_Str".equals(jpegQuality) && (pic_size.width >= 3200)) {
    }
 else {
      mParameters.setJpegQuality(JpegEncodingQualityMappings.getQualityNumber(jpegQuality));
      int jpegFileSize=estimateJpegFileSize(pic_size,jpegQuality);
      if (jpegFileSize != mJpegFileSizeEstimation) {
        mJpegFileSizeEstimation=jpegFileSize;
        mHandler.post(new Runnable(){
          @Override public void run(){
            updateRemainingPhotos();
          }
        }
);
      }
    }
  }
  String selectableZoneAf=mPreferences.getString(CameraSettings.KEY_SELECTABLE_ZONE_AF,mActivity.getString(R.string.pref_camera_selectablezoneaf_default));
  List<String> str=ParametersWrapper.getSupportedSelectableZoneAf(mParameters);
  if (CameraUtil.isSupported(selectableZoneAf,ParametersWrapper.getSupportedSelectableZoneAf(mParameters))) {
    ParametersWrapper.setSelectableZoneAf(mParameters,selectableZoneAf);
  }
  if (ParametersWrapper.getSupportedDenoiseModes(mParameters) != null) {
    String Denoise=mPreferences.getString(CameraSettings.KEY_DENOISE,mActivity.getString(R.string.pref_camera_denoise_default));
    ParametersWrapper.setDenoise(mParameters,Denoise);
  }
  String redeyeReduction=mPreferences.getString(CameraSettings.KEY_REDEYE_REDUCTION,mActivity.getString(R.string.pref_camera_redeyereduction_default));
  if (CameraUtil.isSupported(redeyeReduction,ParametersWrapper.getSupportedRedeyeReductionModes(mParameters))) {
    ParametersWrapper.setRedeyeReductionMode(mParameters,redeyeReduction);
  }
  if ((mManual3AEnabled & MANUAL_EXPOSURE) == 0) {
    String iso=mPreferences.getString(CameraSettings.KEY_ISO,mActivity.getString(R.string.pref_camera_iso_default));
    if (CameraUtil.isSupported(iso,ParametersWrapper.getSupportedIsoValues(mParameters))) {
      ParametersWrapper.setISOValue(mParameters,iso);
    }
  }
  String colorEffect=mPreferences.getString(CameraSettings.KEY_COLOR_EFFECT,mActivity.getString(R.string.pref_camera_coloreffect_default));
  Log.v(TAG,"String_Node_Str" + colorEffect);
  if (CameraUtil.isSupported(colorEffect,mParameters.getSupportedColorEffects())) {
    mParameters.setColorEffect(colorEffect);
  }
  String saturationStr=mPreferences.getString(CameraSettings.KEY_SATURATION,mActivity.getString(R.string.pref_camera_saturation_default));
  int saturation=Integer.parseInt(saturationStr);
  Log.v(TAG,"String_Node_Str" + saturation);
  if ((0 <= saturation) && (saturation <= ParametersWrapper.getMaxSaturation(mParameters))) {
    ParametersWrapper.setSaturation(mParameters,saturation);
  }
  String contrastStr=mPreferences.getString(CameraSettings.KEY_CONTRAST,mActivity.getString(R.string.pref_camera_contrast_default));
  int contrast=Integer.parseInt(contrastStr);
  Log.v(TAG,"String_Node_Str" + contrast);
  if ((0 <= contrast) && (contrast <= ParametersWrapper.getMaxContrast(mParameters))) {
    ParametersWrapper.setContrast(mParameters,contrast);
  }
  String sharpnessStr=mPreferences.getString(CameraSettings.KEY_SHARPNESS,mActivity.getString(R.string.pref_camera_sharpness_default));
  int sharpness=Integer.parseInt(sharpnessStr) * (ParametersWrapper.getMaxSharpness(mParameters) / MAX_SHARPNESS_LEVEL);
  Log.v(TAG,"String_Node_Str" + sharpness);
  if ((0 <= sharpness) && (sharpness <= ParametersWrapper.getMaxSharpness(mParameters))) {
    ParametersWrapper.setSharpness(mParameters,sharpness);
  }
  String faceRC=mPreferences.getString(CameraSettings.KEY_FACE_RECOGNITION,mActivity.getString(R.string.pref_camera_facerc_default));
  Log.v(TAG,"String_Node_Str" + faceRC);
  if (CameraUtil.isSupported(faceRC,CameraSettings.getSupportedFaceRecognitionModes(mParameters))) {
    mParameters.set(CameraSettings.KEY_QC_FACE_RECOGNITION,faceRC);
  }
  String aeBracketing=mPreferences.getString(CameraSettings.KEY_AE_BRACKET_HDR,mActivity.getString(R.string.pref_camera_ae_bracket_hdr_default));
  Log.v(TAG,"String_Node_Str" + aeBracketing);
  if (CameraUtil.isSupported(aeBracketing,CameraSettings.getSupportedAEBracketingModes(mParameters))) {
    mParameters.set(CameraSettings.KEY_QC_AE_BRACKETING,aeBracketing);
  }
  String cds=mPreferences.getString(CameraSettings.KEY_CDS_MODE,mActivity.getString(R.string.pref_camera_cds_default));
  if ((mPrevSavedCDS == null) && (cds != null)) {
    mPrevSavedCDS=cds;
  }
  if (CameraUtil.isSupported(cds,CameraSettings.getSupportedCDSModes(mParameters))) {
    mParameters.set(CameraSettings.KEY_QC_CDS_MODE,cds);
  }
  String tnr=mPreferences.getString(CameraSettings.KEY_TNR_MODE,mActivity.getString(R.string.pref_camera_tnr_default));
  if (CameraUtil.isSupported(tnr,CameraSettings.getSupportedTNRModes(mParameters))) {
    if (!tnr.equals(mActivity.getString(R.string.pref_camera_tnr_value_off))) {
      mParameters.set(CameraSettings.KEY_QC_CDS_MODE,mActivity.getString(R.string.pref_camera_cds_value_off));
      mActivity.runOnUiThread(new Runnable(){
        @Override public void run(){
          mUI.overrideSettings(CameraSettings.KEY_QC_CDS_MODE,mActivity.getString(R.string.pref_camera_cds_value_off));
        }
      }
);
      if (cds != null) {
        mPrevSavedCDS=cds;
      }
      isTNREnabled=true;
    }
 else     if (isTNREnabled) {
      mParameters.set(CameraSettings.KEY_QC_CDS_MODE,mPrevSavedCDS);
      mActivity.runOnUiThread(new Runnable(){
        @Override public void run(){
          mUI.overrideSettings(CameraSettings.KEY_QC_CDS_MODE,mPrevSavedCDS);
        }
      }
);
      isTNREnabled=false;
    }
    mParameters.set(CameraSettings.KEY_QC_TNR_MODE,tnr);
  }
  String hdrMode=mPreferences.getString(CameraSettings.KEY_HDR_MODE,mActivity.getString(R.string.pref_camera_hdr_mode_default));
  Log.v(TAG,"String_Node_Str" + hdrMode);
  if (CameraUtil.isSupported(hdrMode,CameraSettings.getSupportedHDRModes(mParameters))) {
    mParameters.set(CameraSettings.KEY_SNAPCAM_HDR_MODE,hdrMode);
  }
  String hdrNeed1x=mPreferences.getString(CameraSettings.KEY_HDR_NEED_1X,mActivity.getString(R.string.pref_camera_hdr_need_1x_default));
  Log.v(TAG,"String_Node_Str" + hdrNeed1x);
  if (CameraUtil.isSupported(hdrNeed1x,CameraSettings.getSupportedHDRNeed1x(mParameters))) {
    mParameters.set(CameraSettings.KEY_SNAPCAM_HDR_NEED_1X,hdrNeed1x);
  }
  String advancedFeature=mPreferences.getString(CameraSettings.KEY_ADVANCED_FEATURES,mActivity.getString(R.string.pref_camera_advanced_feature_default));
  Log.e(TAG,"String_Node_Str" + advancedFeature);
  mRefocus=false;
  if (advancedFeature != null) {
    String ubiFocusOff=mActivity.getString(R.string.pref_camera_advanced_feature_value_ubifocus_off);
    String chromaFlashOff=mActivity.getString(R.string.pref_camera_advanced_feature_value_chromaflash_off);
    String optiZoomOff=mActivity.getString(R.string.pref_camera_advanced_feature_value_optizoom_off);
    String reFocusOff=mActivity.getString(R.string.pref_camera_advanced_feature_value_refocus_off);
    String fssrOff=mActivity.getString(R.string.pref_camera_advanced_feature_value_FSSR_off);
    String truePortraitOff=mActivity.getString(R.string.pref_camera_advanced_feature_value_trueportrait_off);
    String multiTouchFocusOff=mActivity.getString(R.string.pref_camera_advanced_feature_value_multi_touch_focus_off);
    String stillMoreOff=mActivity.getString(R.string.pref_camera_advanced_feature_value_stillmore_off);
    if (advancedFeature.equals(mActivity.getString(R.string.pref_camera_advanced_feature_value_ubifocus_on))) {
      qcomUpdateAdvancedFeatures(advancedFeature,chromaFlashOff,reFocusOff,optiZoomOff,fssrOff,truePortraitOff,multiTouchFocusOff,stillMoreOff);
    }
 else     if (advancedFeature.equals(mActivity.getString(R.string.pref_camera_advanced_feature_value_chromaflash_on))) {
      qcomUpdateAdvancedFeatures(ubiFocusOff,advancedFeature,reFocusOff,optiZoomOff,fssrOff,truePortraitOff,multiTouchFocusOff,stillMoreOff);
    }
 else     if (advancedFeature.equals(mActivity.getString(R.string.pref_camera_advanced_feature_value_refocus_on))) {
      qcomUpdateAdvancedFeatures(ubiFocusOff,chromaFlashOff,advancedFeature,optiZoomOff,fssrOff,truePortraitOff,multiTouchFocusOff,stillMoreOff);
      mRefocus=true;
    }
 else     if (advancedFeature.equals(mActivity.getString(R.string.pref_camera_advanced_feature_value_optizoom_on))) {
      qcomUpdateAdvancedFeatures(ubiFocusOff,chromaFlashOff,reFocusOff,advancedFeature,fssrOff,truePortraitOff,multiTouchFocusOff,stillMoreOff);
    }
 else     if (advancedFeature.equals(mActivity.getString(R.string.pref_camera_advanced_feature_value_FSSR_on))) {
      qcomUpdateAdvancedFeatures(ubiFocusOff,chromaFlashOff,reFocusOff,optiZoomOff,advancedFeature,truePortraitOff,multiTouchFocusOff,stillMoreOff);
    }
 else     if (advancedFeature.equals(mActivity.getString(R.string.pref_camera_advanced_feature_value_trueportrait_on))) {
      qcomUpdateAdvancedFeatures(ubiFocusOff,chromaFlashOff,reFocusOff,optiZoomOff,fssrOff,advancedFeature,multiTouchFocusOff,stillMoreOff);
    }
 else     if (advancedFeature.equals(mActivity.getString(R.string.pref_camera_advanced_feature_value_multi_touch_focus_on))) {
      qcomUpdateAdvancedFeatures(ubiFocusOff,chromaFlashOff,reFocusOff,optiZoomOff,fssrOff,truePortraitOff,advancedFeature,stillMoreOff);
    }
 else     if (advancedFeature.equals(mActivity.getString(R.string.pref_camera_advanced_feature_value_stillmore_on))) {
      qcomUpdateAdvancedFeatures(ubiFocusOff,chromaFlashOff,reFocusOff,optiZoomOff,fssrOff,truePortraitOff,multiTouchFocusOff,advancedFeature);
    }
 else {
      qcomUpdateAdvancedFeatures(ubiFocusOff,chromaFlashOff,reFocusOff,optiZoomOff,fssrOff,truePortraitOff,multiTouchFocusOff,stillMoreOff);
    }
  }
  if (mActivity.getString(R.string.pref_camera_advanced_feature_value_trueportrait_on).equals(advancedFeature)) {
    if (CameraUtil.isSupported(ParametersWrapper.FACE_DETECTION_ON,ParametersWrapper.getSupportedFaceDetectionModes(mParameters))) {
      mActivity.runOnUiThread(new Runnable(){
        @Override public void run(){
          mUI.overrideSettings(CameraSettings.KEY_FACE_DETECTION,ParametersWrapper.FACE_DETECTION_ON);
        }
      }
);
      ParametersWrapper.setFaceDetectionMode(mParameters,ParametersWrapper.FACE_DETECTION_ON);
      if (mFaceDetectionEnabled == false) {
        mFaceDetectionEnabled=true;
        startFaceDetection();
      }
    }
  }
 else {
    mActivity.runOnUiThread(new Runnable(){
      @Override public void run(){
        mUI.overrideSettings(CameraSettings.KEY_FACE_DETECTION,null);
      }
    }
);
    String faceDetection=mPreferences.getString(CameraSettings.KEY_FACE_DETECTION,mActivity.getString(R.string.pref_camera_facedetection_default));
    if (CameraUtil.isSupported(faceDetection,ParametersWrapper.getSupportedFaceDetectionModes(mParameters))) {
      ParametersWrapper.setFaceDetectionMode(mParameters,faceDetection);
      if (faceDetection.equals("String_Node_Str") && mFaceDetectionEnabled == false) {
        mFaceDetectionEnabled=true;
        startFaceDetection();
      }
      if (faceDetection.equals("String_Node_Str") && mFaceDetectionEnabled == true) {
        stopFaceDetection();
        mFaceDetectionEnabled=false;
      }
    }
  }
  String autoExposure=mPreferences.getString(CameraSettings.KEY_AUTOEXPOSURE,mActivity.getString(R.string.pref_camera_autoexposure_default));
  Log.v(TAG,"String_Node_Str" + autoExposure);
  if (CameraUtil.isSupported(autoExposure,ParametersWrapper.getSupportedAutoexposure(mParameters))) {
    ParametersWrapper.setAutoExposure(mParameters,autoExposure);
  }
  String antiBanding=mPreferences.getString(CameraSettings.KEY_ANTIBANDING,mActivity.getString(R.string.pref_camera_antibanding_default));
  Log.v(TAG,"String_Node_Str" + antiBanding);
  if (CameraUtil.isSupported(antiBanding,mParameters.getSupportedAntibanding())) {
    mParameters.setAntibanding(antiBanding);
  }
  String zsl=mPreferences.getString(CameraSettings.KEY_ZSL,mActivity.getString(R.string.pref_camera_zsl_default));
  String auto_hdr=mPreferences.getString(CameraSettings.KEY_AUTO_HDR,mActivity.getString(R.string.pref_camera_hdr_default));
  if (CameraUtil.isAutoHDRSupported(mParameters)) {
    mParameters.set("String_Node_Str",auto_hdr);
    if (auto_hdr.equals("String_Node_Str")) {
      mActivity.runOnUiThread(new Runnable(){
        public void run(){
          if (mDrawAutoHDR != null) {
            mDrawAutoHDR.setVisibility(View.VISIBLE);
          }
        }
      }
);
      mParameters.setSceneMode("String_Node_Str");
      mCameraDevice.setMetadataCb(mMetaDataCallback);
    }
 else {
      mAutoHdrEnable=false;
      mActivity.runOnUiThread(new Runnable(){
        public void run(){
          if (mDrawAutoHDR != null) {
            mDrawAutoHDR.setVisibility(View.INVISIBLE);
          }
        }
      }
);
    }
  }
  ParametersWrapper.setZSLMode(mParameters,zsl);
  if (zsl.equals("String_Node_Str") && ParametersWrapper.getSupportedZSLModes(mParameters) != null) {
    mSnapshotMode=CameraInfoWrapper.CAMERA_SUPPORT_MODE_ZSL;
    ParametersWrapper.setCameraMode(mParameters,1);
    mFocusManager.setZslEnable(true);
    mParameters.set(KEY_PICTURE_FORMAT,PIXEL_FORMAT_JPEG);
    if (CameraUtil.isSupported(Parameters.FOCUS_MODE_CONTINUOUS_PICTURE,mParameters.getSupportedFocusModes()) && !mFocusManager.isTouch()) {
      mFocusManager.overrideFocusMode(Parameters.FOCUS_MODE_CONTINUOUS_PICTURE);
      mParameters.setFocusMode(Parameters.FOCUS_MODE_CONTINUOUS_PICTURE);
    }
 else     if (mFocusManager.isTouch()) {
      mFocusManager.overrideFocusMode(null);
      mParameters.setFocusMode(mFocusManager.getFocusMode());
    }
 else {
      mFocusManager.overrideFocusMode(mFocusManager.getFocusMode());
    }
    if (!pictureFormat.equals(PIXEL_FORMAT_JPEG)) {
      mActivity.runOnUiThread(new Runnable(){
        public void run(){
          RotateTextToast.makeText(mActivity,R.string.error_app_unsupported_raw,Toast.LENGTH_SHORT).show();
        }
      }
);
    }
  }
 else   if (zsl.equals("String_Node_Str")) {
    mSnapshotMode=CameraInfoWrapper.CAMERA_SUPPORT_MODE_NONZSL;
    ParametersWrapper.setCameraMode(mParameters,0);
    mFocusManager.setZslEnable(false);
    if ((mManual3AEnabled & MANUAL_FOCUS) == 0) {
      mFocusManager.overrideFocusMode(null);
      mParameters.setFocusMode(mFocusManager.getFocusMode());
    }
  }
  String instantCapture=mPreferences.getString(CameraSettings.KEY_INSTANT_CAPTURE,mActivity.getString(R.string.pref_camera_instant_capture_default));
  if (!instantCapture.equals(mActivity.getString(R.string.pref_camera_instant_capture_value_disable))) {
    if (zsl.equals("String_Node_Str") && advancedFeature.equals(mActivity.getString(R.string.pref_camera_advanced_feature_value_none))) {
      if (!mInstantCaptureSnapShot) {
        instantCapture=mActivity.getString(R.string.pref_camera_instant_capture_value_disable);
      }
    }
 else {
      mParameters.set(CameraSettings.KEY_QC_INSTANT_CAPTURE,mActivity.getString(R.string.pref_camera_instant_capture_value_disable));
      instantCapture=mActivity.getString(R.string.pref_camera_instant_capture_value_disable);
      mActivity.runOnUiThread(new Runnable(){
        @Override public void run(){
          mUI.overrideSettings(CameraSettings.KEY_INSTANT_CAPTURE,mActivity.getString(R.string.pref_camera_instant_capture_value_disable));
        }
      }
);
    }
  }
  Log.v(TAG,"String_Node_Str" + instantCapture + "String_Node_Str"+ mInstantCaptureSnapShot);
  mParameters.set(CameraSettings.KEY_QC_INSTANT_CAPTURE,instantCapture);
  String histogram=mPreferences.getString(CameraSettings.KEY_HISTOGRAM,mActivity.getString(R.string.pref_camera_histogram_default));
  if (CameraUtil.isSupported(histogram,ParametersWrapper.getSupportedHistogramModes(mParameters)) && mCameraDevice != null) {
    if (histogram.equals("String_Node_Str")) {
      mActivity.runOnUiThread(new Runnable(){
        public void run(){
          if (mGraphView != null) {
            mGraphView.setVisibility(View.VISIBLE);
            mGraphView.PreviewChanged();
          }
        }
      }
);
      mCameraDevice.setHistogramMode(mStatsCallback);
      mHiston=true;
    }
 else {
      mHiston=false;
      mActivity.runOnUiThread(new Runnable(){
        public void run(){
          if (mGraphView != null)           mGraphView.setVisibility(View.INVISIBLE);
        }
      }
);
      mCameraDevice.setHistogramMode(null);
    }
  }
  setFlipValue();
  String aeBracket=mParameters.get(CameraSettings.KEY_QC_AE_BRACKETING);
  if (aeBracket != null && !aeBracket.equalsIgnoreCase("String_Node_Str")) {
    String fMode=Parameters.FLASH_MODE_OFF;
    mParameters.setFlashMode(fMode);
  }
  if (!mFocusManager.getFocusMode().equals(Parameters.FOCUS_MODE_CONTINUOUS_PICTURE) && !mFocusManager.isFocusCompleted()) {
    mUI.clearFocus();
  }
  String bokehMode=mPreferences.getString(CameraSettings.KEY_BOKEH_MODE,mActivity.getString(R.string.pref_camera_bokeh_mode_default));
  String bokehMpo=mPreferences.getString(CameraSettings.KEY_BOKEH_MPO,mActivity.getString(R.string.pref_camera_bokeh_mpo_default));
  String bokehBlurDegree=mPreferences.getString(CameraSettings.KEY_BOKEH_BLUR_VALUE,mActivity.getString(R.string.pref_camera_bokeh_blur_degree_default));
  CameraSettings.getSupportedDegreesOfBlur(mParameters);
  if (!bokehMode.equals(mActivity.getString(R.string.pref_camera_bokeh_mode_entry_value_disable))) {
    if (!zsl.equals("String_Node_Str")) {
      ParametersWrapper.setZSLMode(mParameters,"String_Node_Str");
    }
    if (mParameters.getSceneMode() != Parameters.SCENE_MODE_AUTO) {
      mParameters.setSceneMode(Parameters.SCENE_MODE_AUTO);
    }
    if (mParameters.getFlashMode() != Parameters.FLASH_MODE_OFF) {
      mParameters.setFlashMode(Parameters.FLASH_MODE_OFF);
    }
    if (mParameters.get("String_Node_Str").equals(mActivity.getString(R.string.setting_on_value))) {
      mParameters.set("String_Node_Str",mActivity.getString(R.string.setting_off_value));
    }
    if (mManual3AEnabled != 0) {
      mManual3AEnabled=0;
    }
    final SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(mActivity);
    final int degree=prefs.getInt(CameraSettings.KEY_BOKEH_BLUR_VALUE,50);
    bokehBlurDegree=String.valueOf(degree);
    mActivity.runOnUiThread(new Runnable(){
      @Override public void run(){
        mUI.overrideSettings(CameraSettings.KEY_SCENE_MODE,mActivity.getString(R.string.pref_camera_scenemode_default));
        mUI.overrideSettings(CameraSettings.KEY_ZSL,mActivity.getString(R.string.pref_camera_zsl_value_on));
        mUI.overrideSettings(CameraSettings.KEY_FLASH_MODE,"String_Node_Str");
        mUI.overrideSettings(CameraSettings.KEY_LONGSHOT,mActivity.getString(R.string.pref_camera_longshot_default));
        mBlurDegreeProgressBar.setVisibility(View.VISIBLE);
        mBlurDegreeProgressBar.setProgress(degree);
      }
    }
);
  }
 else {
    bokehBlurDegree="String_Node_Str";
    mActivity.runOnUiThread(new Runnable(){
      @Override public void run(){
        mUI.overrideSettings(CameraSettings.KEY_BOKEH_MPO,mActivity.getString(R.string.pref_camera_bokeh_mpo_default));
        mUI.overrideSettings(CameraSettings.KEY_BOKEH_BLUR_VALUE,mActivity.getString(R.string.pref_camera_bokeh_blur_degree_default));
        mBlurDegreeProgressBar.setVisibility(View.GONE);
      }
    }
);
  }
  mParameters.set(CameraSettings.KEY_QC_BOKEH_MODE,bokehMode);
  mParameters.set(CameraSettings.KEY_QC_BOKEH_MPO_MODE,bokehMpo);
  mParameters.set(CameraSettings.KEY_QC_BOKEH_BLUR_VALUE,bokehBlurDegree);
  Log.v(TAG,"String_Node_Str" + bokehMode + "String_Node_Str"+ bokehMpo+ "String_Node_Str"+ bokehBlurDegree);
}

Fixed version (ground truth):
/** 
 * This can run on a background thread, so don't do UI updates here.
 */
private void qcomUpdateCameraParametersPreference(){
  mParameters.set("String_Node_Str",String.valueOf(mbrightness));
  String longshot_enable=mPreferences.getString(CameraSettings.KEY_LONGSHOT,mActivity.getString(R.string.pref_camera_longshot_default));
  mParameters.set("String_Node_Str",longshot_enable);
  String optizoomOn=mActivity.getString(R.string.pref_camera_advanced_feature_value_optizoom_on);
  if (Parameters.SCENE_MODE_AUTO.equals(mSceneMode) || CameraUtil.SCENE_MODE_HDR.equals(mSceneMode) || optizoomOn.equals(mSceneMode)) {
    String touchAfAec=mPreferences.getString(CameraSettings.KEY_TOUCH_AF_AEC,mActivity.getString(R.string.pref_camera_touchafaec_default));
    if (CameraUtil.isSupported(touchAfAec,ParametersWrapper.getSupportedTouchAfAec(mParameters))) {
      mCurrTouchAfAec=touchAfAec;
      ParametersWrapper.setTouchAfAec(mParameters,touchAfAec);
    }
  }
 else {
    ParametersWrapper.setTouchAfAec(mParameters,ParametersWrapper.TOUCH_AF_AEC_OFF);
    mFocusManager.resetTouchFocus();
  }
  try {
    if (ParametersWrapper.getTouchAfAec(mParameters).equals(ParametersWrapper.TOUCH_AF_AEC_ON))     this.mTouchAfAecFlag=true;
 else     this.mTouchAfAecFlag=false;
  }
 catch (  Exception e) {
    Log.e(TAG,"String_Node_Str");
  }
  String pictureFormat=mPreferences.getString(CameraSettings.KEY_PICTURE_FORMAT,mActivity.getString(R.string.pref_camera_picture_format_default));
  if (mIsImageCaptureIntent && !pictureFormat.equals(PIXEL_FORMAT_JPEG)) {
    pictureFormat=PIXEL_FORMAT_JPEG;
    Editor editor=mPreferences.edit();
    editor.putString(CameraSettings.KEY_PICTURE_FORMAT,mActivity.getString(R.string.pref_camera_picture_format_value_jpeg));
    editor.apply();
  }
  Log.v(TAG,"String_Node_Str" + pictureFormat);
  mParameters.set(KEY_PICTURE_FORMAT,pictureFormat);
  String jpegQuality=mPreferences.getString(CameraSettings.KEY_JPEG_QUALITY,mActivity.getString(R.string.pref_camera_jpegquality_default));
  Size pic_size=mParameters.getPictureSize();
  if (pic_size == null) {
    Log.e(TAG,"String_Node_Str");
  }
 else {
    if ("String_Node_Str".equals(jpegQuality) && (pic_size.width >= 3200)) {
      mHandler.post(new Runnable(){
        @Override public void run(){
          mUI.hideRemainingPhotoCnt();
        }
      }
);
    }
 else {
      mHandler.post(new Runnable(){
        @Override public void run(){
          mUI.showRemainingPhotoCnt();
        }
      }
);
      mParameters.setJpegQuality(JpegEncodingQualityMappings.getQualityNumber(jpegQuality));
      int jpegFileSize=estimateJpegFileSize(pic_size,jpegQuality);
      if (jpegFileSize != mJpegFileSizeEstimation) {
        mJpegFileSizeEstimation=jpegFileSize;
        mHandler.post(new Runnable(){
          @Override public void run(){
            updateRemainingPhotos();
          }
        }
);
      }
    }
  }
  String selectableZoneAf=mPreferences.getString(CameraSettings.KEY_SELECTABLE_ZONE_AF,mActivity.getString(R.string.pref_camera_selectablezoneaf_default));
  List<String> str=ParametersWrapper.getSupportedSelectableZoneAf(mParameters);
  if (CameraUtil.isSupported(selectableZoneAf,ParametersWrapper.getSupportedSelectableZoneAf(mParameters))) {
    ParametersWrapper.setSelectableZoneAf(mParameters,selectableZoneAf);
  }
  if (ParametersWrapper.getSupportedDenoiseModes(mParameters) != null) {
    String Denoise=mPreferences.getString(CameraSettings.KEY_DENOISE,mActivity.getString(R.string.pref_camera_denoise_default));
    ParametersWrapper.setDenoise(mParameters,Denoise);
  }
  String redeyeReduction=mPreferences.getString(CameraSettings.KEY_REDEYE_REDUCTION,mActivity.getString(R.string.pref_camera_redeyereduction_default));
  if (CameraUtil.isSupported(redeyeReduction,ParametersWrapper.getSupportedRedeyeReductionModes(mParameters))) {
    ParametersWrapper.setRedeyeReductionMode(mParameters,redeyeReduction);
  }
  if ((mManual3AEnabled & MANUAL_EXPOSURE) == 0) {
    String iso=mPreferences.getString(CameraSettings.KEY_ISO,mActivity.getString(R.string.pref_camera_iso_default));
    if (CameraUtil.isSupported(iso,ParametersWrapper.getSupportedIsoValues(mParameters))) {
      ParametersWrapper.setISOValue(mParameters,iso);
    }
  }
  String colorEffect=mPreferences.getString(CameraSettings.KEY_COLOR_EFFECT,mActivity.getString(R.string.pref_camera_coloreffect_default));
  Log.v(TAG,"String_Node_Str" + colorEffect);
  if (CameraUtil.isSupported(colorEffect,mParameters.getSupportedColorEffects())) {
    mParameters.setColorEffect(colorEffect);
  }
  String saturationStr=mPreferences.getString(CameraSettings.KEY_SATURATION,mActivity.getString(R.string.pref_camera_saturation_default));
  int saturation=Integer.parseInt(saturationStr);
  Log.v(TAG,"String_Node_Str" + saturation);
  if ((0 <= saturation) && (saturation <= ParametersWrapper.getMaxSaturation(mParameters))) {
    ParametersWrapper.setSaturation(mParameters,saturation);
  }
  String contrastStr=mPreferences.getString(CameraSettings.KEY_CONTRAST,mActivity.getString(R.string.pref_camera_contrast_default));
  int contrast=Integer.parseInt(contrastStr);
  Log.v(TAG,"String_Node_Str" + contrast);
  if ((0 <= contrast) && (contrast <= ParametersWrapper.getMaxContrast(mParameters))) {
    ParametersWrapper.setContrast(mParameters,contrast);
  }
  String sharpnessStr=mPreferences.getString(CameraSettings.KEY_SHARPNESS,mActivity.getString(R.string.pref_camera_sharpness_default));
  int sharpness=Integer.parseInt(sharpnessStr) * (ParametersWrapper.getMaxSharpness(mParameters) / MAX_SHARPNESS_LEVEL);
  Log.v(TAG,"String_Node_Str" + sharpness);
  if ((0 <= sharpness) && (sharpness <= ParametersWrapper.getMaxSharpness(mParameters))) {
    ParametersWrapper.setSharpness(mParameters,sharpness);
  }
  String faceRC=mPreferences.getString(CameraSettings.KEY_FACE_RECOGNITION,mActivity.getString(R.string.pref_camera_facerc_default));
  Log.v(TAG,"String_Node_Str" + faceRC);
  if (CameraUtil.isSupported(faceRC,CameraSettings.getSupportedFaceRecognitionModes(mParameters))) {
    mParameters.set(CameraSettings.KEY_QC_FACE_RECOGNITION,faceRC);
  }
  String aeBracketing=mPreferences.getString(CameraSettings.KEY_AE_BRACKET_HDR,mActivity.getString(R.string.pref_camera_ae_bracket_hdr_default));
  Log.v(TAG,"String_Node_Str" + aeBracketing);
  if (CameraUtil.isSupported(aeBracketing,CameraSettings.getSupportedAEBracketingModes(mParameters))) {
    mParameters.set(CameraSettings.KEY_QC_AE_BRACKETING,aeBracketing);
  }
  String cds=mPreferences.getString(CameraSettings.KEY_CDS_MODE,mActivity.getString(R.string.pref_camera_cds_default));
  if ((mPrevSavedCDS == null) && (cds != null)) {
    mPrevSavedCDS=cds;
  }
  if (CameraUtil.isSupported(cds,CameraSettings.getSupportedCDSModes(mParameters))) {
    mParameters.set(CameraSettings.KEY_QC_CDS_MODE,cds);
  }
  String tnr=mPreferences.getString(CameraSettings.KEY_TNR_MODE,mActivity.getString(R.string.pref_camera_tnr_default));
  if (CameraUtil.isSupported(tnr,CameraSettings.getSupportedTNRModes(mParameters))) {
    if (!tnr.equals(mActivity.getString(R.string.pref_camera_tnr_value_off))) {
      mParameters.set(CameraSettings.KEY_QC_CDS_MODE,mActivity.getString(R.string.pref_camera_cds_value_off));
      mActivity.runOnUiThread(new Runnable(){
        @Override public void run(){
          mUI.overrideSettings(CameraSettings.KEY_QC_CDS_MODE,mActivity.getString(R.string.pref_camera_cds_value_off));
        }
      }
);
      if (cds != null) {
        mPrevSavedCDS=cds;
      }
      isTNREnabled=true;
    }
 else     if (isTNREnabled) {
      mParameters.set(CameraSettings.KEY_QC_CDS_MODE,mPrevSavedCDS);
      mActivity.runOnUiThread(new Runnable(){
        @Override public void run(){
          mUI.overrideSettings(CameraSettings.KEY_QC_CDS_MODE,mPrevSavedCDS);
        }
      }
);
      isTNREnabled=false;
    }
    mParameters.set(CameraSettings.KEY_QC_TNR_MODE,tnr);
  }
  String hdrMode=mPreferences.getString(CameraSettings.KEY_HDR_MODE,mActivity.getString(R.string.pref_camera_hdr_mode_default));
  Log.v(TAG,"String_Node_Str" + hdrMode);
  if (CameraUtil.isSupported(hdrMode,CameraSettings.getSupportedHDRModes(mParameters))) {
    mParameters.set(CameraSettings.KEY_SNAPCAM_HDR_MODE,hdrMode);
  }
  String hdrNeed1x=mPreferences.getString(CameraSettings.KEY_HDR_NEED_1X,mActivity.getString(R.string.pref_camera_hdr_need_1x_default));
  Log.v(TAG,"String_Node_Str" + hdrNeed1x);
  if (CameraUtil.isSupported(hdrNeed1x,CameraSettings.getSupportedHDRNeed1x(mParameters))) {
    mParameters.set(CameraSettings.KEY_SNAPCAM_HDR_NEED_1X,hdrNeed1x);
  }
  String advancedFeature=mPreferences.getString(CameraSettings.KEY_ADVANCED_FEATURES,mActivity.getString(R.string.pref_camera_advanced_feature_default));
  Log.e(TAG,"String_Node_Str" + advancedFeature);
  mRefocus=false;
  if (advancedFeature != null) {
    String ubiFocusOff=mActivity.getString(R.string.pref_camera_advanced_feature_value_ubifocus_off);
    String chromaFlashOff=mActivity.getString(R.string.pref_camera_advanced_feature_value_chromaflash_off);
    String optiZoomOff=mActivity.getString(R.string.pref_camera_advanced_feature_value_optizoom_off);
    String reFocusOff=mActivity.getString(R.string.pref_camera_advanced_feature_value_refocus_off);
    String fssrOff=mActivity.getString(R.string.pref_camera_advanced_feature_value_FSSR_off);
    String truePortraitOff=mActivity.getString(R.string.pref_camera_advanced_feature_value_trueportrait_off);
    String multiTouchFocusOff=mActivity.getString(R.string.pref_camera_advanced_feature_value_multi_touch_focus_off);
    String stillMoreOff=mActivity.getString(R.string.pref_camera_advanced_feature_value_stillmore_off);
    if (advancedFeature.equals(mActivity.getString(R.string.pref_camera_advanced_feature_value_ubifocus_on))) {
      qcomUpdateAdvancedFeatures(advancedFeature,chromaFlashOff,reFocusOff,optiZoomOff,fssrOff,truePortraitOff,multiTouchFocusOff,stillMoreOff);
    }
 else     if (advancedFeature.equals(mActivity.getString(R.string.pref_camera_advanced_feature_value_chromaflash_on))) {
      qcomUpdateAdvancedFeatures(ubiFocusOff,advancedFeature,reFocusOff,optiZoomOff,fssrOff,truePortraitOff,multiTouchFocusOff,stillMoreOff);
    }
 else     if (advancedFeature.equals(mActivity.getString(R.string.pref_camera_advanced_feature_value_refocus_on))) {
      qcomUpdateAdvancedFeatures(ubiFocusOff,chromaFlashOff,advancedFeature,optiZoomOff,fssrOff,truePortraitOff,multiTouchFocusOff,stillMoreOff);
      mRefocus=true;
    }
 else     if (advancedFeature.equals(mActivity.getString(R.string.pref_camera_advanced_feature_value_optizoom_on))) {
      qcomUpdateAdvancedFeatures(ubiFocusOff,chromaFlashOff,reFocusOff,advancedFeature,fssrOff,truePortraitOff,multiTouchFocusOff,stillMoreOff);
    }
 else     if (advancedFeature.equals(mActivity.getString(R.string.pref_camera_advanced_feature_value_FSSR_on))) {
      qcomUpdateAdvancedFeatures(ubiFocusOff,chromaFlashOff,reFocusOff,optiZoomOff,advancedFeature,truePortraitOff,multiTouchFocusOff,stillMoreOff);
    }
 else     if (advancedFeature.equals(mActivity.getString(R.string.pref_camera_advanced_feature_value_trueportrait_on))) {
      qcomUpdateAdvancedFeatures(ubiFocusOff,chromaFlashOff,reFocusOff,optiZoomOff,fssrOff,advancedFeature,multiTouchFocusOff,stillMoreOff);
    }
 else     if (advancedFeature.equals(mActivity.getString(R.string.pref_camera_advanced_feature_value_multi_touch_focus_on))) {
      qcomUpdateAdvancedFeatures(ubiFocusOff,chromaFlashOff,reFocusOff,optiZoomOff,fssrOff,truePortraitOff,advancedFeature,stillMoreOff);
    }
 else     if (advancedFeature.equals(mActivity.getString(R.string.pref_camera_advanced_feature_value_stillmore_on))) {
      qcomUpdateAdvancedFeatures(ubiFocusOff,chromaFlashOff,reFocusOff,optiZoomOff,fssrOff,truePortraitOff,multiTouchFocusOff,advancedFeature);
    }
 else {
      qcomUpdateAdvancedFeatures(ubiFocusOff,chromaFlashOff,reFocusOff,optiZoomOff,fssrOff,truePortraitOff,multiTouchFocusOff,stillMoreOff);
    }
  }
  if (mActivity.getString(R.string.pref_camera_advanced_feature_value_trueportrait_on).equals(advancedFeature)) {
    if (CameraUtil.isSupported(ParametersWrapper.FACE_DETECTION_ON,ParametersWrapper.getSupportedFaceDetectionModes(mParameters))) {
      mActivity.runOnUiThread(new Runnable(){
        @Override public void run(){
          mUI.overrideSettings(CameraSettings.KEY_FACE_DETECTION,ParametersWrapper.FACE_DETECTION_ON);
        }
      }
);
      ParametersWrapper.setFaceDetectionMode(mParameters,ParametersWrapper.FACE_DETECTION_ON);
      if (mFaceDetectionEnabled == false) {
        mFaceDetectionEnabled=true;
        startFaceDetection();
      }
    }
  }
 else {
    mActivity.runOnUiThread(new Runnable(){
      @Override public void run(){
        mUI.overrideSettings(CameraSettings.KEY_FACE_DETECTION,null);
      }
    }
);
    String faceDetection=mPreferences.getString(CameraSettings.KEY_FACE_DETECTION,mActivity.getString(R.string.pref_camera_facedetection_default));
    if (CameraUtil.isSupported(faceDetection,ParametersWrapper.getSupportedFaceDetectionModes(mParameters))) {
      ParametersWrapper.setFaceDetectionMode(mParameters,faceDetection);
      if (faceDetection.equals("String_Node_Str") && mFaceDetectionEnabled == false) {
        mFaceDetectionEnabled=true;
        startFaceDetection();
      }
      if (faceDetection.equals("String_Node_Str") && mFaceDetectionEnabled == true) {
        stopFaceDetection();
        mFaceDetectionEnabled=false;
      }
    }
  }
  String autoExposure=mPreferences.getString(CameraSettings.KEY_AUTOEXPOSURE,mActivity.getString(R.string.pref_camera_autoexposure_default));
  Log.v(TAG,"String_Node_Str" + autoExposure);
  if (CameraUtil.isSupported(autoExposure,ParametersWrapper.getSupportedAutoexposure(mParameters))) {
    ParametersWrapper.setAutoExposure(mParameters,autoExposure);
  }
  String antiBanding=mPreferences.getString(CameraSettings.KEY_ANTIBANDING,mActivity.getString(R.string.pref_camera_antibanding_default));
  Log.v(TAG,"String_Node_Str" + antiBanding);
  if (CameraUtil.isSupported(antiBanding,mParameters.getSupportedAntibanding())) {
    mParameters.setAntibanding(antiBanding);
  }
  String zsl=mPreferences.getString(CameraSettings.KEY_ZSL,mActivity.getString(R.string.pref_camera_zsl_default));
  String auto_hdr=mPreferences.getString(CameraSettings.KEY_AUTO_HDR,mActivity.getString(R.string.pref_camera_hdr_default));
  if (CameraUtil.isAutoHDRSupported(mParameters)) {
    mParameters.set("String_Node_Str",auto_hdr);
    if (auto_hdr.equals("String_Node_Str")) {
      mActivity.runOnUiThread(new Runnable(){
        public void run(){
          if (mDrawAutoHDR != null) {
            mDrawAutoHDR.setVisibility(View.VISIBLE);
          }
        }
      }
);
      mParameters.setSceneMode("String_Node_Str");
      mCameraDevice.setMetadataCb(mMetaDataCallback);
    }
 else {
      mAutoHdrEnable=false;
      mActivity.runOnUiThread(new Runnable(){
        public void run(){
          if (mDrawAutoHDR != null) {
            mDrawAutoHDR.setVisibility(View.INVISIBLE);
          }
        }
      }
);
    }
  }
  ParametersWrapper.setZSLMode(mParameters,zsl);
  if (zsl.equals("String_Node_Str") && ParametersWrapper.getSupportedZSLModes(mParameters) != null) {
    mSnapshotMode=CameraInfoWrapper.CAMERA_SUPPORT_MODE_ZSL;
    ParametersWrapper.setCameraMode(mParameters,1);
    mFocusManager.setZslEnable(true);
    mParameters.set(KEY_PICTURE_FORMAT,PIXEL_FORMAT_JPEG);
    if (CameraUtil.isSupported(Parameters.FOCUS_MODE_CONTINUOUS_PICTURE,mParameters.getSupportedFocusModes()) && !mFocusManager.isTouch()) {
      mFocusManager.overrideFocusMode(Parameters.FOCUS_MODE_CONTINUOUS_PICTURE);
      mParameters.setFocusMode(Parameters.FOCUS_MODE_CONTINUOUS_PICTURE);
    }
 else     if (mFocusManager.isTouch()) {
      mFocusManager.overrideFocusMode(null);
      mParameters.setFocusMode(mFocusManager.getFocusMode());
    }
 else {
      mFocusManager.overrideFocusMode(mFocusManager.getFocusMode());
    }
    if (!pictureFormat.equals(PIXEL_FORMAT_JPEG)) {
      mActivity.runOnUiThread(new Runnable(){
        public void run(){
          RotateTextToast.makeText(mActivity,R.string.error_app_unsupported_raw,Toast.LENGTH_SHORT).show();
        }
      }
);
    }
  }
 else   if (zsl.equals("String_Node_Str")) {
    mSnapshotMode=CameraInfoWrapper.CAMERA_SUPPORT_MODE_NONZSL;
    ParametersWrapper.setCameraMode(mParameters,0);
    mFocusManager.setZslEnable(false);
    if ((mManual3AEnabled & MANUAL_FOCUS) == 0) {
      mFocusManager.overrideFocusMode(null);
      mParameters.setFocusMode(mFocusManager.getFocusMode());
    }
  }
  String instantCapture=mPreferences.getString(CameraSettings.KEY_INSTANT_CAPTURE,mActivity.getString(R.string.pref_camera_instant_capture_default));
  if (!instantCapture.equals(mActivity.getString(R.string.pref_camera_instant_capture_value_disable))) {
    if (zsl.equals("String_Node_Str") && advancedFeature.equals(mActivity.getString(R.string.pref_camera_advanced_feature_value_none))) {
      if (!mInstantCaptureSnapShot) {
        instantCapture=mActivity.getString(R.string.pref_camera_instant_capture_value_disable);
      }
    }
 else {
      mParameters.set(CameraSettings.KEY_QC_INSTANT_CAPTURE,mActivity.getString(R.string.pref_camera_instant_capture_value_disable));
      instantCapture=mActivity.getString(R.string.pref_camera_instant_capture_value_disable);
      mActivity.runOnUiThread(new Runnable(){
        @Override public void run(){
          mUI.overrideSettings(CameraSettings.KEY_INSTANT_CAPTURE,mActivity.getString(R.string.pref_camera_instant_capture_value_disable));
        }
      }
);
    }
  }
  Log.v(TAG,"String_Node_Str" + instantCapture + "String_Node_Str"+ mInstantCaptureSnapShot);
  mParameters.set(CameraSettings.KEY_QC_INSTANT_CAPTURE,instantCapture);
  String histogram=mPreferences.getString(CameraSettings.KEY_HISTOGRAM,mActivity.getString(R.string.pref_camera_histogram_default));
  if (CameraUtil.isSupported(histogram,ParametersWrapper.getSupportedHistogramModes(mParameters)) && mCameraDevice != null) {
    if (histogram.equals("String_Node_Str")) {
      mActivity.runOnUiThread(new Runnable(){
        public void run(){
          if (mGraphView != null) {
            mGraphView.setVisibility(View.VISIBLE);
            mGraphView.PreviewChanged();
          }
        }
      }
);
      mCameraDevice.setHistogramMode(mStatsCallback);
      mHiston=true;
    }
 else {
      mHiston=false;
      mActivity.runOnUiThread(new Runnable(){
        public void run(){
          if (mGraphView != null)           mGraphView.setVisibility(View.INVISIBLE);
        }
      }
);
      mCameraDevice.setHistogramMode(null);
    }
  }
  setFlipValue();
  String aeBracket=mParameters.get(CameraSettings.KEY_QC_AE_BRACKETING);
  if (aeBracket != null && !aeBracket.equalsIgnoreCase("String_Node_Str")) {
    String fMode=Parameters.FLASH_MODE_OFF;
    mParameters.setFlashMode(fMode);
  }
  if (!mFocusManager.getFocusMode().equals(Parameters.FOCUS_MODE_CONTINUOUS_PICTURE) && !mFocusManager.isFocusCompleted()) {
    mUI.clearFocus();
  }
  String bokehMode=mPreferences.getString(CameraSettings.KEY_BOKEH_MODE,mActivity.getString(R.string.pref_camera_bokeh_mode_default));
  String bokehMpo=mPreferences.getString(CameraSettings.KEY_BOKEH_MPO,mActivity.getString(R.string.pref_camera_bokeh_mpo_default));
  String bokehBlurDegree=mPreferences.getString(CameraSettings.KEY_BOKEH_BLUR_VALUE,mActivity.getString(R.string.pref_camera_bokeh_blur_degree_default));
  CameraSettings.getSupportedDegreesOfBlur(mParameters);
  if (!bokehMode.equals(mActivity.getString(R.string.pref_camera_bokeh_mode_entry_value_disable))) {
    if (!zsl.equals("String_Node_Str")) {
      ParametersWrapper.setZSLMode(mParameters,"String_Node_Str");
    }
    if (mParameters.getSceneMode() != Parameters.SCENE_MODE_AUTO) {
      mParameters.setSceneMode(Parameters.SCENE_MODE_AUTO);
    }
    if (mParameters.getFlashMode() != Parameters.FLASH_MODE_OFF) {
      mParameters.setFlashMode(Parameters.FLASH_MODE_OFF);
    }
    if (mParameters.get("String_Node_Str").equals(mActivity.getString(R.string.setting_on_value))) {
      mParameters.set("String_Node_Str",mActivity.getString(R.string.setting_off_value));
    }
    if (mManual3AEnabled != 0) {
      mManual3AEnabled=0;
    }
    final SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(mActivity);
    final int degree=prefs.getInt(CameraSettings.KEY_BOKEH_BLUR_VALUE,50);
    bokehBlurDegree=String.valueOf(degree);
    mActivity.runOnUiThread(new Runnable(){
      @Override public void run(){
        mUI.overrideSettings(CameraSettings.KEY_SCENE_MODE,mActivity.getString(R.string.pref_camera_scenemode_default));
        mUI.overrideSettings(CameraSettings.KEY_ZSL,mActivity.getString(R.string.pref_camera_zsl_value_on));
        mUI.overrideSettings(CameraSettings.KEY_FLASH_MODE,"String_Node_Str");
        mUI.overrideSettings(CameraSettings.KEY_LONGSHOT,mActivity.getString(R.string.pref_camera_longshot_default));
        mBlurDegreeProgressBar.setVisibility(View.VISIBLE);
        mBlurDegreeProgressBar.setProgress(degree);
      }
    }
);
  }
 else {
    bokehBlurDegree="String_Node_Str";
    mActivity.runOnUiThread(new Runnable(){
      @Override public void run(){
        mUI.overrideSettings(CameraSettings.KEY_BOKEH_MPO,mActivity.getString(R.string.pref_camera_bokeh_mpo_default));
        mUI.overrideSettings(CameraSettings.KEY_BOKEH_BLUR_VALUE,mActivity.getString(R.string.pref_camera_bokeh_blur_degree_default));
        mBlurDegreeProgressBar.setVisibility(View.GONE);
      }
    }
);
  }
  mParameters.set(CameraSettings.KEY_QC_BOKEH_MODE,bokehMode);
  mParameters.set(CameraSettings.KEY_QC_BOKEH_MPO_MODE,bokehMpo);
  mParameters.set(CameraSettings.KEY_QC_BOKEH_BLUR_VALUE,bokehBlurDegree);
  Log.v(TAG,"String_Node_Str" + bokehMode + "String_Node_Str"+ bokehMpo+ "String_Node_Str"+ bokehBlurDegree);
}