diff options
author | Mohamed Abdalkader <abdalkader@google.com> | 2018-01-10 13:29:26 -0800 |
---|---|---|
committer | Brad Ebinger <breadley@google.com> | 2018-01-31 11:26:20 -0800 |
commit | f8800daead3725e6895c9df7a7d705d2a07fc21c (patch) | |
tree | 56bdd4531d298a899f6079da2a86f5ab312817fe | |
parent | 3418c1369928abbd995a903e2c2f907a5b7b8cb7 (diff) | |
download | ims-f8800daead3725e6895c9df7a7d705d2a07fc21c.tar.gz |
Expose SMS Apis through ImsServiceProxy.
Test: manual, telephony unit tests.
BUG=69846044
Merged-In: I36a3a7e94546e1bcd7c4af9b9335378404833b4a
Change-Id: I36a3a7e94546e1bcd7c4af9b9335378404833b4a
-rw-r--r-- | src/java/com/android/ims/ImsManager.java | 46 | ||||
-rw-r--r-- | src/java/com/android/ims/ImsServiceProxy.java | 42 |
2 files changed, 88 insertions, 0 deletions
diff --git a/src/java/com/android/ims/ImsManager.java b/src/java/com/android/ims/ImsManager.java index 6482ba40..48a3165c 100644 --- a/src/java/com/android/ims/ImsManager.java +++ b/src/java/com/android/ims/ImsManager.java @@ -45,6 +45,8 @@ import com.android.ims.internal.IImsMultiEndpoint; import com.android.ims.internal.IImsRegistration; import com.android.ims.internal.IImsRegistrationCallback; import com.android.ims.internal.IImsRegistrationListener; +import com.android.ims.internal.IImsServiceController; +import com.android.ims.internal.IImsSmsListener; import com.android.ims.internal.IImsUt; import com.android.ims.internal.ImsCallSession; import com.android.internal.annotations.VisibleForTesting; @@ -2399,6 +2401,50 @@ public class ImsManager { return mEcbm; } + public void sendSms(int token, int messageRef, String format, String smsc, boolean isRetry, + byte[] pdu) throws ImsException { + try { + mImsServiceProxy.sendSms(token, messageRef, format, smsc, isRetry, pdu); + } catch (RemoteException e) { + throw new ImsException("sendSms()", e, ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN); + } + } + + public void acknowledgeSms(int token, int messageRef, int result) throws ImsException { + try { + mImsServiceProxy.acknowledgeSms(token, messageRef, result); + } catch (RemoteException e) { + throw new ImsException("acknowledgeSms()", e, + ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN); + } + } + + public void acknowledgeSmsReport(int token, int messageRef, int result) throws ImsException{ + try { + mImsServiceProxy.acknowledgeSmsReport(token, messageRef, result); + } catch (RemoteException e) { + throw new ImsException("acknowledgeSmsReport()", e, + ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN); + } + } + + public String getSmsFormat() throws ImsException{ + try { + return mImsServiceProxy.getSmsFormat(); + } catch (RemoteException e) { + throw new ImsException("getSmsFormat()", e, + ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN); + } + } + + public void setSmsListener(IImsSmsListener listener) throws ImsException { + try { + mImsServiceProxy.setSmsListener(listener); + } catch (RemoteException e) { + throw new ImsException("setSmsListener()", e, + ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN); + } + } /** * Gets the Multi-Endpoint interface to subscribe to multi-enpoint notifications.. * diff --git a/src/java/com/android/ims/ImsServiceProxy.java b/src/java/com/android/ims/ImsServiceProxy.java index a2df36bd..153c5f52 100644 --- a/src/java/com/android/ims/ImsServiceProxy.java +++ b/src/java/com/android/ims/ImsServiceProxy.java @@ -25,6 +25,8 @@ import android.os.RemoteException; import android.telephony.Rlog; import android.telephony.TelephonyManager; import android.telephony.ims.feature.ImsFeature; +import android.telephony.SmsMessage; +import android.telephony.ims.internal.SmsImplBase; import android.util.Log; import com.android.ims.internal.IImsCallSession; @@ -36,6 +38,7 @@ import com.android.ims.internal.IImsMultiEndpoint; import com.android.ims.internal.IImsRegistration; import com.android.ims.internal.IImsRegistrationListener; import com.android.ims.internal.IImsServiceFeatureCallback; +import com.android.ims.internal.IImsSmsListener; import com.android.ims.internal.IImsUt; /** @@ -336,6 +339,45 @@ public class ImsServiceProxy { mStatusCallback = c; } + public void sendSms(int token, int messageRef, String format, String smsc, boolean isRetry, + byte[] pdu) throws RemoteException { + synchronized (mLock) { + checkServiceIsReady(); + getServiceInterface(mBinder).sendSms(token, messageRef, format, smsc, isRetry, + pdu); + } + } + + public void acknowledgeSms(int token, int messageRef, + @SmsImplBase.SendStatusResult int result) throws RemoteException { + synchronized (mLock) { + checkServiceIsReady(); + getServiceInterface(mBinder).acknowledgeSms(token, messageRef, result); + } + } + + public void acknowledgeSmsReport(int token, int messageRef, + @SmsImplBase.StatusReportResult int result) throws RemoteException { + synchronized (mLock) { + checkServiceIsReady(); + getServiceInterface(mBinder).acknowledgeSmsReport(token, messageRef, result); + } + } + + public String getSmsFormat() throws RemoteException { + synchronized (mLock) { + checkServiceIsReady(); + return getServiceInterface(mBinder).getSmsFormat(); + } + } + + public void setSmsListener(IImsSmsListener listener) throws RemoteException { + synchronized (mLock) { + checkServiceIsReady(); + getServiceInterface(mBinder).setSmsListener(listener); + } + } + /** * @return Returns true if the ImsService is ready to take commands, false otherwise. If this * method returns false, it doesn't mean that the Binder connection is not available (use |