summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Thomas Stuart <tjstuart@google.com> 2022-01-18 21:43:57 +0000
committer Sarah Chin <sarahchin@google.com> 2022-07-21 00:43:36 +0000
commit6ff1ff9e208125f6281af6efdd26b6f1520328f1 (patch)
tree09d71ad7b1eb16add7fa969b7158e77514550a08
parent2b11e008d2063bb1fc78e5aa23695199ec28228a (diff)
cleanupOrphanPA's feature framework (2/2)*
Bug: 210134615 Test: Unit + manual Change-Id: Ic350e4e45c0d1597c6f61e3e3e717b3a2c1bb099 Merged-In: Ic350e4e45c0d1597c6f61e3e3e717b3a2c1bb099
-rw-r--r--cmds/telecom/src/com/android/commands/telecom/Telecom.java13
-rw-r--r--telecomm/java/com/android/internal/telecom/ITelecomService.aidl2
2 files changed, 15 insertions, 0 deletions
diff --git a/cmds/telecom/src/com/android/commands/telecom/Telecom.java b/cmds/telecom/src/com/android/commands/telecom/Telecom.java
index 8b9ab4c57574..d464e266ac36 100644
--- a/cmds/telecom/src/com/android/commands/telecom/Telecom.java
+++ b/cmds/telecom/src/com/android/commands/telecom/Telecom.java
@@ -73,6 +73,8 @@ 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_CLEANUP_ORPHAN_PHONE_ACCOUNTS =
+ "cleanup-orphan-phone-accounts";
private static final String COMMAND_RESET_CAR_MODE = "reset-car-mode";
/**
@@ -131,6 +133,9 @@ public final class Telecom extends BaseCommand {
+ " provider after a call to emergency services.\n"
+ "usage: telecom cleanup-stuck-calls: Clear any disconnected calls that have"
+ " gotten wedged in Telecom.\n"
+ + "usage: telecom cleanup-orphan-phone-accounts: remove any phone accounts that"
+ + " no longer have a valid UserHandle or accounts that no longer belongs to an"
+ + " installed package.\n"
+ "usage: telecom set-emer-phone-account-filter <PACKAGE>\n"
+ "\n"
+ "telecom set-phone-account-enabled: Enables the given phone account, if it has"
@@ -235,6 +240,9 @@ public final class Telecom extends BaseCommand {
case COMMAND_CLEANUP_STUCK_CALLS:
runCleanupStuckCalls();
break;
+ case COMMAND_CLEANUP_ORPHAN_PHONE_ACCOUNTS:
+ runCleanupOrphanPhoneAccounts();
+ break;
case COMMAND_RESET_CAR_MODE:
runResetCarMode();
break;
@@ -373,6 +381,11 @@ public final class Telecom extends BaseCommand {
mTelecomService.cleanupStuckCalls();
}
+ private void runCleanupOrphanPhoneAccounts() throws RemoteException {
+ System.out.println("Success - cleaned up " + mTelecomService.cleanupOrphanPhoneAccounts()
+ + " phone accounts.");
+ }
+
private void runResetCarMode() throws RemoteException {
mTelecomService.resetCarMode();
}
diff --git a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
index 23b578748370..7a69fe5c1356 100644
--- a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
+++ b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
@@ -340,6 +340,8 @@ interface ITelecomService {
void cleanupStuckCalls();
+ int cleanupOrphanPhoneAccounts();
+
void resetCarMode();
void setTestDefaultCallRedirectionApp(String packageName);