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

Commit 23a405c0 authored by Pengquan Meng's avatar Pengquan Meng
Browse files

Add isManualNetworkSelectionAllowed api to telephonyManager

Bug: 111453847
Test: build
Merged-In: Icdd60ab03fee4b2e7a08dda3c5c127a19ecac7ce
Change-Id: Icdd60ab03fee4b2e7a08dda3c5c127a19ecac7ce
parent 61b9b6c9
Loading
Loading
Loading
Loading
+23 −0
Original line number Original line Diff line number Diff line
@@ -8400,6 +8400,29 @@ public class TelephonyManager {
        return false;
        return false;
    }
    }


    /**
     * Checks if manual network selection is allowed.
     *
     * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the
     * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultSubscriptionId()}.
     *
     * @return {@code true} if manual network selection is allowed, otherwise return {@code false}.
     *
     * @hide
     */
    @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
    public boolean isManualNetworkSelectionAllowed() {
        try {
            ITelephony telephony = getITelephony();
            if (telephony != null) {
                return telephony.isManualNetworkSelectionAllowed(getSubId());
            }
        } catch (RemoteException e) {
            Log.e(TAG, "Error calling ITelephony#isManualNetworkSelectionAllowed", e);
        }
        return true;
    }

    /**
    /**
     * Get the most recently available signal strength information.
     * Get the most recently available signal strength information.
     *
     *
+7 −0
Original line number Original line Diff line number Diff line
@@ -808,6 +808,13 @@ interface ITelephony {
     */
     */
    boolean isDataEnabled(int subId);
    boolean isDataEnabled(int subId);


     /**
     * Checks if manual network selection is allowed.
     *
     * @return {@code true} if manual network selection is allowed, otherwise return {@code false}.
     */
     boolean isManualNetworkSelectionAllowed(int subId);

    /**
    /**
     * Get P-CSCF address from PCO after data connection is established or modified.
     * Get P-CSCF address from PCO after data connection is established or modified.
     * @param apnType the apnType, "ims" for IMS APN, "emergency" for EMERGENCY APN
     * @param apnType the apnType, "ims" for IMS APN, "emergency" for EMERGENCY APN