Loading telephony/java/android/telephony/ims/feature/ImsFeature.java +28 −17 Original line number Diff line number Diff line Loading @@ -375,11 +375,15 @@ public abstract class ImsFeature { */ @SystemApi public final void setFeatureState(@ImsState int state) { boolean isNotify = false; synchronized (mLock) { if (mState != state) { mState = state; notifyFeatureState(state); isNotify = true; } } if (isNotify) { notifyFeatureState(state); } } Loading Loading @@ -412,6 +416,7 @@ public abstract class ImsFeature { * Internal method called by ImsFeature when setFeatureState has changed. */ private void notifyFeatureState(@ImsState int state) { synchronized (mStatusCallbacks) { mStatusCallbacks.broadcastAction((c) -> { try { c.notifyImsFeatureStatus(state); Loading @@ -421,6 +426,7 @@ public abstract class ImsFeature { } }); } } /** * @hide Loading Loading @@ -491,8 +497,12 @@ public abstract class ImsFeature { synchronized (mLock) { mCapabilityStatus = caps.copy(); } synchronized (mCapabilityCallbacks) { mCapabilityCallbacks.broadcastAction((callback) -> { try { Log.d(LOG_TAG, "ImsFeature notifyCapabilitiesStatusChanged Capabilities = " + caps.mCapabilities); callback.onCapabilitiesStatusChanged(caps.mCapabilities); } catch (RemoteException e) { Log.w(LOG_TAG, e + " notifyCapabilitiesStatusChanged() - Skipping " Loading @@ -500,6 +510,7 @@ public abstract class ImsFeature { } }); } } /** * Provides the ImsFeature with the ability to return the framework Capability Configuration Loading telephony/java/android/telephony/ims/stub/ImsConfigImplBase.java +54 −42 Original line number Diff line number Diff line Loading @@ -587,6 +587,7 @@ public class ImsConfigImplBase { if (mCallbacks == null) { return; } synchronized (mCallbacks) { mCallbacks.broadcastAction(c -> { try { c.onIntConfigChanged(item, value); Loading @@ -595,12 +596,14 @@ public class ImsConfigImplBase { } }); } } private void notifyConfigChanged(int item, String value) { // can be null in testing if (mCallbacks == null) { return; } synchronized (mCallbacks) { mCallbacks.broadcastAction(c -> { try { c.onStringConfigChanged(item, value); Loading @@ -609,6 +612,7 @@ public class ImsConfigImplBase { } }); } } private void addRcsConfigCallback(IRcsConfigCallback c) { mRcsCallbacks.register(c); Loading @@ -635,6 +639,7 @@ public class ImsConfigImplBase { // can be null in testing if (mRcsCallbacks != null) { synchronized (mRcsCallbacks) { mRcsCallbacks.broadcastAction(c -> { try { c.onConfigurationChanged(mRcsConfigData); Loading @@ -643,12 +648,14 @@ public class ImsConfigImplBase { } }); } } notifyRcsAutoConfigurationReceived(config, isCompressed); } private void onNotifyRcsAutoConfigurationRemoved() { mRcsConfigData = null; if (mRcsCallbacks != null) { synchronized (mRcsCallbacks) { mRcsCallbacks.broadcastAction(c -> { try { c.onConfigurationReset(); Loading @@ -657,6 +664,7 @@ public class ImsConfigImplBase { } }); } } notifyRcsAutoConfigurationRemoved(); } Loading Loading @@ -801,6 +809,7 @@ public class ImsConfigImplBase { if (mRcsCallbacks == null) { return; } synchronized (mRcsCallbacks) { mRcsCallbacks.broadcastAction(c -> { try { c.onAutoConfigurationErrorReceived(errorCode, errorString); Loading @@ -809,6 +818,7 @@ public class ImsConfigImplBase { } }); } } /** * Notifies application that pre-provisioning config is received. Loading @@ -825,6 +835,7 @@ public class ImsConfigImplBase { if (mRcsCallbacks == null) { return; } synchronized (mRcsCallbacks) { mRcsCallbacks.broadcastAction(c -> { try { c.onPreProvisioningReceived(configXml); Loading @@ -833,6 +844,7 @@ public class ImsConfigImplBase { } }); } } /** * Set default Executor from ImsService. Loading telephony/java/android/telephony/ims/stub/ImsSmsImplBase.java +85 −67 Original line number Diff line number Diff line Loading @@ -219,12 +219,16 @@ public class ImsSmsImplBase { */ public final void onSmsReceived(int token, @SmsMessage.Format String format, byte[] pdu) throws RuntimeException { IImsSmsListener listener = null; synchronized (mLock) { if (mListener == null) { listener = mListener; } if (listener == null) { throw new RuntimeException("Feature not ready."); } try { mListener.onSmsReceived(token, format, pdu); listener.onSmsReceived(token, format, pdu); } catch (RemoteException e) { Log.e(LOG_TAG, "Can not deliver sms: " + e.getMessage()); SmsMessage message = SmsMessage.createFromPdu(pdu, format); Loading @@ -237,7 +241,6 @@ public class ImsSmsImplBase { } } } } /** * This method should be triggered by the IMS providers when an outgoing SMS message has been Loading @@ -254,18 +257,21 @@ public class ImsSmsImplBase { */ public final void onSendSmsResultSuccess(int token, @IntRange(from = 0, to = 65535) int messageRef) throws RuntimeException { IImsSmsListener listener = null; synchronized (mLock) { if (mListener == null) { listener = mListener; } if (listener == null) { throw new RuntimeException("Feature not ready."); } try { mListener.onSendSmsResult(token, messageRef, SEND_STATUS_OK, listener.onSendSmsResult(token, messageRef, SEND_STATUS_OK, SmsManager.RESULT_ERROR_NONE, RESULT_NO_NETWORK_ERROR); } catch (RemoteException e) { e.rethrowFromSystemServer(); } } } /** * This method should be triggered by the IMS providers to pass the result of the sent message Loading @@ -288,18 +294,21 @@ public class ImsSmsImplBase { @Deprecated public final void onSendSmsResult(int token, @IntRange(from = 0, to = 65535) int messageRef, @SendStatusResult int status, @SmsManager.Result int reason) throws RuntimeException { IImsSmsListener listener = null; synchronized (mLock) { if (mListener == null) { listener = mListener; } if (listener == null) { throw new RuntimeException("Feature not ready."); } try { mListener.onSendSmsResult(token, messageRef, status, reason, listener.onSendSmsResult(token, messageRef, status, reason, RESULT_NO_NETWORK_ERROR); } catch (RemoteException e) { e.rethrowFromSystemServer(); } } } /** * This method should be triggered by the IMS providers when an outgoing message fails to be Loading @@ -322,17 +331,20 @@ public class ImsSmsImplBase { public final void onSendSmsResultError(int token, @IntRange(from = 0, to = 65535) int messageRef, @SendStatusResult int status, @SmsManager.Result int reason, int networkErrorCode) throws RuntimeException { IImsSmsListener listener = null; synchronized (mLock) { if (mListener == null) { listener = mListener; } if (listener == null) { throw new RuntimeException("Feature not ready."); } try { mListener.onSendSmsResult(token, messageRef, status, reason, networkErrorCode); listener.onSendSmsResult(token, messageRef, status, reason, networkErrorCode); } catch (RemoteException e) { e.rethrowFromSystemServer(); } } } /** * This method should be triggered by the IMS providers when the status report of the sent Loading @@ -357,18 +369,21 @@ public class ImsSmsImplBase { public final void onSmsStatusReportReceived(int token, @IntRange(from = 0, to = 65535) int messageRef, @SmsMessage.Format String format, byte[] pdu) throws RuntimeException { IImsSmsListener listener = null; synchronized (mLock) { if (mListener == null) { listener = mListener; } if (listener == null) { throw new RuntimeException("Feature not ready."); } try { mListener.onSmsStatusReportReceived(token, format, pdu); listener.onSmsStatusReportReceived(token, format, pdu); } catch (RemoteException e) { Log.e(LOG_TAG, "Can not process sms status report: " + e.getMessage()); acknowledgeSmsReport(token, messageRef, STATUS_REPORT_STATUS_ERROR); } } } /** * This method should be triggered by the IMS providers when the status report of the sent Loading @@ -386,12 +401,16 @@ public class ImsSmsImplBase { */ public final void onSmsStatusReportReceived(int token, @SmsMessage.Format String format, byte[] pdu) throws RuntimeException { IImsSmsListener listener = null; synchronized (mLock) { if (mListener == null) { listener = mListener; } if (listener == null) { throw new RuntimeException("Feature not ready."); } try { mListener.onSmsStatusReportReceived(token, format, pdu); listener.onSmsStatusReportReceived(token, format, pdu); } catch (RemoteException e) { Log.e(LOG_TAG, "Can not process sms status report: " + e.getMessage()); SmsMessage message = SmsMessage.createFromPdu(pdu, format); Loading @@ -406,7 +425,6 @@ public class ImsSmsImplBase { } } } } /** * Returns the SMS format that the ImsService expects. Loading Loading
telephony/java/android/telephony/ims/feature/ImsFeature.java +28 −17 Original line number Diff line number Diff line Loading @@ -375,11 +375,15 @@ public abstract class ImsFeature { */ @SystemApi public final void setFeatureState(@ImsState int state) { boolean isNotify = false; synchronized (mLock) { if (mState != state) { mState = state; notifyFeatureState(state); isNotify = true; } } if (isNotify) { notifyFeatureState(state); } } Loading Loading @@ -412,6 +416,7 @@ public abstract class ImsFeature { * Internal method called by ImsFeature when setFeatureState has changed. */ private void notifyFeatureState(@ImsState int state) { synchronized (mStatusCallbacks) { mStatusCallbacks.broadcastAction((c) -> { try { c.notifyImsFeatureStatus(state); Loading @@ -421,6 +426,7 @@ public abstract class ImsFeature { } }); } } /** * @hide Loading Loading @@ -491,8 +497,12 @@ public abstract class ImsFeature { synchronized (mLock) { mCapabilityStatus = caps.copy(); } synchronized (mCapabilityCallbacks) { mCapabilityCallbacks.broadcastAction((callback) -> { try { Log.d(LOG_TAG, "ImsFeature notifyCapabilitiesStatusChanged Capabilities = " + caps.mCapabilities); callback.onCapabilitiesStatusChanged(caps.mCapabilities); } catch (RemoteException e) { Log.w(LOG_TAG, e + " notifyCapabilitiesStatusChanged() - Skipping " Loading @@ -500,6 +510,7 @@ public abstract class ImsFeature { } }); } } /** * Provides the ImsFeature with the ability to return the framework Capability Configuration Loading
telephony/java/android/telephony/ims/stub/ImsConfigImplBase.java +54 −42 Original line number Diff line number Diff line Loading @@ -587,6 +587,7 @@ public class ImsConfigImplBase { if (mCallbacks == null) { return; } synchronized (mCallbacks) { mCallbacks.broadcastAction(c -> { try { c.onIntConfigChanged(item, value); Loading @@ -595,12 +596,14 @@ public class ImsConfigImplBase { } }); } } private void notifyConfigChanged(int item, String value) { // can be null in testing if (mCallbacks == null) { return; } synchronized (mCallbacks) { mCallbacks.broadcastAction(c -> { try { c.onStringConfigChanged(item, value); Loading @@ -609,6 +612,7 @@ public class ImsConfigImplBase { } }); } } private void addRcsConfigCallback(IRcsConfigCallback c) { mRcsCallbacks.register(c); Loading @@ -635,6 +639,7 @@ public class ImsConfigImplBase { // can be null in testing if (mRcsCallbacks != null) { synchronized (mRcsCallbacks) { mRcsCallbacks.broadcastAction(c -> { try { c.onConfigurationChanged(mRcsConfigData); Loading @@ -643,12 +648,14 @@ public class ImsConfigImplBase { } }); } } notifyRcsAutoConfigurationReceived(config, isCompressed); } private void onNotifyRcsAutoConfigurationRemoved() { mRcsConfigData = null; if (mRcsCallbacks != null) { synchronized (mRcsCallbacks) { mRcsCallbacks.broadcastAction(c -> { try { c.onConfigurationReset(); Loading @@ -657,6 +664,7 @@ public class ImsConfigImplBase { } }); } } notifyRcsAutoConfigurationRemoved(); } Loading Loading @@ -801,6 +809,7 @@ public class ImsConfigImplBase { if (mRcsCallbacks == null) { return; } synchronized (mRcsCallbacks) { mRcsCallbacks.broadcastAction(c -> { try { c.onAutoConfigurationErrorReceived(errorCode, errorString); Loading @@ -809,6 +818,7 @@ public class ImsConfigImplBase { } }); } } /** * Notifies application that pre-provisioning config is received. Loading @@ -825,6 +835,7 @@ public class ImsConfigImplBase { if (mRcsCallbacks == null) { return; } synchronized (mRcsCallbacks) { mRcsCallbacks.broadcastAction(c -> { try { c.onPreProvisioningReceived(configXml); Loading @@ -833,6 +844,7 @@ public class ImsConfigImplBase { } }); } } /** * Set default Executor from ImsService. Loading
telephony/java/android/telephony/ims/stub/ImsSmsImplBase.java +85 −67 Original line number Diff line number Diff line Loading @@ -219,12 +219,16 @@ public class ImsSmsImplBase { */ public final void onSmsReceived(int token, @SmsMessage.Format String format, byte[] pdu) throws RuntimeException { IImsSmsListener listener = null; synchronized (mLock) { if (mListener == null) { listener = mListener; } if (listener == null) { throw new RuntimeException("Feature not ready."); } try { mListener.onSmsReceived(token, format, pdu); listener.onSmsReceived(token, format, pdu); } catch (RemoteException e) { Log.e(LOG_TAG, "Can not deliver sms: " + e.getMessage()); SmsMessage message = SmsMessage.createFromPdu(pdu, format); Loading @@ -237,7 +241,6 @@ public class ImsSmsImplBase { } } } } /** * This method should be triggered by the IMS providers when an outgoing SMS message has been Loading @@ -254,18 +257,21 @@ public class ImsSmsImplBase { */ public final void onSendSmsResultSuccess(int token, @IntRange(from = 0, to = 65535) int messageRef) throws RuntimeException { IImsSmsListener listener = null; synchronized (mLock) { if (mListener == null) { listener = mListener; } if (listener == null) { throw new RuntimeException("Feature not ready."); } try { mListener.onSendSmsResult(token, messageRef, SEND_STATUS_OK, listener.onSendSmsResult(token, messageRef, SEND_STATUS_OK, SmsManager.RESULT_ERROR_NONE, RESULT_NO_NETWORK_ERROR); } catch (RemoteException e) { e.rethrowFromSystemServer(); } } } /** * This method should be triggered by the IMS providers to pass the result of the sent message Loading @@ -288,18 +294,21 @@ public class ImsSmsImplBase { @Deprecated public final void onSendSmsResult(int token, @IntRange(from = 0, to = 65535) int messageRef, @SendStatusResult int status, @SmsManager.Result int reason) throws RuntimeException { IImsSmsListener listener = null; synchronized (mLock) { if (mListener == null) { listener = mListener; } if (listener == null) { throw new RuntimeException("Feature not ready."); } try { mListener.onSendSmsResult(token, messageRef, status, reason, listener.onSendSmsResult(token, messageRef, status, reason, RESULT_NO_NETWORK_ERROR); } catch (RemoteException e) { e.rethrowFromSystemServer(); } } } /** * This method should be triggered by the IMS providers when an outgoing message fails to be Loading @@ -322,17 +331,20 @@ public class ImsSmsImplBase { public final void onSendSmsResultError(int token, @IntRange(from = 0, to = 65535) int messageRef, @SendStatusResult int status, @SmsManager.Result int reason, int networkErrorCode) throws RuntimeException { IImsSmsListener listener = null; synchronized (mLock) { if (mListener == null) { listener = mListener; } if (listener == null) { throw new RuntimeException("Feature not ready."); } try { mListener.onSendSmsResult(token, messageRef, status, reason, networkErrorCode); listener.onSendSmsResult(token, messageRef, status, reason, networkErrorCode); } catch (RemoteException e) { e.rethrowFromSystemServer(); } } } /** * This method should be triggered by the IMS providers when the status report of the sent Loading @@ -357,18 +369,21 @@ public class ImsSmsImplBase { public final void onSmsStatusReportReceived(int token, @IntRange(from = 0, to = 65535) int messageRef, @SmsMessage.Format String format, byte[] pdu) throws RuntimeException { IImsSmsListener listener = null; synchronized (mLock) { if (mListener == null) { listener = mListener; } if (listener == null) { throw new RuntimeException("Feature not ready."); } try { mListener.onSmsStatusReportReceived(token, format, pdu); listener.onSmsStatusReportReceived(token, format, pdu); } catch (RemoteException e) { Log.e(LOG_TAG, "Can not process sms status report: " + e.getMessage()); acknowledgeSmsReport(token, messageRef, STATUS_REPORT_STATUS_ERROR); } } } /** * This method should be triggered by the IMS providers when the status report of the sent Loading @@ -386,12 +401,16 @@ public class ImsSmsImplBase { */ public final void onSmsStatusReportReceived(int token, @SmsMessage.Format String format, byte[] pdu) throws RuntimeException { IImsSmsListener listener = null; synchronized (mLock) { if (mListener == null) { listener = mListener; } if (listener == null) { throw new RuntimeException("Feature not ready."); } try { mListener.onSmsStatusReportReceived(token, format, pdu); listener.onSmsStatusReportReceived(token, format, pdu); } catch (RemoteException e) { Log.e(LOG_TAG, "Can not process sms status report: " + e.getMessage()); SmsMessage message = SmsMessage.createFromPdu(pdu, format); Loading @@ -406,7 +425,6 @@ public class ImsSmsImplBase { } } } } /** * Returns the SMS format that the ImsService expects. Loading