Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b596a2c5 authored by Svetoslav's avatar Svetoslav
Browse files

Location settings not properly set.

Settings provider has special handling for location providers. The
code to set the location providers was calling itself recursively
instead of updating the setting value.

bug:19361236

Change-Id: I1ef1932c7faa8226b52123aa3f23f38048258328
parent 63f0a7d0
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -779,7 +779,7 @@ public class SettingsProvider extends ContentProvider {

        // Special cases for location providers (sigh).
        if (Settings.Secure.LOCATION_PROVIDERS_ALLOWED.equals(name)) {
            return updateLocationProvidersAllowed(value, owningUserId);
            return updateLocationProvidersAllowedLocked(value, owningUserId);
        }

        // Mutate the value.
@@ -1072,7 +1072,7 @@ public class SettingsProvider extends ContentProvider {
     *
     * @returns whether the enabled location providers changed.
     */
    private boolean updateLocationProvidersAllowed(String value, int owningUserId) {
    private boolean updateLocationProvidersAllowedLocked(String value, int owningUserId) {
        if (TextUtils.isEmpty(value)) {
            return false;
        }
@@ -1130,10 +1130,9 @@ public class SettingsProvider extends ContentProvider {
            return false;
        }

        updateSecureSettingLocked(Settings.Secure.LOCATION_PROVIDERS_ALLOWED,
                newProviders, owningUserId);

        return true;
        return mSettingsRegistry.insertSettingLocked(SettingsRegistry.SETTINGS_TYPE_SECURE,
                owningUserId, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, newProviders,
                getCallingPackage());
    }

    private void sendNotify(Uri uri, int userId) {