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

Commit 567a727d authored by SongFerng Wang's avatar SongFerng Wang Committed by Automerger Merge Worker
Browse files

Merge "VoNR toggle" into sc-qpr1-dev am: f36dd3cc

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15645594

Change-Id: I5ce25048e062947f1192b820b5c50b1bc744a7ac
parents bf989b80 f36dd3cc
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -5160,6 +5160,16 @@ public class CarrierConfigManager {
    public static final String KEY_DISPLAY_NO_DATA_NOTIFICATION_ON_PERMANENT_FAILURE_BOOL =
            "display_no_data_notification_on_permanent_failure_bool";

    /**
     * Boolean indicating if the VoNR setting is visible in the Call Settings menu.
     * If true, the VoNR setting menu will be visible. If false, the menu will be gone.
     *
     * Disabled by default.
     *
     * @hide
     */
    public static final String KEY_VONR_SETTING_VISIBILITY_BOOL = "vonr_setting_visibility_bool";

    /**
     * Determine whether unthrottle data retry when tracking area code (TAC/LAC) from cell changes
     *
@@ -5774,6 +5784,7 @@ public class CarrierConfigManager {
        sDefaults.putString(KEY_CARRIER_PROVISIONING_APP_STRING, "");
        sDefaults.putBoolean(KEY_DISPLAY_NO_DATA_NOTIFICATION_ON_PERMANENT_FAILURE_BOOL, false);
        sDefaults.putBoolean(KEY_UNTHROTTLE_DATA_RETRY_WHEN_TAC_CHANGES_BOOL, false);
        sDefaults.putBoolean(KEY_VONR_SETTING_VISIBILITY_BOOL, false);
    }

    /**
+94 −0
Original line number Diff line number Diff line
@@ -12143,6 +12143,100 @@ public class TelephonyManager {
        }
    }
    /**
     * No error. Operation succeeded.
     * @hide
     */
    public static final int ENABLE_VONR_SUCCESS = 0;
    /**
     * Radio is not available.
     * @hide
     */
    public static final int ENABLE_VONR_RADIO_NOT_AVAILABLE = 2;
    /**
     * Internal Radio error.
     * @hide
     */
    public static final int ENABLE_VONR_RADIO_ERROR = 3;
    /**
     * Voice over NR enable/disable request is received when system is in invalid state.
     * @hide
     */
    public static final int ENABLE_VONR_RADIO_INVALID_STATE = 4;
    /**
     * Voice over NR enable/disable request is not supported.
     * @hide
     */
    public static final int ENABLE_VONR_REQUEST_NOT_SUPPORTED = 5;
    /** @hide */
    @Retention(RetentionPolicy.SOURCE)
    @IntDef(prefix = {"EnableVoNrResult"}, value = {
            ENABLE_VONR_SUCCESS,
            ENABLE_VONR_RADIO_NOT_AVAILABLE,
            ENABLE_VONR_RADIO_ERROR,
            ENABLE_VONR_RADIO_INVALID_STATE,
            ENABLE_VONR_REQUEST_NOT_SUPPORTED})
    public @interface EnableVoNrResult {}
    /**
     * Enable or disable Voice over NR (VoNR)
     *
     * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the
     * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultDataSubscriptionId()}
     *
     * <p>Requires Permission:
     * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}.
     *
     * @param enabled  enable or disable VoNR.
     * @throws IllegalStateException if the Telephony process is not currently available.
     * @hide
     */
    @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
    public @EnableVoNrResult int setVoNrEnabled(boolean enabled) {
        try {
            ITelephony service = getITelephony();
            if (service != null) {
                return service.setVoNrEnabled(
                        getSubId(SubscriptionManager.getDefaultDataSubscriptionId()), enabled);
            } else {
                throw new IllegalStateException("telephony service is null.");
            }
        } catch (RemoteException e) {
            Log.e(TAG, "Error calling ITelephony#setVoNrEnabled", e);
        }
        return ENABLE_VONR_RADIO_INVALID_STATE;
    }
    /**
     * Is Voice over NR (VoNR) enabled.
     * @return true if Voice over NR (VoNR) is enabled else false. Enabled state does not mean
     *  voice call over NR is active or voice ove NR is available. It means the device is allowed to
     *  register IMS over NR.
     * @throws IllegalStateException if the Telephony process is not currently available.
     * @hide
     */
    @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
    public boolean isVoNrEnabled() {
        try {
            ITelephony telephony = getITelephony();
            if (telephony != null) {
                return telephony.isVoNrEnabled(getSubId());
            } else {
                throw new IllegalStateException("telephony service is null.");
            }
        } catch (RemoteException ex) {
            Rlog.e(TAG, "isVoNrEnabled RemoteException", ex);
            ex.rethrowFromSystemServer();
        }
        return false;
    }
    /**
     * Carrier action to start or stop reporting default network available events.
     *
+14 −0
Original line number Diff line number Diff line
@@ -2227,6 +2227,20 @@ interface ITelephony {
     */
    List<String> getEquivalentHomePlmns(int subId, String callingPackage, String callingFeatureId);

    /**
     * Enable or disable Voice over NR (VoNR)
     * @param subId the subscription ID that this action applies to.
     * @param enabled enable or disable VoNR.
     * @return operation result.
     */
    int setVoNrEnabled(int subId, boolean enabled);

    /**
     * Is voice over NR enabled
     * @return true if VoNR is enabled else false
     */
    boolean isVoNrEnabled(int subId);

    /**
     * Enable/Disable E-UTRA-NR Dual Connectivity
     * @return operation result. See TelephonyManager.EnableNrDualConnectivityResult for
+2 −0
Original line number Diff line number Diff line
@@ -528,6 +528,8 @@ public interface RILConstants {
    int RIL_REQUEST_SET_ALLOWED_NETWORK_TYPES_BITMAP = 222;
    int RIL_REQUEST_GET_ALLOWED_NETWORK_TYPES_BITMAP = 223;
    int RIL_REQUEST_GET_SLICING_CONFIG = 224;
    int RIL_REQUEST_ENABLE_VONR = 225;
    int RIL_REQUEST_IS_VONR_ENABLED = 225;

    /* Responses begin */
    int RIL_RESPONSE_ACKNOWLEDGEMENT = 800;