Implement CallEndpoint representation and related APIs
Add CallEndpoint representation related APIs that request change CallEndpoint and to receive changed information
bug: 260952109
Test: CTS test
Change-Id: I60d0c1c73152a4c17f0227f101a844c83ecae1ee
diff --git a/telecomm/java/android/telecom/Phone.java b/telecomm/java/android/telecom/Phone.java
index bc0a146..95a8e16 100644
--- a/telecomm/java/android/telecom/Phone.java
+++ b/telecomm/java/android/telecom/Phone.java
@@ -16,11 +16,14 @@
package android.telecom;
+import android.annotation.CallbackExecutor;
+import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.bluetooth.BluetoothDevice;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Build;
import android.os.Bundle;
+import android.os.OutcomeReceiver;
import android.util.ArrayMap;
import com.android.internal.annotations.GuardedBy;
@@ -30,6 +33,7 @@
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.Executor;
/**
* A unified virtual device providing a means of voice (and other) communication on a device.
@@ -378,6 +382,21 @@
}
/**
+ * Request audio routing to a specific CallEndpoint. When this request is honored, there will
+ * be change to the {@link #getCurrentCallEndpoint()}.
+ *
+ * @param endpoint The call endpoint to use.
+ * @param executor The executor of where the callback will execute.
+ * @param callback The callback to notify the result of the endpoint change.
+ * @hide
+ */
+ public void requestCallEndpointChange(@NonNull CallEndpoint endpoint,
+ @NonNull @CallbackExecutor Executor executor,
+ @NonNull OutcomeReceiver<Void, CallEndpointException> callback) {
+ mInCallAdapter.requestCallEndpointChange(endpoint, executor, callback);
+ }
+
+ /**
* Turns the proximity sensor on. When this request is made, the proximity sensor will
* become active, and the touch screen and display will be turned off when the user's face
* is detected to be in close proximity to the screen. This operation is a no-op on devices