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

Commit 54175832 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "ignore call streaming msgs if the adapter is destroyed/not set" into...

Merge "ignore call streaming msgs if the adapter is destroyed/not set" into udc-dev am: 72327684 am: 2a525799

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



Change-Id: Ic6dfa9f8500e36d90446e478d7dd3a86908a7a59
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 4068b173 2a525799
Loading
Loading
Loading
Loading
+17 −9
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ import java.lang.annotation.RetentionPolicy;
 * </service>
 * }
 * </pre>
 *
 * @hide
 */
@SystemApi
@@ -65,7 +66,7 @@ public abstract class CallStreamingService extends Service {
    private static final int MSG_SET_STREAMING_CALL_ADAPTER = 1;
    private static final int MSG_CALL_STREAMING_STARTED = 2;
    private static final int MSG_CALL_STREAMING_STOPPED = 3;
    private static final int MSG_CALL_STREAMING_CHANGED_CHANGED = 4;
    private static final int MSG_CALL_STREAMING_STATE_CHANGED = 4;

    /** Default Handler used to consolidate binder method calls onto a single thread. */
    private final Handler mHandler = new Handler(Looper.getMainLooper()) {
@@ -77,8 +78,10 @@ public abstract class CallStreamingService extends Service {

            switch (msg.what) {
                case MSG_SET_STREAMING_CALL_ADAPTER:
                    if (msg.obj != null) {
                        mStreamingCallAdapter = new StreamingCallAdapter(
                                (IStreamingCallAdapter) msg.obj);
                    }
                    break;
                case MSG_CALL_STREAMING_STARTED:
                    mCall = (StreamingCall) msg.obj;
@@ -90,10 +93,12 @@ public abstract class CallStreamingService extends Service {
                    mStreamingCallAdapter = null;
                    CallStreamingService.this.onCallStreamingStopped();
                    break;
                case MSG_CALL_STREAMING_CHANGED_CHANGED:
                case MSG_CALL_STREAMING_STATE_CHANGED:
                    int state = (int) msg.obj;
                    if (mStreamingCallAdapter != null) {
                        mCall.requestStreamingState(state);
                        CallStreamingService.this.onCallStreamingStateChanged(state);
                    }
                    break;
                default:
                    break;
@@ -128,7 +133,7 @@ public abstract class CallStreamingService extends Service {

        @Override
        public void onCallStreamingStateChanged(int state) throws RemoteException {
            mHandler.obtainMessage(MSG_CALL_STREAMING_CHANGED_CHANGED, state).sendToTarget();
            mHandler.obtainMessage(MSG_CALL_STREAMING_STATE_CHANGED, state).sendToTarget();
        }
    }

@@ -175,7 +180,10 @@ public abstract class CallStreamingService extends Service {
                    STREAMING_FAILED_SENDER_BINDING_ERROR
            })
    @Retention(RetentionPolicy.SOURCE)
    public @interface StreamingFailedReason {};
    public @interface StreamingFailedReason {
    }

    ;

    /**
     * Called when a {@code StreamingCall} has been added to this call streaming session. The call