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

Commit 5552cc5c authored by Shishir Agrawal's avatar Shishir Agrawal Committed by Android (Google) Code Review
Browse files

Merge "Adding the ability for carrier app to override SPN and carrier name." into lmp-dev

parents 4a79daea 86578cca
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -29182,6 +29182,7 @@ package android.telephony {
    method public boolean setCdmaSubscription(int);
    method public void setLine1NumberForDisplay(java.lang.String, java.lang.String);
    method public void setLine1NumberForDisplay(long, java.lang.String, java.lang.String);
    method public boolean setOperatorBrandOverride(java.lang.String, java.lang.String);
    method public boolean setPreferredNetworkType(int);
    field public static final java.lang.String ACTION_PHONE_STATE_CHANGED = "android.intent.action.PHONE_STATE";
    field public static final java.lang.String ACTION_RESPOND_VIA_MESSAGE = "android.intent.action.RESPOND_VIA_MESSAGE";
+28 −0
Original line number Diff line number Diff line
@@ -2933,6 +2933,34 @@ public class TelephonyManager {
        return CARRIER_PRIVILEGE_STATUS_NO_ACCESS;
    }

    /**
     * Override the branding for the input ICCID.
     *
     * Once set, whenever the ICCID is inserted into the device, the service
     * provider name (SPN) and the operator name will both be replaced by the
     * brand value input. To unset the value, the same function should be
     * called with a null brand value.
     *
     * <p>Requires Permission:
     *   {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
     *  or has to be carrier app - see #hasCarrierPrivileges.
     *
     * @param iccId The ICCID of that the branding applies to.
     * @param brand The brand name to display/set.
     * @return true if the operation was executed correctly.
     */
    public boolean setOperatorBrandOverride(String iccId, String brand) {
        // TODO: Validate ICCID format.
        try {
            return getITelephony().setOperatorBrandOverride(iccId, brand);
        } catch (RemoteException ex) {
            Rlog.e(TAG, "setOperatorBrandOverride RemoteException", ex);
        } catch (NullPointerException ex) {
            Rlog.e(TAG, "setOperatorBrandOverride NPE", ex);
        }
        return false;
    }

    /**
     * Expose the rest of ITelephony to @SystemApi
     */
+18 −0
Original line number Diff line number Diff line
@@ -706,5 +706,23 @@ interface ITelephony {
     *         not set.
     */
    String getLine1AlphaTagForDisplay(long subId);

    /**
     * Override the operator branding for the input ICCID.
     *
     * Once set, whenever the ICCID is inserted into the device, the service
     * provider name (SPN) and the operator name will both be replaced by the
     * brand value input. To unset the value, the same function should be
     * called with a null brand value.
     *
     * <p>Requires Permission:
     *   {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
     *  or has to be carrier app - see #hasCarrierPrivileges.
     *
     * @param iccid The ICCID of that the branding applies to.
     * @param brand The brand name to display/set.
     * @return true if the operation was executed correctly.
     */
    boolean setOperatorBrandOverride(String iccId, String brand);
}