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

Commit 862821ed authored by Michele Berionne's avatar Michele Berionne Committed by Gerrit Code Review
Browse files

Merge "Add checks on multisim capabilities."

parents 9f0115bb c5e6e54a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -43089,6 +43089,7 @@ package android.telephony {
    method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_NETWORK_STATE, android.Manifest.permission.MODIFY_PHONE_STATE}) public boolean isDataEnabled();
    method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_NETWORK_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isDataRoamingEnabled();
    method public boolean isHearingAidCompatibilitySupported();
    method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean isMultisimSupported();
    method public boolean isNetworkRoaming();
    method public boolean isRttSupported();
    method public boolean isSmsCapable();
+0 −1
Original line number Diff line number Diff line
@@ -6369,7 +6369,6 @@ package android.telephony {
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isCurrentPotentialEmergencyNumber(@NonNull String);
    method public boolean isDataConnectivityPossible();
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isIdle();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isMultisimCarrierRestricted();
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isOffhook();
    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRadioOn();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isRebootRequiredForModemConfigChange();
+12 −11
Original line number Diff line number Diff line
@@ -10219,24 +10219,25 @@ public class TelephonyManager {

    /**
     * Returns if the usage of multiple SIM cards at the same time to register on the network
     * (e.g. Dual Standby or Dual Active) is restricted.
     * (e.g. Dual Standby or Dual Active) is supported by the device and by the carrier.
     *
     * @return true if usage of multiple SIMs is restricted, false otherwise.
     * <p>Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
     * or that the calling app has carrier privileges (see {@link #hasCarrierPrivileges}).
     *
     * @hide
     * @return true if usage of multiple SIMs is supported, false otherwise.
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
    public boolean isMultisimCarrierRestricted() {
    @SuppressAutoDoc // Blocked by b/72967236 - no support for carrier privileges
    @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
    public boolean isMultisimSupported() {
        try {
            ITelephony service = getITelephony();
            if (service != null) {
                return service.isMultisimCarrierRestricted();
                return service.isMultisimSupported(getOpPackageName());
            }
        } catch (RemoteException e) {
            Log.e(TAG, "isMultisimCarrierRestricted RemoteException", e);
            Log.e(TAG, "isMultisimSupported RemoteException", e);
        }
        return true;
        return false;
    }

    /**
@@ -10272,8 +10273,8 @@ public class TelephonyManager {
    @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
    public void switchMultiSimConfig(int numOfSims) {
        //only proceed if multi-sim is not restricted
        if (isMultisimCarrierRestricted()) {
            Rlog.e(TAG, "switchMultiSimConfig not possible. It is restricted.");
        if (!isMultisimSupported()) {
            Rlog.e(TAG, "switchMultiSimConfig not possible. It is restricted or not supported.");
            return;
        }

+5 −3
Original line number Diff line number Diff line
@@ -1826,10 +1826,12 @@ interface ITelephony {
    void setMultisimCarrierRestriction(boolean isMultisimCarrierRestricted);

    /**
     * Returns if the usage of multiple SIM cards at the same time is restricted.
     * @hide
     * Returns if the usage of multiple SIM cards at the same time is supported.
     *
     * @param callingPackage The package making the call.
     * @return true if multisim is supported, false otherwise.
     */
    boolean isMultisimCarrierRestricted();
    boolean isMultisimSupported(String callingPackage);

    /**
     * Switch configs to enable multi-sim or switch back to single-sim
+3 −4
Original line number Diff line number Diff line
@@ -198,8 +198,7 @@ public interface TelephonyProperties
     * Property to indicate if reboot is required when changing modems configurations
     * Type:  String(true, false) default is false; most devices don't need reboot
     */
    String PROPERTY_REBOOT_REQUIRED_ON_MODEM_CHANGE =
             "persist.radio.reboot_on_modem_change";
    String PROPERTY_REBOOT_REQUIRED_ON_MODEM_CHANGE = "persist.radio.reboot_on_modem_change";

    /**
     * Property to store default subscription.