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

Commit db4afae7 authored by Robert Greenwalt's avatar Robert Greenwalt
Browse files

Fixing the write of BackgroundData setting.

I outsmarted myself trying to minimize writes and caused no writes to occur.

bug:3485934
Change-Id: I292e6837d29903a21abb6e001d25d96a4cdc18ec
parent 66d16910
Loading
Loading
Loading
Loading
+5 −7
Original line number Original line Diff line number Diff line
@@ -989,14 +989,12 @@ public class ConnectivityService extends IConnectivityManager.Stub {
    }
    }


    private void handleSetBackgroundData(boolean enabled) {
    private void handleSetBackgroundData(boolean enabled) {
        if (enabled != getBackgroundDataSetting()) {
        Settings.Secure.putInt(mContext.getContentResolver(),
        Settings.Secure.putInt(mContext.getContentResolver(),
                Settings.Secure.BACKGROUND_DATA, enabled ? 1 : 0);
                Settings.Secure.BACKGROUND_DATA, enabled ? 1 : 0);
        Intent broadcast = new Intent(
        Intent broadcast = new Intent(
                ConnectivityManager.ACTION_BACKGROUND_DATA_SETTING_CHANGED);
                ConnectivityManager.ACTION_BACKGROUND_DATA_SETTING_CHANGED);
        mContext.sendBroadcast(broadcast);
        mContext.sendBroadcast(broadcast);
    }
    }
    }


    /**
    /**
     * @see ConnectivityManager#getMobileDataEnabled()
     * @see ConnectivityManager#getMobileDataEnabled()