Support for override active D2D transport.
Adding support for overriding the active D2D transport.
Also adding more log messages.
And wire in received DTMF messages into TelephonyConnection.
Prevent D2D for emergency calls.
Test: Manual testing with two devices.
Test: Manual test with test emergency numbers.
Test: Run D2D unit tests.
Bug: 163085177
Change-Id: I5f971fcfc49a86388ed17e1774baf44d920de9b7
diff --git a/src/com/android/phone/TelephonyShellCommand.java b/src/com/android/phone/TelephonyShellCommand.java
index 79dfbcf..ea12984 100644
--- a/src/com/android/phone/TelephonyShellCommand.java
+++ b/src/com/android/phone/TelephonyShellCommand.java
@@ -113,6 +113,7 @@
private static final String D2D_SUBCOMMAND = "d2d";
private static final String D2D_SEND = "send";
+ private static final String D2D_TRANSPORT = "transport";
private static final String RCS_UCE_COMMAND = "uce";
private static final String UCE_GET_EAB_CONTACT = "get-eab-contact";
@@ -271,6 +272,9 @@
MESSAGE_DEVICE_BATTERY_STATE));
pw.println(" Type: " + MESSAGE_DEVICE_NETWORK_COVERAGE + " - "
+ Communicator.messageToString(MESSAGE_DEVICE_NETWORK_COVERAGE));
+ pw.println(" d2d transport TYPE");
+ pw.println(" Forces the specified D2D transport TYPE to be active. Use the");
+ pw.println(" short class name of the transport; i.e. DtmfTransport or RtpTransport.");
}
private void onHelpIms() {
@@ -634,6 +638,9 @@
case D2D_SEND: {
return handleD2dSendCommand();
}
+ case D2D_TRANSPORT: {
+ return handleD2dTransportCommand();
+ }
}
return -1;
@@ -641,11 +648,9 @@
private int handleD2dSendCommand() {
PrintWriter errPw = getErrPrintWriter();
- String opt;
int messageType = -1;
int messageValue = -1;
-
String arg = getNextArg();
if (arg == null) {
onHelpD2D();
@@ -681,6 +686,25 @@
return 0;
}
+ private int handleD2dTransportCommand() {
+ PrintWriter errPw = getErrPrintWriter();
+
+ String arg = getNextArg();
+ if (arg == null) {
+ onHelpD2D();
+ return 0;
+ }
+
+ try {
+ mInterface.setActiveDeviceToDeviceTransport(arg);
+ } catch (RemoteException e) {
+ Log.w(LOG_TAG, "d2d transport error: " + e.getMessage());
+ errPw.println("Exception: " + e.getMessage());
+ return -1;
+ }
+ return 0;
+ }
+
// ims set-ims-service
private int handleImsSetServiceCommand() {
PrintWriter errPw = getErrPrintWriter();