Fix broken logic in SettingsProvider.parseProviderList.

We were accidentally stripping both leading and trailing commas
when removing a provider from the enabled provider list.

Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
Mike Lockwood
2010-04-21 18:24:57 -04:00
parent e3491b6b5f
commit bdc7f891cf

View File

@@ -305,9 +305,12 @@ public class SettingsProvider extends ContentProvider {
}
} else if (prefix == '-' && index >= 0) {
// remove the provider from the list if present
// remove leading and trailing commas
if (index > 0) index--;
if (end < providers.length()) end++;
// remove leading or trailing comma
if (index > 0) {
index--;
} else if (end < providers.length()) {
end++;
}
newProviders = providers.substring(0, index);
if (end < providers.length()) {