From 589b00177c09762172c011b0279fbdcf8ca7fc3e Mon Sep 17 00:00:00 2001 From: Hall Liu Date: Wed, 3 Feb 2021 12:25:25 -0800 Subject: [PATCH] Add Telecom command to reset car mode Add a command to do a system-wide clobber of car mode in order to prevent cascading CTS failures. Fixes: 179264757 Test: manually fail one of the car mode CTS tests and observe Change-Id: Id363e04d212c5f4d01be23e818b5c5fd1d91eac5 --- .../telecom/src/com/android/commands/telecom/Telecom.java | 8 ++++++++ .../com/android/internal/telecom/ITelecomService.aidl | 2 ++ 2 files changed, 10 insertions(+) diff --git a/cmds/telecom/src/com/android/commands/telecom/Telecom.java b/cmds/telecom/src/com/android/commands/telecom/Telecom.java index 5f13a5ce3aae8..f85e30d38f869 100644 --- a/cmds/telecom/src/com/android/commands/telecom/Telecom.java +++ b/cmds/telecom/src/com/android/commands/telecom/Telecom.java @@ -70,6 +70,7 @@ public final class Telecom extends BaseCommand { private static final String COMMAND_GET_DEFAULT_DIALER = "get-default-dialer"; private static final String COMMAND_STOP_BLOCK_SUPPRESSION = "stop-block-suppression"; private static final String COMMAND_CLEANUP_STUCK_CALLS = "cleanup-stuck-calls"; + private static final String COMMAND_RESET_CAR_MODE = "reset-car-mode"; /** * Change the system dialer package name if a package name was specified, @@ -220,6 +221,9 @@ public final class Telecom extends BaseCommand { case COMMAND_CLEANUP_STUCK_CALLS: runCleanupStuckCalls(); break; + case COMMAND_RESET_CAR_MODE: + runResetCarMode(); + break; case COMMAND_SET_DEFAULT_DIALER: runSetDefaultDialer(); break; @@ -345,6 +349,10 @@ public final class Telecom extends BaseCommand { mTelecomService.cleanupStuckCalls(); } + private void runResetCarMode() throws RemoteException { + mTelecomService.resetCarMode(); + } + private void runSetDefaultDialer() throws RemoteException { String packageName = nextArg(); if ("default".equals(packageName)) packageName = null; diff --git a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl index 6dc096daf4eac..88ef1b09f6b1f 100644 --- a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl +++ b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl @@ -333,6 +333,8 @@ interface ITelecomService { void cleanupStuckCalls(); + void resetCarMode(); + void setTestDefaultCallRedirectionApp(String packageName); void setTestPhoneAcctSuggestionComponent(String flattenedComponentName);