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

Commit f47c6488 authored by Junda Liu's avatar Junda Liu Committed by Android (Google) Code Review
Browse files

Merge "Add multi-sim support for getCarrierPackageNamesForIntent."

parents 5f6f559a 0ff9fd87
Loading
Loading
Loading
Loading
+9 −3
Original line number Original line Diff line number Diff line
@@ -3632,14 +3632,20 @@ public class TelephonyManager {
    /** @hide */
    /** @hide */
    @SystemApi
    @SystemApi
    public List<String> getCarrierPackageNamesForIntent(Intent intent) {
    public List<String> getCarrierPackageNamesForIntent(Intent intent) {
        return getCarrierPackageNamesForIntentAndPhone(intent, getDefaultPhone());
    }

    /** @hide */
    @SystemApi
    public List<String> getCarrierPackageNamesForIntentAndPhone(Intent intent, int phoneId) {
        try {
        try {
            ITelephony telephony = getITelephony();
            ITelephony telephony = getITelephony();
            if (telephony != null)
            if (telephony != null)
                return telephony.getCarrierPackageNamesForIntent(intent);
                return telephony.getCarrierPackageNamesForIntentAndPhone(intent, phoneId);
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            Rlog.e(TAG, "getCarrierPackageNamesForIntent RemoteException", ex);
            Rlog.e(TAG, "getCarrierPackageNamesForIntentAndPhone RemoteException", ex);
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
            Rlog.e(TAG, "getCarrierPackageNamesForIntent NPE", ex);
            Rlog.e(TAG, "getCarrierPackageNamesForIntentAndPhone NPE", ex);
        }
        }
        return null;
        return null;
    }
    }
+5 −4
Original line number Original line Diff line number Diff line
@@ -744,15 +744,16 @@ interface ITelephony {
    int checkCarrierPrivilegesForPackage(String pkgname);
    int checkCarrierPrivilegesForPackage(String pkgname);


    /**
    /**
     * Returns the package name of the carrier apps that should handle the input intent.
     * Returns list of the package names of the carrier apps that should handle the input intent
     * and have carrier privileges for the given phoneId.
     *
     *
     * @param packageManager PackageManager for getting receivers.
     * @param intent Intent that will be sent.
     * @param intent Intent that will be sent.
     * @return list of carrier app package names that can handle the intent.
     * @param phoneId The phoneId on which the carrier app has carrier privileges.
     * @return list of carrier app package names that can handle the intent on phoneId.
     *         Returns null if there is an error and an empty list if there
     *         Returns null if there is an error and an empty list if there
     *         are no matching packages.
     *         are no matching packages.
     */
     */
    List<String> getCarrierPackageNamesForIntent(in Intent intent);
    List<String> getCarrierPackageNamesForIntentAndPhone(in Intent intent, int phoneId);


    /**
    /**
     * Set the line 1 phone number string and its alphatag for the current ICCID
     * Set the line 1 phone number string and its alphatag for the current ICCID