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

Commit 076f5479 authored by Dan Albert's avatar Dan Albert Committed by Gerrit Code Review
Browse files

Merge "Use headers from adb."

parents bbf627a6 1ddd3505
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -54,7 +54,10 @@ RECOVERY_FSTAB_VERSION := 2
LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
LOCAL_CFLAGS += -Wno-unused-parameter

LOCAL_C_INCLUDES += system/vold
LOCAL_C_INCLUDES += \
    system/vold \
    system/extras/ext4_utils \
    system/core/adb \

LOCAL_STATIC_LIBRARIES := \
    libext4_utils_static \
@@ -94,8 +97,6 @@ else
  LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_UI_LIB)
endif

LOCAL_C_INCLUDES += system/extras/ext4_utils

include $(BUILD_EXECUTABLE)

# All the APIs for testing
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ LOCAL_SRC_FILES := \

LOCAL_CFLAGS := -O2 -g -DADB_HOST=0 -Wall -Wno-unused-parameter
LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE
LOCAL_C_INCLUDES += bootable/recovery
LOCAL_C_INCLUDES := bootable/recovery system/core/adb

LOCAL_MODULE := libminadbd

minadbd/fdevent.h

deleted100644 → 0
+0 −90
Original line number Diff line number Diff line
/*
 * Copyright (C) 2006 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.
 */

#ifndef __FDEVENT_H
#define __FDEVENT_H

#include <stdint.h>  /* for int64_t */

#ifdef __cplusplus
extern "C" {
#endif

/* events that may be observed */
#define FDE_READ              0x0001
#define FDE_WRITE             0x0002
#define FDE_ERROR             0x0004
#define FDE_TIMEOUT           0x0008

/* features that may be set (via the events set/add/del interface) */
#define FDE_DONT_CLOSE        0x0080

typedef struct fdevent fdevent;

typedef void (*fd_func)(int fd, unsigned events, void *userdata);

/* Allocate and initialize a new fdevent object
 * Note: use FD_TIMER as 'fd' to create a fd-less object
 * (used to implement timers).
*/
fdevent *fdevent_create(int fd, fd_func func, void *arg);

/* Uninitialize and deallocate an fdevent object that was
** created by fdevent_create()
*/
void fdevent_destroy(fdevent *fde);

/* Initialize an fdevent object that was externally allocated
*/
void fdevent_install(fdevent *fde, int fd, fd_func func, void *arg);

/* Uninitialize an fdevent object that was initialized by
** fdevent_install()
*/
void fdevent_remove(fdevent *item);

/* Change which events should cause notifications
*/
void fdevent_set(fdevent *fde, unsigned events);
void fdevent_add(fdevent *fde, unsigned events);
void fdevent_del(fdevent *fde, unsigned events);

void fdevent_set_timeout(fdevent *fde, int64_t  timeout_ms);

/* loop forever, handling events.
*/
void fdevent_loop();

struct fdevent 
{
    fdevent *next;
    fdevent *prev;

    int fd;
    int force_eof;

    unsigned short state;
    unsigned short events;

    fd_func func;
    void *arg;
};

#ifdef __cplusplus
}
#endif

#endif

minadbd/mutex_list.h

deleted100644 → 0
+0 −26
Original line number Diff line number Diff line
/* the list of mutexes used by adb */
/* #ifndef __MUTEX_LIST_H
 * Do not use an include-guard. This file is included once to declare the locks
 * and once in win32 to actually do the runtime initialization.
 */
#ifndef ADB_MUTEX
#error ADB_MUTEX not defined when including this file
#endif
ADB_MUTEX(dns_lock)
ADB_MUTEX(socket_list_lock)
ADB_MUTEX(transport_lock)
#if ADB_HOST
ADB_MUTEX(local_transports_lock)
#endif
ADB_MUTEX(usb_lock)

// Sadly logging to /data/adb/adb-... is not thread safe.
//  After modifying adb.h::D() to count invocations:
//   DEBUG(jpa):0:Handling main()
//   DEBUG(jpa):1:[ usb_init - starting thread ]
// (Oopsies, no :2:, and matching message is also gone.)
//   DEBUG(jpa):3:[ usb_thread - opening device ]
//   DEBUG(jpa):4:jdwp control socket started (10)
ADB_MUTEX(D_lock)

#undef ADB_MUTEX
+2 −2
Original line number Diff line number Diff line
@@ -47,9 +47,9 @@ void *service_bootstrap_func(void *x)
static void sideload_host_service(int sfd, void* cookie)
{
    char* saveptr;
    const char* s = strtok_r(cookie, ":", &saveptr);
    const char* s = adb_strtok_r(cookie, ":", &saveptr);
    uint64_t file_size = strtoull(s, NULL, 10);
    s = strtok_r(NULL, ":", &saveptr);
    s = adb_strtok_r(NULL, ":", &saveptr);
    uint32_t block_size = strtoul(s, NULL, 10);

    printf("sideload-host file size %llu block size %lu\n", file_size, block_size);
Loading