Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aec2604c authored by James.cf Lin's avatar James.cf Lin
Browse files

[UCE] Fix the CTS ImsServiceTest#testRcsPublishThrottle failed

The UCE framework received two consecutive publishing request in a short period of time.
It caused the invalidation of the publish allowed check.

Fix this issue by using a publish lock to protect the process of the publish request.

Bug: 185201813
Test: atest -c CtsTelephonyTestCases:android.telephony.ims.cts.ImsServiceTest
Change-Id: I825ffef4dd358edc8b01fcba3ff0f7d9c693b814
parent e2913d09
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import android.util.LocalLog;
import android.util.Log;

import com.android.ims.rcs.uce.presence.publish.PublishController.PublishControllerCallback;
import com.android.ims.rcs.uce.presence.publish.PublishController.PublishTriggerType;
import com.android.ims.rcs.uce.util.UceUtils;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telephony.util.HandlerExecutor;
@@ -135,7 +136,8 @@ public class DeviceCapabilityListener {
            sendEmptyMessage(EVENT_UNREGISTER_IMS_CHANGE);
        }

        public void sendTriggeringPublishMessage(int type) {
        public void sendTriggeringPublishMessage(@PublishTriggerType int type) {
            logd("sendTriggeringPublishMessage: type=" + type);
            // Remove the existing message and resend a new message.
            removeMessages(EVENT_REQUEST_PUBLISH);
            Message message = obtainMessage();