Skip to content

Commit

Permalink
checkpoint: split libutils into libutils + libbinder
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelflinger committed May 20, 2009
1 parent 6b961bb commit 25ba5b6
Show file tree
Hide file tree
Showing 40 changed files with 172 additions and 62 deletions.
1 change: 1 addition & 0 deletions camera/libcameraservice/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ LOCAL_SRC_FILES:= \
LOCAL_SHARED_LIBRARIES:= \
libui \
libutils \
libbinder \
libcutils \
libmedia

Expand Down
4 changes: 3 additions & 1 deletion cmds/dumpsys/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ LOCAL_SRC_FILES:= \
dumpsys.cpp

LOCAL_SHARED_LIBRARIES := \
libutils
libutils \
libbinder


ifeq ($(TARGET_OS),linux)
LOCAL_CFLAGS += -DXP_UNIX
Expand Down
1 change: 1 addition & 0 deletions cmds/runtime/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ LOCAL_SRC_FILES:= \

LOCAL_SHARED_LIBRARIES := \
libutils \
libbinder \
libandroid_runtime \
libcutils \
libui \
Expand Down
3 changes: 1 addition & 2 deletions cmds/service/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
service.cpp

LOCAL_SHARED_LIBRARIES := \
libutils
LOCAL_SHARED_LIBRARIES := libutils libbinder

ifeq ($(TARGET_OS),linux)
LOCAL_CFLAGS += -DXP_UNIX
Expand Down
1 change: 1 addition & 0 deletions cmds/surfaceflinger/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ LOCAL_SRC_FILES:= \

LOCAL_SHARED_LIBRARIES := \
libsurfaceflinger \
libbinder \
libutils

LOCAL_C_INCLUDES := \
Expand Down
1 change: 1 addition & 0 deletions cmds/system_server/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ LOCAL_SRC_FILES:= \

LOCAL_SHARED_LIBRARIES := \
libutils \
libbinder \
libsystem_server

LOCAL_C_INCLUDES := \
Expand Down
1 change: 1 addition & 0 deletions cmds/system_server/library/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ LOCAL_SHARED_LIBRARIES := \
libcameraservice \
libmediaplayerservice \
libutils \
libbinder \
libcutils

LOCAL_MODULE:= libsystem_server
Expand Down
1 change: 1 addition & 0 deletions core/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ LOCAL_SHARED_LIBRARIES := \
libnativehelper \
libcutils \
libutils \
libbinder \
libnetutils \
libui \
libskiagl \
Expand Down
39 changes: 39 additions & 0 deletions include/private/binder/Static.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (C) 2008 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.
*/

// All static variables go here, to control initialization and
// destruction order in the library.

#include <utils/threads.h>

#include <utils/IBinder.h>
#include <utils/IMemory.h>
#include <utils/ProcessState.h>
#include <utils/IPermissionController.h>
#include <utils/IServiceManager.h>

namespace android {

// For ProcessState.cpp
extern Mutex gProcessMutex;
extern sp<ProcessState> gProcess;

// For ServiceManager.cpp
extern Mutex gDefaultServiceManagerLock;
extern sp<IServiceManager> gDefaultServiceManager;
extern sp<IPermissionController> gPermissionController;

} // namespace android
File renamed without changes.
5 changes: 4 additions & 1 deletion include/private/utils/Static.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@
#include <utils/threads.h>
#include <utils/KeyedVector.h>

/*
#ifndef LIBUTILS_NATIVE
#include <utils/IBinder.h>
#include <utils/IMemory.h>
#include <utils/ProcessState.h>
#include <utils/IPermissionController.h>
#include <utils/IServiceManager.h>
#endif
*/

namespace android {
// For TextStream.cpp
Expand All @@ -41,7 +43,7 @@ extern void initialize_string16();
extern void terminate_string16();



/*
#ifndef LIBUTILS_NATIVE
// For ProcessState.cpp
Expand All @@ -54,5 +56,6 @@ extern sp<IServiceManager> gDefaultServiceManager;
extern sp<IPermissionController> gPermissionController;
#endif
*/

} // namespace android
2 changes: 2 additions & 0 deletions libs/audioflinger/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ LOCAL_SRC_FILES:= \
LOCAL_SHARED_LIBRARIES := \
libcutils \
libutils \
libbinder \
libmedia \
libhardware_legacy

Expand All @@ -34,6 +35,7 @@ LOCAL_SRC_FILES:= \
LOCAL_SHARED_LIBRARIES := \
libcutils \
libutils \
libbinder \
libmedia \
libhardware_legacy

Expand Down
44 changes: 44 additions & 0 deletions libs/binder/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright (C) 2009 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.

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

# we have the common sources, plus some device-specific stuff
LOCAL_SRC_FILES:= \
Binder.cpp \
BpBinder.cpp \
IInterface.cpp \
IMemory.cpp \
IPCThreadState.cpp \
IPermissionController.cpp \
IServiceManager.cpp \
MemoryDealer.cpp \
MemoryBase.cpp \
MemoryHeapBase.cpp \
MemoryHeapPmem.cpp \
Parcel.cpp \
ProcessState.cpp \
Static.cpp

LOCAL_LDLIBS += -lpthread

LOCAL_SHARED_LIBRARIES := \
liblog \
libcutils \
libutils

LOCAL_MODULE:= libbinder

include $(BUILD_SHARED_LIBRARY)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#include <utils/TextOutput.h>
#include <utils/threads.h>

#include <private/utils/binder_module.h>
#include <private/utils/Static.h>
#include <private/binder/binder_module.h>
#include <private/binder/Static.h>

#include <sys/ioctl.h>
#include <signal.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <utils/Parcel.h>
#include <utils/String8.h>

#include <private/utils/Static.h>
#include <private/binder/Static.h>

namespace android {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <utils/String8.h>
#include <utils/SystemClock.h>

#include <private/utils/Static.h>
#include <private/binder/Static.h>

#include <unistd.h>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion libs/utils/Parcel.cpp → libs/binder/Parcel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <utils/TextOutput.h>
#include <utils/misc.h>

#include <private/utils/binder_module.h>
#include <private/binder/binder_module.h>

#include <stdio.h>
#include <stdlib.h>
Expand Down
4 changes: 2 additions & 2 deletions libs/utils/ProcessState.cpp → libs/binder/ProcessState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
#include <utils/String8.h>
#include <utils/threads.h>

#include <private/utils/binder_module.h>
#include <private/utils/Static.h>
#include <private/binder/binder_module.h>
#include <private/binder/Static.h>

#include <errno.h>
#include <fcntl.h>
Expand Down
53 changes: 53 additions & 0 deletions libs/binder/Static.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright (C) 2008 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.
*/

// All static variables go here, to control initialization and
// destruction order in the library.

#include <private/binder/Static.h>

#include <utils/IPCThreadState.h>
#include <utils/Log.h>

namespace android {

// ------------ ProcessState.cpp

Mutex gProcessMutex;
sp<ProcessState> gProcess;

class LibUtilsIPCtStatics
{
public:
LibUtilsIPCtStatics()
{
}

~LibUtilsIPCtStatics()
{
IPCThreadState::shutdown();
}
};

static LibUtilsIPCtStatics gIPCStatics;

// ------------ ServiceManager.cpp

Mutex gDefaultServiceManagerLock;
sp<IServiceManager> gDefaultServiceManager;
sp<IPermissionController> gPermissionController;

} // namespace android
1 change: 1 addition & 0 deletions libs/surfaceflinger/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ endif
LOCAL_SHARED_LIBRARIES := \
libhardware \
libutils \
libbinder \
libcutils \
libui \
libcorecg \
Expand Down
1 change: 1 addition & 0 deletions libs/ui/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ LOCAL_SHARED_LIBRARIES := \
libcorecg \
libcutils \
libutils \
libbinder \
libpixelflinger \
libhardware \
libhardware_legacy
Expand Down
13 changes: 0 additions & 13 deletions libs/utils/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,6 @@ include $(CLEAR_VARS)
# we have the common sources, plus some device-specific stuff
LOCAL_SRC_FILES:= \
$(commonSources) \
Binder.cpp \
BpBinder.cpp \
IInterface.cpp \
IMemory.cpp \
IPCThreadState.cpp \
MemoryDealer.cpp \
MemoryBase.cpp \
MemoryHeapBase.cpp \
MemoryHeapPmem.cpp \
Parcel.cpp \
ProcessState.cpp \
IPermissionController.cpp \
IServiceManager.cpp \
Unicode.cpp \
backup_data.cpp \
backup_helper_file.cpp
Expand Down
31 changes: 0 additions & 31 deletions libs/utils/Static.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <private/utils/Static.h>

#include <utils/BufferedTextOutput.h>
#include <utils/IPCThreadState.h>
#include <utils/Log.h>

namespace android {
Expand Down Expand Up @@ -87,34 +86,4 @@ TextOutput& alog(gLogTextOutput);
TextOutput& aout(gStdoutTextOutput);
TextOutput& aerr(gStderrTextOutput);

#ifndef LIBUTILS_NATIVE

// ------------ ProcessState.cpp

Mutex gProcessMutex;
sp<ProcessState> gProcess;

class LibUtilsIPCtStatics
{
public:
LibUtilsIPCtStatics()
{
}

~LibUtilsIPCtStatics()
{
IPCThreadState::shutdown();
}
};

static LibUtilsIPCtStatics gIPCStatics;

// ------------ ServiceManager.cpp

Mutex gDefaultServiceManagerLock;
sp<IServiceManager> gDefaultServiceManager;
sp<IPermissionController> gPermissionController;

#endif

} // namespace android
1 change: 1 addition & 0 deletions media/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ LOCAL_SHARED_LIBRARIES := \
libnativehelper \
libcutils \
libutils \
libbinder \
libmedia \
libsgl \
libui
Expand Down
1 change: 1 addition & 0 deletions media/jni/soundpool/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ LOCAL_SRC_FILES:= \
LOCAL_SHARED_LIBRARIES := \
libcutils \
libutils \
libbinder \
libandroid_runtime \
libnativehelper \
libmedia
Expand Down
Loading

0 comments on commit 25ba5b6

Please sign in to comment.