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

Commit 78a90d08 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7714994 from b3a73d7e to sc-qpr1-release

Change-Id: Ia2d1a80266630b8cfde2b4ec424e7b5c4a75d3c6
parents fbcb2e2f b3a73d7e
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1598,6 +1598,17 @@ public interface CommandsInterface {
     */
    default void isNrDualConnectivityEnabled(Message message, WorkSource workSource) {}

    /**
     * Enable or disable Voice over NR (VoNR)
     * @param enabled enable or disable VoNR.
     */
    default void setVoNrEnabled(boolean enabled, Message message, WorkSource workSource) {}

    /**
     * Is voice over NR enabled
     */
    default void isVoNrEnabled(Message message, WorkSource workSource) {}

    /**
     * Request to enable/disable network state change notifications when
     * location information (lac and/or cid) has changed.
+15 −0
Original line number Diff line number Diff line
@@ -4648,6 +4648,21 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        mCi.setSimCardPower(state, result, workSource);
    }

    /**
     * Enable or disable Voice over NR (VoNR)
     * @param enabled enable or disable VoNR.
     **/
    public void setVoNrEnabled(boolean enabled, Message result, WorkSource workSource) {
        mCi.setVoNrEnabled(enabled, result, workSource);
    }

    /**
     * Is voice over NR enabled
     */
    public void isVoNrEnabled(Message message, WorkSource workSource) {
        mCi.isVoNrEnabled(message, workSource);
    }

    public void setCarrierTestOverride(String mccmnc, String imsi, String iccid, String gid1,
            String gid2, String pnn, String spn, String carrierPrivilegeRules, String apn) {
    }
+43 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.WorkSource;
import android.provider.Settings;
import android.service.carrier.CarrierIdentifier;
@@ -255,6 +256,8 @@ public class RIL extends BaseCommands implements CommandsInterface {

    final Integer mPhoneId;

    private static final String PROPERTY_IS_VONR_ENABLED = "persist.radio.is_vonr_enabled_";

    /**
     * A set that records if radio service is disabled in hal for
     * a specific phone id slot to avoid further getService request.
@@ -3576,6 +3579,46 @@ public class RIL extends BaseCommands implements CommandsInterface {
        }
    }

    private void setVoNrEnabled(boolean enabled) {
        SystemProperties.set(PROPERTY_IS_VONR_ENABLED + mPhoneId, String.valueOf(enabled));
    }

    private boolean isVoNrEnabled() {
        return SystemProperties.getBoolean(PROPERTY_IS_VONR_ENABLED + mPhoneId, true);
    }

    /**
     * Is voice over NR enabled
     */
    @Override
    public void isVoNrEnabled(Message result, WorkSource workSource) {
        boolean isEnabled = isVoNrEnabled();
        if (result != null) {
            AsyncResult.forMessage(result, isEnabled, null);
            result.sendToTarget();
        }
    }

    /**
     * Enable or disable Voice over NR (VoNR)
     * @param enabled enable or disable VoNR.
     */
    @Override
    public void setVoNrEnabled(boolean enabled, Message result, WorkSource workSource) {
        setVoNrEnabled(enabled);
        /* calling a query api to let HAL know that VoNREnabled state is updated.
           This is a temporary work around as new HIDL API is not allowed.
           HAL can check the value of PROPERTY_IS_VONR_ENABLED property to determine
           if there is any change whenever it receives isNrDualConnectivityEnabled request.
           This behavior will be removed in Android T.
         */
        isNrDualConnectivityEnabled(null, workSource);
        if (result != null) {
            AsyncResult.forMessage(result, null, null);
            result.sendToTarget();
        }
    }

    @Override
    public void setCdmaSubscriptionSource(int cdmaSubscription , Message result) {
        IRadio radioProxy = getRadioProxy(result);