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

Commit 4792d0bd authored by Sandeep Gutta's avatar Sandeep Gutta Committed by Linux Build Service Account
Browse files

MSIM: voice/sms subscription related API changes.

 - Add APIs to get/set the default sms subscription
 - Add APIs to get/set Voice/SMS prompt mode status

Conflicts:
telephony/java/android/telephony/SubscriptionManager.java
Change-Id: I7f06a1f45d59c617e07c1b142a11828f7cda944b
parent 5eeb0ce2
Loading
Loading
Loading
Loading
+47 −0
Original line number Original line Diff line number Diff line
@@ -791,6 +791,30 @@ public class SubscriptionManager implements BaseColumns {
        return getPhoneId(getDefaultVoiceSubId());
        return getPhoneId(getDefaultVoiceSubId());
    }
    }


    public static boolean isSMSPromptEnabled() {
        try {
            ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
            if (iSub != null) {
                return iSub.isSMSPromptEnabled();
            }
        } catch (RemoteException ex) {
         // ignore it
        }
        return false;
    }

    public static void setSMSPromptEnabled(boolean enabled) {
        try {
            ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
            if (iSub != null) {
                iSub.setSMSPromptEnabled(enabled);
            }
        } catch (RemoteException ex) {
         // ignore it
        }
    }

    /** @hide */
    /**
    /**
     * @return subId of the DefaultSms subscription or the value INVALID_SUB_ID if an error.
     * @return subId of the DefaultSms subscription or the value INVALID_SUB_ID if an error.
     * @hide - to be unhidden
     * @hide - to be unhidden
@@ -990,5 +1014,28 @@ public class SubscriptionManager implements BaseColumns {
        return subId;
        return subId;


    }
    }

    public static boolean isVoicePromptEnabled() {
        try {
            ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
            if (iSub != null) {
                return iSub.isVoicePromptEnabled();
            }
        } catch (RemoteException ex) {
         // ignore it
        }
        return false;
    }

    public static void setVoicePromptEnabled(boolean enabled) {
        try {
            ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
            if (iSub != null) {
                iSub.setVoicePromptEnabled(enabled);
            }
        } catch (RemoteException ex) {
         // ignore it
        }
    }
}
}
+0 −12
Original line number Original line Diff line number Diff line
@@ -553,12 +553,6 @@ interface ISms {
     */
     */
    boolean isImsSmsSupportedForSubscriber(long subId);
    boolean isImsSmsSupportedForSubscriber(long subId);


    /*
     * get user prefered SMS subId
     * @return subId id
     */
    long getPreferredSmsSubscription();

    /**
    /**
     * Gets SMS format supported on IMS.  SMS over IMS format is
     * Gets SMS format supported on IMS.  SMS over IMS format is
     * either 3GPP or 3GPP2.
     * either 3GPP or 3GPP2.
@@ -583,12 +577,6 @@ interface ISms {
     */
     */
    String getImsSmsFormatForSubscriber(long subId);
    String getImsSmsFormatForSubscriber(long subId);


    /*
     * Get SMS prompt property,  enabled or not
     * @return true if enabled, false otherwise
     */
    boolean isSMSPromptEnabled();

    /**
    /**
     * Send a system stored text message.
     * Send a system stored text message.
     *
     *
+8 −0
Original line number Original line Diff line number Diff line
@@ -151,4 +151,12 @@ interface ISub {
    void clearDefaultsForInactiveSubIds();
    void clearDefaultsForInactiveSubIds();


    long[] getActiveSubIdList();
    long[] getActiveSubIdList();

    boolean isSMSPromptEnabled();

    void setSMSPromptEnabled(boolean enabled);

    boolean isVoicePromptEnabled();

    void setVoicePromptEnabled(boolean enabled);
}
}
+4 −0
Original line number Original line Diff line number Diff line
@@ -169,6 +169,10 @@ public class PhoneConstants {
    public static final int SIM_ID_3 = 2;
    public static final int SIM_ID_3 = 2;
    public static final int SIM_ID_4 = 3;
    public static final int SIM_ID_4 = 3;


    public static final int PHONE_ID1 = 0;
    public static final int PHONE_ID2 = 1;
    public static final int PHONE_ID3 = 2;

    // ICC SIM Application Types
    // ICC SIM Application Types
    // TODO: Replace the IccCardApplicationStatus.AppType enums with these constants
    // TODO: Replace the IccCardApplicationStatus.AppType enums with these constants
    public static final int APPTYPE_UNKNOWN = 0;
    public static final int APPTYPE_UNKNOWN = 0;