summaryrefslogtreecommitdiffstats
path: root/telecomm
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2014-06-20 16:29:33 -0700
committerAndrew Lee <anwlee@google.com>2014-06-24 13:51:59 -0700
commit13d11c3065c9e430ea3c5edef930f50047131446 (patch)
treeb2a95f56f658341ae0da7b4519c461c6451c7018 /telecomm
parent4212d1f2e9f662626a89491c883e94c4d3c68d04 (diff)
downloadframeworks_base-13d11c3065c9e430ea3c5edef930f50047131446.zip
frameworks_base-13d11c3065c9e430ea3c5edef930f50047131446.tar.gz
frameworks_base-13d11c3065c9e430ea3c5edef930f50047131446.tar.bz2
Adding CallVideoProvider to Telecomm.
Change-Id: I16c3c64ff2bcda46e0fd95accb360c972f964b9d
Diffstat (limited to 'telecomm')
-rw-r--r--telecomm/java/android/telecomm/CallVideoProvider.java69
-rw-r--r--telecomm/java/com/android/internal/telecomm/ICallVideoProvider.aidl26
2 files changed, 95 insertions, 0 deletions
diff --git a/telecomm/java/android/telecomm/CallVideoProvider.java b/telecomm/java/android/telecomm/CallVideoProvider.java
new file mode 100644
index 0000000..6126fca
--- /dev/null
+++ b/telecomm/java/android/telecomm/CallVideoProvider.java
@@ -0,0 +1,69 @@
+/*
+ * 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);
+}
diff --git a/telecomm/java/com/android/internal/telecomm/ICallVideoProvider.aidl b/telecomm/java/com/android/internal/telecomm/ICallVideoProvider.aidl
new file mode 100644
index 0000000..c116dcb
--- /dev/null
+++ b/telecomm/java/com/android/internal/telecomm/ICallVideoProvider.aidl
@@ -0,0 +1,26 @@
+/*
+ * 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