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

Commit c6409f7a authored by Nathan Harold's avatar Nathan Harold Committed by Automerger Merge Worker
Browse files

Add WorkSource to updateServiceLocation am: e129deed am: a5825258

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1355909

Change-Id: I96a95aace815ac42c93372294b0dbfdd37798fa8
parents 83215fa0 a5825258
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1558,9 +1558,15 @@ public interface CommandsInterface {
     * location information (lac and/or cid) has changed.
     *
     * @param enable true to enable, false to disable
     * @param workSource calling WorkSource
     * @param response callback message
     */
    void setLocationUpdates(boolean enable, Message response);
    default void setLocationUpdates(boolean enable, WorkSource workSource, Message response) {}

    /**
     * To be deleted
     */
    default void setLocationUpdates(boolean enable, Message response) {}

    /**
     * Gets the default SMSC address.
+2 −2
Original line number Diff line number Diff line
@@ -2425,8 +2425,8 @@ public class GsmCdmaPhone extends Phone {
    }

    @Override
    public void updateServiceLocation() {
        mSST.enableSingleLocationUpdate();
    public void updateServiceLocation(WorkSource workSource) {
        mSST.enableSingleLocationUpdate(workSource);
    }

    @Override
+9 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.ResultReceiver;
import android.os.WorkSource;
import android.telecom.VideoProfile;
import android.telephony.ImsiEncryptionInfo;
import android.telephony.NetworkScanRequest;
@@ -812,8 +813,15 @@ public interface PhoneInternalInterface {

    /**
     * Update the ServiceState CellLocation for current network registration.
     *
     * @param workSource the caller to be billed for work.
     */
    default void updateServiceLocation(WorkSource workSource) {}

    /**
     * To be deleted.
     */
    void updateServiceLocation();
    default void updateServiceLocation() {}

    /**
     * Enable location update notifications.
+2 −2
Original line number Diff line number Diff line
@@ -3279,11 +3279,11 @@ public class RIL extends BaseCommands implements CommandsInterface {
    }

    @Override
    public void setLocationUpdates(boolean enable, Message result) {
    public void setLocationUpdates(boolean enable, WorkSource workSource, Message result) {
        IRadio radioProxy = getRadioProxy(result);
        if (radioProxy != null) {
            RILRequest rr = obtainRequest(RIL_REQUEST_SET_LOCATION_UPDATES, result,
                    mRILDefaultWorkSource);
                    workSource == null ? mRILDefaultWorkSource : workSource);

            if (RILJ_LOGD) {
                riljLog(rr.serialString() + "> "
+8 −5
Original line number Diff line number Diff line
@@ -1079,29 +1079,32 @@ public class ServiceStateTracker extends Handler {
    private boolean mWantContinuousLocationUpdates;
    private boolean mWantSingleLocationUpdate;

    public void enableSingleLocationUpdate() {
    /**
     * Request a single update of the device's current registered cell.
     */
    public void enableSingleLocationUpdate(WorkSource workSource) {
        if (mWantSingleLocationUpdate || mWantContinuousLocationUpdates) return;
        mWantSingleLocationUpdate = true;
        mCi.setLocationUpdates(true, obtainMessage(EVENT_LOCATION_UPDATES_ENABLED));
        mCi.setLocationUpdates(true, workSource, obtainMessage(EVENT_LOCATION_UPDATES_ENABLED));
    }

    public void enableLocationUpdates() {
        if (mWantSingleLocationUpdate || mWantContinuousLocationUpdates) return;
        mWantContinuousLocationUpdates = true;
        mCi.setLocationUpdates(true, obtainMessage(EVENT_LOCATION_UPDATES_ENABLED));
        mCi.setLocationUpdates(true, null, obtainMessage(EVENT_LOCATION_UPDATES_ENABLED));
    }

    protected void disableSingleLocationUpdate() {
        mWantSingleLocationUpdate = false;
        if (!mWantSingleLocationUpdate && !mWantContinuousLocationUpdates) {
            mCi.setLocationUpdates(false, null);
            mCi.setLocationUpdates(false, null, null);
        }
    }

    public void disableLocationUpdates() {
        mWantContinuousLocationUpdates = false;
        if (!mWantSingleLocationUpdate && !mWantContinuousLocationUpdates) {
            mCi.setLocationUpdates(false, null);
            mCi.setLocationUpdates(false, null, null);
        }
    }