summaryrefslogtreecommitdiffstats
path: root/adb
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2013-12-10 12:37:57 -0800
committerMark Salyzyn <salyzyn@google.com>2014-01-27 15:09:59 -0800
commit7aa39a7b199bb9803d3fd47246ee9530b4a96177 (patch)
treecd07c38af7435f893d7717955617c3051e352cf2 /adb
parentc788278abce1830d4b5e9e78aaefd86d0eecafde (diff)
downloadsystem_core-7aa39a7b199bb9803d3fd47246ee9530b4a96177.zip
system_core-7aa39a7b199bb9803d3fd47246ee9530b4a96177.tar.gz
system_core-7aa39a7b199bb9803d3fd47246ee9530b4a96177.tar.bz2
adb: deprecate legacy log service interface
(cherry picked form commit c66a7537df987715acc77eed952111cc56b7e72b) Change-Id: If96019cc13b3d7a4dcd7785c7137e0cbcc622981
Diffstat (limited to 'adb')
-rw-r--r--adb/Android.mk3
-rw-r--r--adb/SERVICES.TXT5
-rw-r--r--adb/adb.h2
-rw-r--r--adb/log_service.c92
-rw-r--r--adb/services.c2
5 files changed, 1 insertions, 103 deletions
diff --git a/adb/Android.mk b/adb/Android.mk
index 0ab66e4..62f012c 100644
--- a/adb/Android.mk
+++ b/adb/Android.mk
@@ -114,8 +114,7 @@ LOCAL_SRC_FILES := \
jdwp_service.c \
framebuffer_service.c \
remount_service.c \
- usb_linux_client.c \
- log_service.c
+ usb_linux_client.c
LOCAL_CFLAGS := -O2 -g -DADB_HOST=0 -Wall -Wno-unused-parameter
LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE
diff --git a/adb/SERVICES.TXT b/adb/SERVICES.TXT
index 5966686..7f85dc3 100644
--- a/adb/SERVICES.TXT
+++ b/adb/SERVICES.TXT
@@ -198,11 +198,6 @@ localfilesystem:<path>
Variants of local:<path> that are used to access other Android
socket namespaces.
-log:<name>
- Opens one of the system logs (/dev/log/<name>) and allows the client
- to read them directly. Used to implement 'adb logcat'. The stream
- will be read-only for the client.
-
framebuffer:
This service is used to send snapshots of the framebuffer to a client.
It requires sufficient privileges but works as follow:
diff --git a/adb/adb.h b/adb/adb.h
index c85b02a..6f5c93c 100644
--- a/adb/adb.h
+++ b/adb/adb.h
@@ -330,9 +330,7 @@ typedef enum {
} BackupOperation;
int backup_service(BackupOperation operation, char* args);
void framebuffer_service(int fd, void *cookie);
-void log_service(int fd, void *cookie);
void remount_service(int fd, void *cookie);
-char * get_log_file_path(const char * log_name);
#endif
/* packet allocator */
diff --git a/adb/log_service.c b/adb/log_service.c
deleted file mode 100644
index af24356..0000000
--- a/adb/log_service.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/socket.h>
-#include <log/logger.h>
-#include "sysdeps.h"
-#include "adb.h"
-
-#define LOG_FILE_DIR "/dev/log/"
-
-void write_log_entry(int fd, struct logger_entry *buf);
-
-void log_service(int fd, void *cookie)
-{
- /* get the name of the log filepath to read */
- char * log_filepath = cookie;
-
- /* open the log file. */
- int logfd = unix_open(log_filepath, O_RDONLY);
- if (logfd < 0) {
- goto done;
- }
-
- // temp buffer to read the entries
- unsigned char buf[LOGGER_ENTRY_MAX_LEN + 1] __attribute__((aligned(4)));
- struct logger_entry *entry = (struct logger_entry *) buf;
-
- while (1) {
- int ret;
-
- ret = unix_read(logfd, entry, LOGGER_ENTRY_MAX_LEN);
- if (ret < 0) {
- if (errno == EINTR || errno == EAGAIN)
- continue;
- // perror("logcat read");
- goto done;
- }
- else if (!ret) {
- // fprintf(stderr, "read: Unexpected EOF!\n");
- goto done;
- }
-
- /* NOTE: driver guarantees we read exactly one full entry */
-
- entry->msg[entry->len] = '\0';
-
- write_log_entry(fd, entry);
- }
-
-done:
- unix_close(fd);
- free(log_filepath);
-}
-
-/* returns the full path to the log file in a newly allocated string */
-char * get_log_file_path(const char * log_name) {
- char *log_device = malloc(strlen(LOG_FILE_DIR) + strlen(log_name) + 1);
-
- strcpy(log_device, LOG_FILE_DIR);
- strcat(log_device, log_name);
-
- return log_device;
-}
-
-
-/* prints one log entry into the file descriptor fd */
-void write_log_entry(int fd, struct logger_entry *buf)
-{
- size_t size = sizeof(struct logger_entry) + buf->len;
-
- writex(fd, buf, size);
-}
diff --git a/adb/services.c b/adb/services.c
index 1c9db0d..5b63a43 100644
--- a/adb/services.c
+++ b/adb/services.c
@@ -368,8 +368,6 @@ int service_to_fd(const char *name)
ret = create_service_thread(framebuffer_service, 0);
} else if (!strncmp(name, "jdwp:", 5)) {
ret = create_jdwp_connection_fd(atoi(name+5));
- } else if (!strncmp(name, "log:", 4)) {
- ret = create_service_thread(log_service, get_log_file_path(name + 4));
} else if(!HOST && !strncmp(name, "shell:", 6)) {
if(name[6]) {
ret = create_subproc_thread(name + 6);