Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3c4cf7c authored by Brad Ebinger's avatar Brad Ebinger
Browse files

Move Telecom shell commands to TelecomShellCommand

1) Move existing telecom shell commands into TelecomShellCommand
2) Make this new file available to the old Telecom commands binary

By moving shell commands to TelecomServiceImpl, we are seeing a
~10X improvement in speed when using shell commands for CTS.

Bug: 327310548
Test: atest CtsTelecomTestCases, manual shell command testing
Change-Id: Ic1d9de208cf65d058784437bf244d5279b676b9c
parent 23433c43
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -11,6 +11,14 @@ genrule {
    out: ["com/android/server/telecom/TelecomStatsLog.java"],
}

filegroup {
    name: "telecom-shell-commands-src",
    srcs: [
        "src/com/android/server/telecom/TelecomShellCommand.java",
    ],
    path: "src",
}

android_library {
    name: "TelecomLib",
    manifest: "AndroidManifestLib.xml",
@@ -33,7 +41,6 @@ android_library {
    platform_apis: true,
}


// Build the Telecom service.
android_app {
    name: "Telecom",
+13 −0
Original line number Diff line number Diff line
@@ -53,8 +53,11 @@ import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
import android.os.OutcomeReceiver;
import android.os.ParcelFileDescriptor;
import android.os.Process;
import android.os.RemoteException;
import android.os.ResultReceiver;
import android.os.ShellCallback;
import android.os.UserHandle;
import android.provider.BlockedNumberContract;
import android.provider.Settings;
@@ -72,12 +75,14 @@ import android.text.TextUtils;
import android.util.EventLog;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telecom.ICallControl;
import com.android.internal.telecom.ICallEventCallback;
import com.android.internal.telecom.ITelecomService;
import com.android.internal.util.IndentingPrintWriter;
import com.android.modules.utils.BasicShellCommandHandler;
import com.android.server.telecom.components.UserCallIntentProcessorFactory;
import com.android.server.telecom.flags.FeatureFlags;
import com.android.server.telecom.settings.BlockedNumbersActivity;
@@ -2092,6 +2097,14 @@ public class TelecomServiceImpl {
            }
        }

        @Override
        public int handleShellCommand(@NonNull ParcelFileDescriptor in,
                @NonNull ParcelFileDescriptor out, @NonNull ParcelFileDescriptor err,
                @NonNull String[] args) {
            return new TelecomShellCommand(this, mContext).exec(this,
                    in.getFileDescriptor(), out.getFileDescriptor(), err.getFileDescriptor(), args);
        }

        /**
         * Print all feature flag configurations that Telecom is using for debugging purposes.
         */
+513 −0

File added.

Preview size limit exceeded, changes collapsed.