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

Commit 323d5f9f authored by zoey chen's avatar zoey chen
Browse files

[Settings] Modified the return value.

Returns true if the value of #isDataAllowedInVoiceCall is set to the parameter, false otherwise.

Bug: 146107006
Test: make
Change-Id: I36204b4814a1fe92d5de69054b850da330c04a87
Merged-In: I36204b4814a1fe92d5de69054b850da330c04a87
parent 44aede06
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -340,7 +340,10 @@ public class DataEnabledOverride {
    }

    /**
     * Set allowing mobile data during voice call.
     * Set allowing mobile data during voice call. This is used for allowing data on the non-default
     * data SIM. When a voice call is placed on the non-default data SIM on DSDS devices, users will
     * not be able to use mobile data. By calling this API, data will be temporarily enabled on the
     * non-default data SIM during the life cycle of the voice call.
     *
     * @param allow {@code true} if allowing using data during voice call, {@code false} if
     * disallowed.
+9 −2
Original line number Diff line number Diff line
@@ -264,16 +264,23 @@ public class DataEnabledSettings {
    }

    /**
     * Set allowing mobile data during voice call.
     * Set allowing mobile data during voice call. This is used for allowing data on the non-default
     * data SIM. When a voice call is placed on the non-default data SIM on DSDS devices, users will
     * not be able to use mobile data. By calling this API, data will be temporarily enabled on the
     * non-default data SIM during the life cycle of the voice call.
     *
     * @param allow {@code true} if allowing using data during voice call, {@code false} if
     * disallowed
     *
     * @return {@code false} if the setting is changed.
     * @return {@code true} if operation is successful. otherwise {@code false}.
     */
    public synchronized boolean setAllowDataDuringVoiceCall(boolean allow) {
        localLog("setAllowDataDuringVoiceCall", allow);
        if (allow == isDataAllowedInVoiceCall()) {
            return true;
        }
        mDataEnabledOverride.setDataAllowedInVoiceCall(allow);

        boolean changed = SubscriptionController.getInstance()
                .setDataEnabledOverrideRules(mPhone.getSubId(), mDataEnabledOverride.getRules());
        if (changed) {