Loading src/java/com/android/ims/ImsManager.java +52 −3 Original line number Diff line number Diff line Loading @@ -39,8 +39,11 @@ import com.android.ims.internal.IImsCallSession; import com.android.ims.internal.IImsConfig; import com.android.ims.internal.IImsEcbm; 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; Loading Loading @@ -1425,8 +1428,10 @@ public class ImsManager { checkAndThrowExceptionIfServiceUnavailable(); // TODO: Remove once new MmTelFeature is merged in mImsServiceProxy.addRegistrationListener(mImsRegistrationListenerProxy); mImsServiceProxy.getRegistration().addRegistrationCallback( mRegistrationCallback); IImsRegistration regBinder = mImsServiceProxy.getRegistration(); if (regBinder != null) { regBinder.addRegistrationCallback(mRegistrationCallback); } log("Registration Callback/Listener registered."); // Only record if there isn't a RemoteException. mHasRegisteredForProxy = true; Loading Loading @@ -1869,7 +1874,7 @@ public class ImsManager { if (!mConfigDynamicBind) { // Deprecated method of binding Rlog.i(TAG, "Creating ImsService using ServiceManager"); mImsServiceProxy = ImsServiceProxyCompat.create(mPhoneId, mDeathRecipient); mImsServiceProxy = ImsServiceProxyCompat.create(mContext, mPhoneId, mDeathRecipient); } else { Rlog.i(TAG, "Creating ImsService using ImsResolver"); mImsServiceProxy = ImsServiceProxy.create(mContext, mPhoneId); Loading Loading @@ -2301,6 +2306,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.. * Loading src/java/com/android/ims/ImsServiceProxy.java +45 −3 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; /** Loading Loading @@ -144,15 +147,15 @@ public class ImsServiceProxy { } }; public ImsServiceProxy(int slotId, IBinder binder, int featureType) { public ImsServiceProxy(Context context, int slotId, IBinder binder, int featureType) { mSlotId = slotId; mBinder = binder; mSupportedFeature = featureType; mContext = context; } public ImsServiceProxy(Context context, int slotId, int featureType) { this(slotId, null, featureType); mContext = context; this(context, slotId, null, featureType); } public @Nullable IImsRegistration getRegistration() { Loading Loading @@ -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 Loading src/java/com/android/ims/ImsServiceProxyCompat.java +5 −4 Original line number Diff line number Diff line Loading @@ -54,7 +54,8 @@ public class ImsServiceProxyCompat extends ImsServiceProxy { */ private static final String IMS_SERVICE = "ims"; public static ImsServiceProxyCompat create(int slotId, IBinder.DeathRecipient recipient) { public static ImsServiceProxyCompat create(Context context, int slotId, IBinder.DeathRecipient recipient) { IBinder binder = ServiceManager.checkService(IMS_SERVICE); if (binder != null) { Loading @@ -66,11 +67,11 @@ public class ImsServiceProxyCompat extends ImsServiceProxy { // If the proxy is created with a null binder, subsequent calls that depend on a live // binder will fail, causing this structure to be torn down and created again. return new ImsServiceProxyCompat(slotId, binder); return new ImsServiceProxyCompat(context, slotId, binder); } public ImsServiceProxyCompat(int slotId, IBinder binder) { super(slotId, binder, SERVICE_ID); public ImsServiceProxyCompat(Context context, int slotId, IBinder binder) { super(context, slotId, binder, SERVICE_ID); } @Override Loading Loading
src/java/com/android/ims/ImsManager.java +52 −3 Original line number Diff line number Diff line Loading @@ -39,8 +39,11 @@ import com.android.ims.internal.IImsCallSession; import com.android.ims.internal.IImsConfig; import com.android.ims.internal.IImsEcbm; 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; Loading Loading @@ -1425,8 +1428,10 @@ public class ImsManager { checkAndThrowExceptionIfServiceUnavailable(); // TODO: Remove once new MmTelFeature is merged in mImsServiceProxy.addRegistrationListener(mImsRegistrationListenerProxy); mImsServiceProxy.getRegistration().addRegistrationCallback( mRegistrationCallback); IImsRegistration regBinder = mImsServiceProxy.getRegistration(); if (regBinder != null) { regBinder.addRegistrationCallback(mRegistrationCallback); } log("Registration Callback/Listener registered."); // Only record if there isn't a RemoteException. mHasRegisteredForProxy = true; Loading Loading @@ -1869,7 +1874,7 @@ public class ImsManager { if (!mConfigDynamicBind) { // Deprecated method of binding Rlog.i(TAG, "Creating ImsService using ServiceManager"); mImsServiceProxy = ImsServiceProxyCompat.create(mPhoneId, mDeathRecipient); mImsServiceProxy = ImsServiceProxyCompat.create(mContext, mPhoneId, mDeathRecipient); } else { Rlog.i(TAG, "Creating ImsService using ImsResolver"); mImsServiceProxy = ImsServiceProxy.create(mContext, mPhoneId); Loading Loading @@ -2301,6 +2306,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.. * Loading
src/java/com/android/ims/ImsServiceProxy.java +45 −3 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; /** Loading Loading @@ -144,15 +147,15 @@ public class ImsServiceProxy { } }; public ImsServiceProxy(int slotId, IBinder binder, int featureType) { public ImsServiceProxy(Context context, int slotId, IBinder binder, int featureType) { mSlotId = slotId; mBinder = binder; mSupportedFeature = featureType; mContext = context; } public ImsServiceProxy(Context context, int slotId, int featureType) { this(slotId, null, featureType); mContext = context; this(context, slotId, null, featureType); } public @Nullable IImsRegistration getRegistration() { Loading Loading @@ -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 Loading
src/java/com/android/ims/ImsServiceProxyCompat.java +5 −4 Original line number Diff line number Diff line Loading @@ -54,7 +54,8 @@ public class ImsServiceProxyCompat extends ImsServiceProxy { */ private static final String IMS_SERVICE = "ims"; public static ImsServiceProxyCompat create(int slotId, IBinder.DeathRecipient recipient) { public static ImsServiceProxyCompat create(Context context, int slotId, IBinder.DeathRecipient recipient) { IBinder binder = ServiceManager.checkService(IMS_SERVICE); if (binder != null) { Loading @@ -66,11 +67,11 @@ public class ImsServiceProxyCompat extends ImsServiceProxy { // If the proxy is created with a null binder, subsequent calls that depend on a live // binder will fail, causing this structure to be torn down and created again. return new ImsServiceProxyCompat(slotId, binder); return new ImsServiceProxyCompat(context, slotId, binder); } public ImsServiceProxyCompat(int slotId, IBinder binder) { super(slotId, binder, SERVICE_ID); public ImsServiceProxyCompat(Context context, int slotId, IBinder binder) { super(context, slotId, binder, SERVICE_ID); } @Override Loading