Merge "Syncronize frameowrk and ImsStack operation for ImsFeatureStatusCallback." am: 691bfb642a

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2288914

Change-Id: I7caa2e966bae2ec146ca77b36d2a467d746e2531
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2022-11-08 17:39:48 +00:00
committed by Automerger Merge Worker
2 changed files with 11 additions and 7 deletions

View File

@@ -425,8 +425,8 @@ public class ImsService extends Service {
} }
} }
private IImsRcsFeature createRcsFeatureInternal(int slotId, int subI) { private IImsRcsFeature createRcsFeatureInternal(int slotId, int subId) {
RcsFeature f = createRcsFeatureForSubscription(slotId, subI); RcsFeature f = createRcsFeatureForSubscription(slotId, subId);
if (f != null) { if (f != null) {
f.setDefaultExecutor(mExecutor); f.setDefaultExecutor(mExecutor);
setupFeature(f, slotId, ImsFeature.FEATURE_RCS); setupFeature(f, slotId, ImsFeature.FEATURE_RCS);

View File

@@ -394,10 +394,12 @@ public abstract class ImsFeature {
@VisibleForTesting @VisibleForTesting
public void addImsFeatureStatusCallback(@NonNull IImsFeatureStatusCallback c) { public void addImsFeatureStatusCallback(@NonNull IImsFeatureStatusCallback c) {
try { try {
// If we have just connected, send queued status. synchronized (mStatusCallbacks) {
c.notifyImsFeatureStatus(getFeatureState()); // Add the callback if the callback completes successfully without a RemoteException
// Add the callback if the callback completes successfully without a RemoteException. mStatusCallbacks.register(c);
mStatusCallbacks.register(c); // If we have just connected, send queued status.
c.notifyImsFeatureStatus(getFeatureState());
}
} catch (RemoteException e) { } catch (RemoteException e) {
Log.w(LOG_TAG, "Couldn't notify feature state: " + e.getMessage()); Log.w(LOG_TAG, "Couldn't notify feature state: " + e.getMessage());
} }
@@ -409,7 +411,9 @@ public abstract class ImsFeature {
*/ */
@VisibleForTesting @VisibleForTesting
public void removeImsFeatureStatusCallback(@NonNull IImsFeatureStatusCallback c) { public void removeImsFeatureStatusCallback(@NonNull IImsFeatureStatusCallback c) {
mStatusCallbacks.unregister(c); synchronized (mStatusCallbacks) {
mStatusCallbacks.unregister(c);
}
} }
/** /**