Przeglądaj źródła

Telephony: IMS: Cache subscriber associated uri

Cache subscriber associated uris and notify when a new
callback is registered. This is to fix the issue where
the uri is not notified to a new client which registers
a callback after vendor ims service has notified the uri
change.

Change-Id: Ie1dd205df4a390fc634b31005f2cda828abb74fb
CRs-Fixed: 2708087
ten
Muhammed Siju 1 rok temu
rodzic
commit
d238138488
No account linked to committer's email address

+ 18
- 0
telephony/java/android/telephony/ims/stub/ImsRegistrationImplBase.java Wyświetl plik

@@ -104,6 +104,8 @@ public class ImsRegistrationImplBase {
private int mRegistrationState = REGISTRATION_STATE_UNKNOWN;
// Locked on mLock, create unspecified disconnect cause.
private ImsReasonInfo mLastDisconnectCause = new ImsReasonInfo();
// Locked on mLock. caches the last updated uris
private Uri[] mSubscriberAssociatedUris = null;

/**
* @hide
@@ -210,6 +212,7 @@ public class ImsRegistrationImplBase {
* @param uris
*/
public final void onSubscriberAssociatedUriChanged(Uri[] uris) {
updateSubscriberAssociatedUri(uris);
mCallbacks.broadcast((c) -> {
try {
c.onSubscriberAssociatedUriChanged(uris);
@@ -228,6 +231,9 @@ public class ImsRegistrationImplBase {
mConnectionType = connType;
mRegistrationState = newState;
mLastDisconnectCause = null;
if (newState != REGISTRATION_STATE_REGISTERED) {
mSubscriberAssociatedUris = null;
}
}
}

@@ -243,6 +249,13 @@ public class ImsRegistrationImplBase {
}
}

private void updateSubscriberAssociatedUri(Uri[] uris) {
Log.d(LOG_TAG, "updateSubscriberAssociatedUri: cache new uri");
synchronized (mLock) {
mSubscriberAssociatedUris = uris;
}
}

/**
* @return the current registration connection type. Valid values are
* {@link #REGISTRATION_TECH_LTE} and {@link #REGISTRATION_TECH_IWLAN}
@@ -262,9 +275,11 @@ public class ImsRegistrationImplBase {
private void updateNewCallbackWithState(IImsRegistrationCallback c) throws RemoteException {
int state;
ImsReasonInfo disconnectInfo;
Uri[] uris;
synchronized (mLock) {
state = mRegistrationState;
disconnectInfo = mLastDisconnectCause;
uris = mSubscriberAssociatedUris;
}
switch (state) {
case REGISTRATION_STATE_NOT_REGISTERED: {
@@ -277,6 +292,9 @@ public class ImsRegistrationImplBase {
}
case REGISTRATION_STATE_REGISTERED: {
c.onRegistered(getConnectionType());
if (uris != null) {
c.onSubscriberAssociatedUriChanged(uris);
}
break;
}
case REGISTRATION_STATE_UNKNOWN: {

Ładowanie…
Anuluj
Zapisz