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

Commit 4d8ae85b authored by Wink Saville's avatar Wink Saville
Browse files

Add needsOtaServiceProvisioning to Phone.

By having needsOtaServiceProvisioning supported on all phones we
eliminate the need to use an if statement to discriminate phone type.
Types of phones that don't support OTASP will return false in the
default implementation in PhoneBase.

Change-Id: I8fb15a18553e314c1f8f2a00ec7f8cffd79eeb7f
parent 2b4140ef
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1657,7 +1657,7 @@ public class AccountManagerService
                }
                boolean needsProvisioning;
                try {
                    needsProvisioning = telephony.getCdmaNeedsProvisioning();
                    needsProvisioning = telephony.needsOtaServiceProvisioning();
                } catch (RemoteException e) {
                    Log.w(TAG, "exception while checking provisioning", e);
                    // default to NOT wiping out the passwords
+4 −2
Original line number Diff line number Diff line
@@ -239,9 +239,11 @@ interface ITelephony {
    String getCdmaEriText();

    /**
     * Returns true if CDMA provisioning needs to run.
     * Returns true if OTA service provisioning needs to run.
     * Only relevant on some technologies, others will always
     * return false.
     */
    boolean getCdmaNeedsProvisioning();
    boolean needsOtaServiceProvisioning();

    /**
      * Returns the unread count of voicemails
+5 −0
Original line number Diff line number Diff line
@@ -1532,6 +1532,11 @@ public interface Phone {
     */
    boolean isOtaSpNumber(String dialStr);

    /**
     * Returns true if OTA Service Provisioning needs to be performed.
     */
    boolean needsOtaServiceProvisioning();

    /**
     * Register for notifications when CDMA call waiting comes
     *
+12 −2
Original line number Diff line number Diff line
@@ -824,9 +824,19 @@ public abstract class PhoneBase extends Handler implements Phone {
        logUnexpectedCdmaMethodCall("unregisterForSubscriptionInfoReady");
    }

    /**
     * Returns true if OTA Service Provisioning needs to be performed.
     * If not overridden return false.
     */
    public boolean needsOtaServiceProvisioning() {
        return false;
    }

    /**
     * Return true if number is an OTASP number.
     * If not overridden return false.
     */
    public  boolean isOtaSpNumber(String dialStr) {
        // This function should be overridden by the class CDMAPhone. Not implemented in GSMPhone.
        logUnexpectedCdmaMethodCall("isOtaSpNumber");
        return false;
    }

+4 −0
Original line number Diff line number Diff line
@@ -764,6 +764,10 @@ public class PhoneProxy extends Handler implements Phone {
        mActivePhone.exitEmergencyCallbackMode();
    }

    public boolean needsOtaServiceProvisioning(){
        return mActivePhone.needsOtaServiceProvisioning();
    }

    public boolean isOtaSpNumber(String dialStr){
        return mActivePhone.isOtaSpNumber(dialStr);
    }
Loading