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

Commit b3615d35 authored by Brad Ebinger's avatar Brad Ebinger Committed by Android (Google) Code Review
Browse files

Merge changes If00c4fec,I2deb5019,I2dd25bdf into main

* changes:
  Redirect requests from "telecom" to "cmd telecom" to remove deps
  Move services/ telecom deps to telecomm/ for mainline
  Move the APIs to framework subfolder in order to align with module
parents 2174c06d 01132da7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -197,7 +197,7 @@ java_defaults {
            "opengl/java",
            "rs/java",
            "sax/java",
            "telecomm/java",
            "telecomm/framework/java",

            // TODO(b/147699819): remove this
            "telephony/java",
+0 −1
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ java_binary {
    name: "telecom",
    wrapper: "telecom.sh",
    srcs: [
        ":telecom-shell-commands-src",
        "**/*.java",
    ],
}
+20 −20
Original line number Diff line number Diff line
@@ -16,20 +16,16 @@

package com.android.commands.telecom;

import android.app.ActivityThread;
import android.content.Context;
import android.os.Looper;
import android.os.ServiceManager;

import com.android.internal.telecom.ITelecomService;
import com.android.server.telecom.TelecomShellCommand;

import java.io.BufferedReader;
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;

/**
 * @deprecated Use {@code com.android.server.telecom.TelecomShellCommand} instead and execute the
 * shell command using {@code adb shell cmd telecom...}. This is only here for backwards
 * compatibility reasons.
 * shell command using {@code adb shell cmd telecom...}. Commands sent here are proxied to telecom
 * for backwards compatibility reasons.
 */
@Deprecated
public final class Telecom {
@@ -40,15 +36,19 @@ public final class Telecom {
     * @param args The command-line arguments
     */
    public static void main(String[] args) {
        // Initialize the telephony module.
        // TODO: Do it in zygote and RuntimeInit. b/148897549
        ActivityThread.initializeMainlineModules();

        Looper.prepareMainLooper();
        ITelecomService service = ITelecomService.Stub.asInterface(
                ServiceManager.getService(Context.TELECOM_SERVICE));
        Context context = ActivityThread.systemMain().getSystemContext();
        new TelecomShellCommand(service, context).exec(null, FileDescriptor.in,
                FileDescriptor.out, FileDescriptor.err, args);
        PrintWriter outputWriter = new PrintWriter(new FileOutputStream(FileDescriptor.out));
        try {
            // proxy args to "cmd telecom" and send response to output.
            Process proc = Runtime.getRuntime().exec("cmd telecom " + String.join(" ", args));
            BufferedReader stdInput = new BufferedReader(
                    new InputStreamReader(proc.getInputStream()));
            proc.waitFor();
            while (stdInput.ready()) {
                outputWriter.print((char) stdInput.read());
            }
        } catch (Exception e) {
            outputWriter.print("error executing command: " + e);
        }
        outputWriter.flush();
    }
}
+3 −0
Original line number Diff line number Diff line
@@ -162,6 +162,9 @@ java_library_static {
        // Java/AIDL sources to be moved out to CrashRecovery module
        ":services-crashrecovery-sources",

        // Telecom sources to move out to Telecom module
        ":service-telecom-sources",

        // Indicate whether VCN is in platform or mainline
        ":vcn-location-sources",
    ],
+1 −0
Original line number Diff line number Diff line
@@ -14,5 +14,6 @@ filegroup {
        "**/*.java",
        "**/*.aidl",
    ],
    path: "java",
    visibility: ["//frameworks/base"],
}
Loading