Skip to content

Commit bdc7f89

Browse files
committed
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>
1 parent e3491b6 commit bdc7f89

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,12 @@ private boolean parseProviderList(Uri url, ContentValues initialValues) {
305305
}
306306
} else if (prefix == '-' && index >= 0) {
307307
// remove the provider from the list if present
308-
// remove leading and trailing commas
309-
if (index > 0) index--;
310-
if (end < providers.length()) end++;
308+
// remove leading or trailing comma
309+
if (index > 0) {
310+
index--;
311+
} else if (end < providers.length()) {
312+
end++;
313+
}
311314

312315
newProviders = providers.substring(0, index);
313316
if (end < providers.length()) {

0 commit comments

Comments
 (0)