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

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

Make getDataEnabled take more into account.

getDataEnabled and getAnyDataEnabled ignored mMasterDataEnabled.
bug: 2216392

Change-Id: Ic3ae0808d2a02057ddf5056d3e01f754f2e57f5c
parent 5c7d5ae0
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -478,7 +478,7 @@ public abstract class DataConnectionTracker extends Handler {
     *         {@code true} otherwise.
     */
    public synchronized boolean getDataEnabled() {
        return dataEnabled[APN_DEFAULT_ID];
        return (mMasterDataEnabled && dataEnabled[APN_DEFAULT_ID]);
    }

    /**
@@ -487,8 +487,8 @@ public abstract class DataConnectionTracker extends Handler {
     * @return {@code false} if data connectivity has been explicitly disabled,
     *         {@code true} otherwise.
     */
    public boolean getAnyDataEnabled() {
        return (enabledCount != 0);
    public synchronized boolean getAnyDataEnabled() {
        return (mMasterDataEnabled && (enabledCount != 0));
    }

    protected abstract void startNetStatPoll();
@@ -832,7 +832,9 @@ public abstract class DataConnectionTracker extends Handler {

    protected void onSetDataEnabled(boolean enable) {
        if (mMasterDataEnabled != enable) {
            synchronized (this) {
                mMasterDataEnabled = enable;
            }
            if (enable) {
                mRetryMgr.resetRetryCount();
                onTrySetupData(Phone.REASON_DATA_ENABLED);