/** * Removes a configuration from a given user {@link LayoutDevice} * * @param device the device to modify * @param configName the name of the config to remove */ public void removeUserConfiguration(LayoutDevice device, String configName) { // check that the device does belong to the user list. // the main goal is to make sure that this does not belong to the default/addon list. if (mUserLayoutDevices.contains(device)) { device.removeConfig(configName); } }
/** * Replaces a configuration in a given {@link LayoutDevice}. * * @param device the device to modify * @param oldConfigName the name of the config to replace. If null, the new config is simply * added. * @param newConfigName the configuration name to add or replace * @param config the configuration to set */ public void replaceUserConfiguration( LayoutDevice device, String oldConfigName, String newConfigName, FolderConfiguration config) { // check that the device does belong to the user list. // the main goal is to make sure that this does not belong to the default/addon list. if (mUserLayoutDevices.contains(device)) { // if the old and new config name are different, remove the old one if (oldConfigName != null && oldConfigName.equals(newConfigName) == false) { device.removeConfig(oldConfigName); } // and then add the new one device.addConfig(newConfigName, config); } }