diff options
author | Mohamed Abdalkader <abdalkader@google.com> | 2018-01-23 13:09:00 -0800 |
---|---|---|
committer | Brad Ebinger <breadley@google.com> | 2018-01-31 14:55:42 -0800 |
commit | 304f4b5509bc3b8fb1606df0bc95f7da205ed5af (patch) | |
tree | 0cca5018069f269d3ae79082a9a465a3727579bb | |
parent | 904c1eca5fe0dcf2c61e40d634b75bff3ea9157f (diff) |
Add and trigger onReady API for SMS over IMS.
Test: manual test that normal code path is fine since this code path is
not yet exercisable.
BUG=69846044
Merged-In: Icb15ca4aa6606fba641f6270dca5e0e06fc4466a
Change-Id: Icb15ca4aa6606fba641f6270dca5e0e06fc4466a
4 files changed, 26 insertions, 0 deletions
diff --git a/api/system-current.txt b/api/system-current.txt index 1d01bd11db04..0ac628e98336 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -4312,6 +4312,7 @@ package android.telephony.ims.internal.stub { method public void acknowledgeSms(int, int, int); method public void acknowledgeSmsReport(int, int, int); method public java.lang.String getSmsFormat(); + method public void onReady(); method public final void onSendSmsResult(int, int, int, int) throws java.lang.RuntimeException; method public final void onSmsReceived(int, java.lang.String, byte[]) throws java.lang.RuntimeException; method public final void onSmsStatusReportReceived(int, int, java.lang.String, byte[]) throws java.lang.RuntimeException; diff --git a/telephony/java/android/telephony/ims/feature/MMTelFeature.java b/telephony/java/android/telephony/ims/feature/MMTelFeature.java index 7a406ade9bf8..93c316f3dcb9 100644 --- a/telephony/java/android/telephony/ims/feature/MMTelFeature.java +++ b/telephony/java/android/telephony/ims/feature/MMTelFeature.java @@ -209,6 +209,13 @@ public class MMTelFeature extends ImsFeature { return MMTelFeature.this.getSmsFormat(); } } + + @Override + public void onSmsReady() { + synchronized (mLock) { + MMTelFeature.this.onSmsReady(); + } + } }; /** @@ -403,6 +410,10 @@ public class MMTelFeature extends ImsFeature { getSmsImplementation().acknowledgeSmsReport(token, messageRef, result); } + private void onSmsReady() { + getSmsImplementation().onReady(); + } + /** * Must be overridden by IMS Provider to be able to support SMS over IMS. Otherwise a default * non-functional implementation is returned. diff --git a/telephony/java/android/telephony/ims/internal/stub/SmsImplBase.java b/telephony/java/android/telephony/ims/internal/stub/SmsImplBase.java index c9431fd0e499..57df526b4a4e 100644 --- a/telephony/java/android/telephony/ims/internal/stub/SmsImplBase.java +++ b/telephony/java/android/telephony/ims/internal/stub/SmsImplBase.java @@ -185,6 +185,8 @@ public class SmsImplBase { * platform will deliver the message to the messages database and notify the IMS provider of the * result by calling {@link #acknowledgeSms(int, int, int)}. * + * This method must not be called before {@link #onReady()} is called. + * * @param token unique token generated by IMS providers that the platform will use to trigger * callbacks for this message. * @param format the format of the message. Valid values are {@link SmsMessage#FORMAT_3GPP} and @@ -210,6 +212,8 @@ public class SmsImplBase { * This method should be triggered by the IMS providers to pass the result of the sent message * to the platform. * + * This method must not be called before {@link #onReady()} is called. + * * @param token token provided in {@link #sendSms(int, int, String, String, boolean, byte[])} * @param messageRef the message reference. Should be between 0 and 255 per TS.123.040 * @param status result of sending the SMS. Valid values are: @@ -297,4 +301,13 @@ public class SmsImplBase { public String getSmsFormat() { return SmsMessage.FORMAT_3GPP; } + + /** + * Called when SmsImpl has been initialized and communication with the framework is set up. + * Any attempt by this class to access the framework before this method is called will return + * with an {@link RuntimeException}. + */ + public void onReady() { + // Base Implementation - Should be overridden + } } diff --git a/telephony/java/com/android/ims/internal/IImsMMTelFeature.aidl b/telephony/java/com/android/ims/internal/IImsMMTelFeature.aidl index cce39f4daf2a..10c7f3e8a2d7 100644 --- a/telephony/java/com/android/ims/internal/IImsMMTelFeature.aidl +++ b/telephony/java/com/android/ims/internal/IImsMMTelFeature.aidl @@ -61,4 +61,5 @@ interface IImsMMTelFeature { oneway void acknowledgeSms(int token, int messageRef, int result); oneway void acknowledgeSmsReport(int token, int messageRef, int result); String getSmsFormat(); + oneway void onSmsReady(); } |