Merge "Add imsRadioTech param to ImsRegistrationImplBase#onDeregistered"
This commit is contained in:
@@ -15563,10 +15563,6 @@ package android.telephony.ims {
|
||||
field public static final int SUGGESTED_ACTION_TRIGGER_PLMN_BLOCK_WITH_TIMEOUT = 2; // 0x2
|
||||
}
|
||||
|
||||
public static class RegistrationManager.RegistrationCallback {
|
||||
method public void onUnregistered(@NonNull android.telephony.ims.ImsReasonInfo, int);
|
||||
}
|
||||
|
||||
public final class RtpHeaderExtension implements android.os.Parcelable {
|
||||
ctor public RtpHeaderExtension(@IntRange(from=1, to=14) int, @NonNull byte[]);
|
||||
method public int describeContents();
|
||||
@@ -15966,7 +15962,7 @@ package android.telephony.ims.stub {
|
||||
ctor public ImsRegistrationImplBase();
|
||||
ctor public ImsRegistrationImplBase(@NonNull java.util.concurrent.Executor);
|
||||
method public final void onDeregistered(android.telephony.ims.ImsReasonInfo);
|
||||
method public final void onDeregistered(@Nullable android.telephony.ims.ImsReasonInfo, int);
|
||||
method public final void onDeregistered(@Nullable android.telephony.ims.ImsReasonInfo, int, int);
|
||||
method public final void onRegistered(int);
|
||||
method public final void onRegistered(@NonNull android.telephony.ims.ImsRegistrationAttributes);
|
||||
method public final void onRegistering(int);
|
||||
|
||||
@@ -37,7 +37,6 @@ import android.util.Log;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.function.Consumer;
|
||||
@@ -203,12 +202,15 @@ public interface RegistrationManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeregistered(ImsReasonInfo info, @SuggestedAction int suggestedAction) {
|
||||
public void onDeregistered(ImsReasonInfo info,
|
||||
@SuggestedAction int suggestedAction,
|
||||
@ImsRegistrationImplBase.ImsRegistrationTech int imsRadioTech) {
|
||||
if (mLocalCallback == null) return;
|
||||
|
||||
final long callingIdentity = Binder.clearCallingIdentity();
|
||||
try {
|
||||
mExecutor.execute(() -> mLocalCallback.onUnregistered(info, suggestedAction));
|
||||
mExecutor.execute(() -> mLocalCallback.onUnregistered(info,
|
||||
suggestedAction, imsRadioTech));
|
||||
} finally {
|
||||
restoreCallingIdentity(callingIdentity);
|
||||
}
|
||||
@@ -296,14 +298,17 @@ public interface RegistrationManager {
|
||||
/**
|
||||
* Notifies the framework when the IMS Provider is unregistered from the IMS network.
|
||||
*
|
||||
* Since this callback is only required for the communication between telephony framework
|
||||
* and ImsService, it is made hidden.
|
||||
*
|
||||
* @param info the {@link ImsReasonInfo} associated with why registration was disconnected.
|
||||
* @param suggestedAction the expected behavior of radio protocol stack.
|
||||
*
|
||||
* @param imsRadioTech the network type on which IMS registration has failed.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public void onUnregistered(@NonNull ImsReasonInfo info,
|
||||
@SuggestedAction int suggestedAction) {
|
||||
@SuggestedAction int suggestedAction,
|
||||
@ImsRegistrationImplBase.ImsRegistrationTech int imsRadioTech) {
|
||||
// Default impl to keep backwards compatibility with old implementations
|
||||
onUnregistered(info);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ import android.telephony.ims.ImsRegistrationAttributes;
|
||||
oneway interface IImsRegistrationCallback {
|
||||
void onRegistered(in ImsRegistrationAttributes attr);
|
||||
void onRegistering(in ImsRegistrationAttributes attr);
|
||||
void onDeregistered(in ImsReasonInfo info, int suggestedAction);
|
||||
void onDeregistered(in ImsReasonInfo info, int suggestedAction, int imsRadioTech);
|
||||
void onTechnologyChangeFailed(int imsRadioTech, in ImsReasonInfo info);
|
||||
void onSubscriberAssociatedUriChanged(in Uri[] uris);
|
||||
}
|
||||
|
||||
@@ -309,6 +309,7 @@ public class ImsRegistrationImplBase {
|
||||
private ImsReasonInfo mLastDisconnectCause = new ImsReasonInfo();
|
||||
// Locked on mLock
|
||||
private int mLastDisconnectSuggestedAction = RegistrationManager.SUGGESTED_ACTION_NONE;
|
||||
private int mLastDisconnectRadioTech = REGISTRATION_TECH_NONE;
|
||||
|
||||
// We hold onto the uris each time they change so that we can send it to a callback when its
|
||||
// first added.
|
||||
@@ -476,7 +477,7 @@ public class ImsRegistrationImplBase {
|
||||
@SystemApi
|
||||
public final void onDeregistered(ImsReasonInfo info) {
|
||||
// Default impl to keep backwards compatibility with old implementations
|
||||
onDeregistered(info, RegistrationManager.SUGGESTED_ACTION_NONE);
|
||||
onDeregistered(info, RegistrationManager.SUGGESTED_ACTION_NONE, REGISTRATION_TECH_NONE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -495,17 +496,19 @@ public class ImsRegistrationImplBase {
|
||||
*
|
||||
* @param info the {@link ImsReasonInfo} associated with why registration was disconnected.
|
||||
* @param suggestedAction the expected behavior of radio protocol stack.
|
||||
* @param imsRadioTech the network type on which IMS registration has failed.
|
||||
* @hide This API is not part of the Android public SDK API
|
||||
*/
|
||||
@SystemApi
|
||||
public final void onDeregistered(@Nullable ImsReasonInfo info,
|
||||
@RegistrationManager.SuggestedAction int suggestedAction) {
|
||||
updateToDisconnectedState(info, suggestedAction);
|
||||
@RegistrationManager.SuggestedAction int suggestedAction,
|
||||
@ImsRegistrationTech int imsRadioTech) {
|
||||
updateToDisconnectedState(info, suggestedAction, imsRadioTech);
|
||||
// ImsReasonInfo should never be null.
|
||||
final ImsReasonInfo reasonInfo = (info != null) ? info : new ImsReasonInfo();
|
||||
mCallbacks.broadcastAction((c) -> {
|
||||
try {
|
||||
c.onDeregistered(reasonInfo, suggestedAction);
|
||||
c.onDeregistered(reasonInfo, suggestedAction, imsRadioTech);
|
||||
} catch (RemoteException e) {
|
||||
Log.w(LOG_TAG, e + "onDeregistered() - Skipping callback.");
|
||||
}
|
||||
@@ -565,11 +568,13 @@ public class ImsRegistrationImplBase {
|
||||
mRegistrationState = newState;
|
||||
mLastDisconnectCause = null;
|
||||
mLastDisconnectSuggestedAction = RegistrationManager.SUGGESTED_ACTION_NONE;
|
||||
mLastDisconnectRadioTech = REGISTRATION_TECH_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
private void updateToDisconnectedState(ImsReasonInfo info,
|
||||
@RegistrationManager.SuggestedAction int suggestedAction) {
|
||||
@RegistrationManager.SuggestedAction int suggestedAction,
|
||||
@ImsRegistrationTech int imsRadioTech) {
|
||||
synchronized (mLock) {
|
||||
//We don't want to send this info over if we are disconnected
|
||||
mUrisSet = false;
|
||||
@@ -580,6 +585,7 @@ public class ImsRegistrationImplBase {
|
||||
if (info != null) {
|
||||
mLastDisconnectCause = info;
|
||||
mLastDisconnectSuggestedAction = suggestedAction;
|
||||
mLastDisconnectRadioTech = imsRadioTech;
|
||||
} else {
|
||||
Log.w(LOG_TAG, "updateToDisconnectedState: no ImsReasonInfo provided.");
|
||||
mLastDisconnectCause = new ImsReasonInfo();
|
||||
@@ -597,6 +603,7 @@ public class ImsRegistrationImplBase {
|
||||
ImsRegistrationAttributes attributes;
|
||||
ImsReasonInfo disconnectInfo;
|
||||
int suggestedAction;
|
||||
int imsDisconnectRadioTech;
|
||||
boolean urisSet;
|
||||
Uri[] uris;
|
||||
synchronized (mLock) {
|
||||
@@ -604,12 +611,13 @@ public class ImsRegistrationImplBase {
|
||||
attributes = mRegistrationAttributes;
|
||||
disconnectInfo = mLastDisconnectCause;
|
||||
suggestedAction = mLastDisconnectSuggestedAction;
|
||||
imsDisconnectRadioTech = mLastDisconnectRadioTech;
|
||||
urisSet = mUrisSet;
|
||||
uris = mUris;
|
||||
}
|
||||
switch (state) {
|
||||
case RegistrationManager.REGISTRATION_STATE_NOT_REGISTERED: {
|
||||
c.onDeregistered(disconnectInfo, suggestedAction);
|
||||
c.onDeregistered(disconnectInfo, suggestedAction, imsDisconnectRadioTech);
|
||||
break;
|
||||
}
|
||||
case RegistrationManager.REGISTRATION_STATE_REGISTERING: {
|
||||
|
||||
Reference in New Issue
Block a user