diff options
| author | Sumit Das <sumidas@codeaurora.org> | 2018-08-31 16:00:30 -0700 |
|---|---|---|
| committer | Sumit Das <sumidas@codeaurora.org> | 2018-08-31 16:00:30 -0700 |
| commit | 6066f9eaf25a5e741c74a995c8c152a3a86ee2ae (patch) | |
| tree | 85875cd1348e4362056423cea123a9e0846a0ded | |
| parent | 8834ec7370fb527662e2c382e14ab3f71efe8bcd (diff) | |
Add Null Pointer Checks for the MultiIdentity feature (FR49048)
-Check for Null Pointers in all the client facing APIs and throw
exceptions for invalid parameters
Change-Id: Ia91d2b9eb7cb4819aa4f66782944c8a61f47f6f5
CRs-Fixed: 2307387
| -rw-r--r-- | ims/src/org/codeaurora/ims/ImsMultiIdentityManager.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ims/src/org/codeaurora/ims/ImsMultiIdentityManager.java b/ims/src/org/codeaurora/ims/ImsMultiIdentityManager.java index 0786972..f6a9fcd 100644 --- a/ims/src/org/codeaurora/ims/ImsMultiIdentityManager.java +++ b/ims/src/org/codeaurora/ims/ImsMultiIdentityManager.java @@ -79,6 +79,11 @@ public class ImsMultiIdentityManager { public void setMultiIdentityListener(ImsMultiIdentityListenerBase listener) throws QtiImsException{ + if (listener == null) { + String msg = "setMultiIdentityListener :: listener is NULL"; + Log.e(LOG_TAG, msg); + throw new QtiImsException(msg); + } mQtiImsExtMgr.validateInvariants(mPhoneId); try { getMultiIdentityInterface().setMultiIdentityListener(listener.getListener()); @@ -90,6 +95,11 @@ public class ImsMultiIdentityManager { public void updateRegistrationStatus( ArrayList<MultiIdentityLineInfo> linesInfo) throws QtiImsException{ + if (linesInfo == null) { + String msg = "updateRegistrationStatus :: linesInfo is NULL"; + Log.e(LOG_TAG, msg); + throw new QtiImsException(msg); + } mQtiImsExtMgr.validateInvariants(mPhoneId); try { getMultiIdentityInterface().updateRegistrationStatus(linesInfo); @@ -100,6 +110,11 @@ public class ImsMultiIdentityManager { } public void queryVirtualLineInfo(String msisdn) throws QtiImsException{ + if (msisdn == null || msisdn.isEmpty()) { + String msg = "queryVirtualLineInfo :: invalid msisdn"; + Log.e(LOG_TAG, msg); + throw new QtiImsException(msg); + } mQtiImsExtMgr.validateInvariants(mPhoneId); try { getMultiIdentityInterface().queryVirtualLineInfo(msisdn); |
