/** * @return all settings in a map */ public Map<String, Object> getPropertiesMap() { final Map<String, Object> allSettings = new HashMap<String, Object>(); for (Iterator<String> it = props.getKeys(); it.hasNext();) { String key = it.next(); DroidGlobalProperty property = DroidGlobalProperty.forName(key); if (property != null) { allSettings.put(key, property.getType().getTypeSafeValue(props, key)); } } // BNO: To note - The available hash algorithms are better hard coded here than in the // droid.properties file since the list is not user configurable. However, the existing droid.properties // profile.hashAlgorithm can still be used to indicate the default selection. List<String> availableHashAlgorithms = new ArrayList<String>(); availableHashAlgorithms.add("md5"); availableHashAlgorithms.add("sha1"); availableHashAlgorithms.add("sha256"); allSettings.put(AVAILABLE_HASH_ALGORITHMS, availableHashAlgorithms); return allSettings; }
/** * @return all settings in a map */ public Map<String, Object> getPropertiesMap() { final Map<String, Object> allSettings = new HashMap<String, Object>(); for (Iterator<String> it = props.getKeys(); it.hasNext();) { String key = it.next(); DroidGlobalProperty property = DroidGlobalProperty.forName(key); if (property != null) { allSettings.put(key, property.getType().getTypeSafeValue(props, key)); } } // BNO: To note - The available hash algorithms are better hard coded here than in the // droid.properties file since the list is not user configurable. However, the existing droid.properties // profile.hashAlgorithm can still be used to indicate the default selection. List<String> availableHashAlgorithms = new ArrayList<String>(); availableHashAlgorithms.add("md5"); availableHashAlgorithms.add("sha1"); availableHashAlgorithms.add("sha256"); allSettings.put(AVAILABLE_HASH_ALGORITHMS, availableHashAlgorithms); return allSettings; }
/** * {@inheritDoc} */ @Override public void configurationChanged(ConfigurationEvent event) { final String propertyName = event.getPropertyName(); if (propertyName.startsWith("update.proxy")) { DroidGlobalProperty property = DroidGlobalProperty.forName(propertyName); switch (property) { case UPDATE_PROXY_HOST: setProxyHost((String) event.getPropertyValue()); break; case UPDATE_PROXY_PORT: setProxyPort((Integer) event.getPropertyValue()); break; case UPDATE_USE_PROXY: setEnabled((Boolean) event.getPropertyValue()); break; default: log.error(String.format("Invalid proxy setting [%s]", propertyName)); } notifyProxySubscribers(); } }
/** * {@inheritDoc} */ @Override public void configurationChanged(ConfigurationEvent event) { final String propertyName = event.getPropertyName(); if (propertyName.startsWith("update.proxy")) { DroidGlobalProperty property = DroidGlobalProperty.forName(propertyName); switch (property) { case UPDATE_PROXY_HOST: setProxyHost((String) event.getPropertyValue()); break; case UPDATE_PROXY_PORT: setProxyPort((Integer) event.getPropertyValue()); break; case UPDATE_USE_PROXY: setEnabled((Boolean) event.getPropertyValue()); break; default: log.error(String.format("Invalid proxy setting [%s]", propertyName)); } notifyProxySubscribers(); } }