Skip to content

Commit

Permalink
PR #7977 from Guoping: [Android] Show advanced mode only when supported
Browse files Browse the repository at this point in the history
  • Loading branch information
maloel authored Dec 14, 2020
2 parents 6e5ba12 + 99d04aa commit 9f075b4
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,17 @@ private void loadSettingsList(final Device device){

final Map<Integer,String> settingsMap = new TreeMap<>();
settingsMap.put(INDEX_DEVICE_INFO,"Device info");
settingsMap.put(INDEX_ADVANCE_MODE,"Enable advanced mode");

if(device.supportsInfo(CameraInfo.ADVANCED_MODE)) {
if (device.isInAdvancedMode()) {
settingsMap.put(INDEX_ADVANCE_MODE, "Disable advanced mode");
settingsMap.put(INDEX_PRESETS, "Presets");
}
else {
settingsMap.put(INDEX_ADVANCE_MODE, "Enable advanced mode");
}
}

if(device.is(Extension.UPDATABLE)){
settingsMap.put(INDEX_UPDATE,"Firmware update");
try(Updatable fwud = device.as(Extension.UPDATABLE)){
Expand All @@ -136,11 +146,6 @@ private void loadSettingsList(final Device device){
}
}

if(device.supportsInfo(CameraInfo.ADVANCED_MODE) && device.isInAdvancedMode()){
settingsMap.put(INDEX_ADVANCE_MODE,"Disable advanced mode");
settingsMap.put(INDEX_PRESETS,"Presets");
}

if (areAdvancedFeaturesEnabled) {
SharedPreferences sharedPref = getSharedPreferences(getString(R.string.app_settings), Context.MODE_PRIVATE);
boolean fw_logging_enabled = sharedPref.getBoolean(getString(R.string.fw_logging), false);
Expand Down

0 comments on commit 9f075b4

Please sign in to comment.