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

Commit 9faf13b4 authored by Nancy Chen's avatar Nancy Chen Committed by Android (Google) Code Review
Browse files

Merge "Add API method to extract subscription ID from phone account (1/3)" into lmp-sprout-dev

parents 09ba0da8 b0cad32c
Loading
Loading
Loading
Loading
+44 −0
Original line number Original line Diff line number Diff line
@@ -322,6 +322,50 @@ public class TelecomManager {
        }
        }
    }
    }


    /**
     * Return the corresponding PhoneAccount id of a given subscription id.
     *
     * @param subscriptionId The value of the subscription id the caller is trying to get a phone
     * account id for.
     * @return A string representing the phone account id or null.
     *
     * @hide
     */
    @SystemApi
    public String getPhoneAccountIdForSubscriptionId(long subscriptionId) {
        try {
            if (isServiceConnected()) {
                return getTelecomService().getPhoneAccountIdForSubscriptionId(subscriptionId);
            }
        } catch (RemoteException e) {
            Log.e(TAG, "Error calling ITelecomService#getSubscriptionIdForPhoneAccount", e);
        }
        return null;
    }

    /**
     * Return the subscription id of the PhoneAccount if it exists. This only applies to PSTN
     * or SIM-based phone accounts. Return -1 otherwise.
     *
     * @param accountHandle The {@link PhoneAccountHandle} the caller is trying to get the
     * subscription id for.
     * @return The subscription id (a long) or -1 if the phone account is not a SIM or
     * a subscription id does not exist.
     *
     * @hide
     */
    @SystemApi
    public long getSubscriptionIdForPhoneAccount(PhoneAccountHandle accountHandle) {
        try {
            if (isServiceConnected()) {
                return getTelecomService().getSubscriptionIdForPhoneAccount(accountHandle);
            }
        } catch (RemoteException e) {
            Log.e(TAG, "Error calling ITelecomService#getSubscriptionIdForPhoneAccount", e);
        }
        return -1;
    }

    /**
    /**
     * Return the {@link PhoneAccount} which is the user-chosen default for making outgoing phone
     * Return the {@link PhoneAccount} which is the user-chosen default for making outgoing phone
     * calls with a specified URI scheme.
     * calls with a specified URI scheme.
+10 −0
Original line number Original line Diff line number Diff line
@@ -34,6 +34,16 @@ interface ITelecomService {
     */
     */
    void showInCallScreen(boolean showDialpad);
    void showInCallScreen(boolean showDialpad);


    /**
     * @see TelecomServiceImpl#getPhoneAccountIdForSubscriptionId
     */
    String getPhoneAccountIdForSubscriptionId(in long subscriptionId);

    /**
     * @see TelecomServiceImpl#getSubscriptionIdForPhoneAccount
     */
    long getSubscriptionIdForPhoneAccount(in PhoneAccountHandle account);

    /**
    /**
     * @see TelecomServiceImpl#getDefaultOutgoingPhoneAccount
     * @see TelecomServiceImpl#getDefaultOutgoingPhoneAccount
     */
     */