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

Commit 13d11c30 authored by Andrew Lee's avatar Andrew Lee
Browse files

Adding CallVideoProvider to Telecomm.

Change-Id: I16c3c64ff2bcda46e0fd95accb360c972f964b9d
parent 4212d1f2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -330,6 +330,7 @@ LOCAL_SRC_FILES += \
	telecomm/java/com/android/internal/telecomm/ICallServiceAdapter.aidl \
	telecomm/java/com/android/internal/telecomm/ICallServiceLookupResponse.aidl \
	telecomm/java/com/android/internal/telecomm/ICallServiceProvider.aidl \
	telecomm/java/com/android/internal/telecomm/ICallVideoProvider.aidl \
	telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl \
	telecomm/java/com/android/internal/telecomm/IInCallService.aidl \
	telecomm/java/com/android/internal/telecomm/ITelecommService.aidl \
+69 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2014 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.telecomm;

import android.app.Service;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;

import com.android.internal.telecomm.ICallVideoProvider;

/** @hide */
public abstract class CallVideoProvider {
    private static final int MSG_SET_CAMERA = 1;

    /**
     * Default handler used to consolidate binder method calls onto a single thread.
     */
    private final class CallVideoProviderHandler extends Handler {
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what) {
                case MSG_SET_CAMERA:
                    setCamera((String) msg.obj);
                default:
                    break;
            }
        }
    }

    /**
     * Default ICallVideoProvider implementation.
     */
    private final class CallVideoProviderBinder extends ICallVideoProvider.Stub {
        public void setCamera(String cameraId) {
            mMessageHandler.obtainMessage(MSG_SET_CAMERA, cameraId).sendToTarget();
        }
    }

    private final CallVideoProviderHandler mMessageHandler = new CallVideoProviderHandler();
    private final CallVideoProviderBinder mBinder;

    protected CallVideoProvider() {
        mBinder = new CallVideoProviderBinder();
    }

    /**
     * Sets the camera to be used for video recording in a video call.
     *
     * @param cameraId The id of the camera.
     */
    public abstract void setCamera(String cameraId);
}
+26 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2014 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.internal.telecomm;

/**
 * Internal remote interface for a call video provider.
 * @see android.telecomm.CallVideoProvider
 * @hide
 */
oneway interface ICallVideoProvider {
    void setCamera(String cameraId);
}
 No newline at end of file