make all libsurfaceflinger and libsensorservice symbols's visibility hidden

we only export the main entry-point.
this saves about 150KB.

Change-Id: I55eb2b6705386fdfa43860deb62f9cdd2a0982aa
This commit is contained in:
Mathias Agopian 2013-05-09 14:53:35 -07:00
parent 5d85d72a17
commit b6df7d0e4c
5 changed files with 24 additions and 23 deletions

View File

@ -42,19 +42,20 @@ public:
} }
static void publishAndJoinThreadPool(bool allowIsolated = false) { static void publishAndJoinThreadPool(bool allowIsolated = false) {
sp<IServiceManager> sm(defaultServiceManager()); publish(allowIsolated);
sm->addService( joinThreadPool();
String16(SERVICE::getServiceName()),
new SERVICE(), allowIsolated);
ProcessState::self()->startThreadPool();
ProcessState::self()->giveThreadPoolName();
IPCThreadState::self()->joinThreadPool();
} }
static void instantiate() { publish(); } static void instantiate() { publish(); }
static status_t shutdown() { static status_t shutdown() { return NO_ERROR; }
return NO_ERROR;
private:
static void joinThreadPool() {
sp<ProcessState> ps(ProcessState::self());
ps->startThreadPool();
ps->giveThreadPoolName();
IPCThreadState::self()->joinThreadPool();
} }
}; };

View File

@ -12,11 +12,12 @@ LOCAL_SRC_FILES:= \
SensorDevice.cpp \ SensorDevice.cpp \
SensorFusion.cpp \ SensorFusion.cpp \
SensorInterface.cpp \ SensorInterface.cpp \
SensorService.cpp \ SensorService.cpp
LOCAL_CFLAGS:= -DLOG_TAG=\"SensorService\" LOCAL_CFLAGS:= -DLOG_TAG=\"SensorService\"
LOCAL_CFLAGS += -fvisibility=hidden
LOCAL_SHARED_LIBRARIES := \ LOCAL_SHARED_LIBRARIES := \
libcutils \ libcutils \
libhardware \ libhardware \
@ -27,8 +28,6 @@ LOCAL_SHARED_LIBRARIES := \
libui \ libui \
libgui libgui
LOCAL_MODULE:= libsensorservice LOCAL_MODULE:= libsensorservice
include $(BUILD_SHARED_LIBRARY) include $(BUILD_SHARED_LIBRARY)

View File

@ -50,12 +50,13 @@ class SensorService :
public BnSensorServer, public BnSensorServer,
protected Thread protected Thread
{ {
friend class BinderService<SensorService>; friend class BinderService<SensorService>;
static const nsecs_t MINIMUM_EVENTS_PERIOD = 1000000; // 1000 Hz static const nsecs_t MINIMUM_EVENTS_PERIOD = 1000000; // 1000 Hz
static const char* WAKE_LOCK_NAME; static const char* WAKE_LOCK_NAME;
SensorService(); static char const* getServiceName() ANDROID_API { return "sensorservice"; }
SensorService() ANDROID_API;
virtual ~SensorService(); virtual ~SensorService();
virtual void onFirstRef(); virtual void onFirstRef();
@ -116,9 +117,9 @@ class SensorService :
void registerSensor(SensorInterface* sensor); void registerSensor(SensorInterface* sensor);
void registerVirtualSensor(SensorInterface* sensor); void registerVirtualSensor(SensorInterface* sensor);
status_t cleanupWithoutDisable(const sp<SensorEventConnection>& connection, status_t cleanupWithoutDisable(const sp<SensorEventConnection>& connection,
int handle); int handle);
void cleanupAutoDisabledSensor(const sp<SensorEventConnection>& connection, void cleanupAutoDisabledSensor(const sp<SensorEventConnection>& connection,
sensors_event_t const* buffer, const int count); sensors_event_t const* buffer, const int count);
// constants // constants
Vector<Sensor> mSensorList; Vector<Sensor> mSensorList;
@ -138,8 +139,6 @@ class SensorService :
KeyedVector<int32_t, sensors_event_t> mLastEventSeen; KeyedVector<int32_t, sensors_event_t> mLastEventSeen;
public: public:
static char const* getServiceName() { return "sensorservice"; }
void cleanupConnection(SensorEventConnection* connection); void cleanupConnection(SensorEventConnection* connection);
status_t enable(const sp<SensorEventConnection>& connection, int handle); status_t enable(const sp<SensorEventConnection>& connection, int handle);
status_t disable(const sp<SensorEventConnection>& connection, int handle); status_t disable(const sp<SensorEventConnection>& connection, int handle);

View File

@ -41,6 +41,8 @@ ifneq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),)
LOCAL_CFLAGS += -DNUM_FRAMEBUFFER_SURFACE_BUFFERS=$(NUM_FRAMEBUFFER_SURFACE_BUFFERS) LOCAL_CFLAGS += -DNUM_FRAMEBUFFER_SURFACE_BUFFERS=$(NUM_FRAMEBUFFER_SURFACE_BUFFERS)
endif endif
LOCAL_CFLAGS += -fvisibility=hidden
LOCAL_SHARED_LIBRARIES := \ LOCAL_SHARED_LIBRARIES := \
libcutils \ libcutils \
liblog \ liblog \

View File

@ -79,11 +79,11 @@ class SurfaceFlinger : public BinderService<SurfaceFlinger>,
private HWComposer::EventHandler private HWComposer::EventHandler
{ {
public: public:
static char const* getServiceName() { static char const* getServiceName() ANDROID_API {
return "SurfaceFlinger"; return "SurfaceFlinger";
} }
SurfaceFlinger(); SurfaceFlinger() ANDROID_API;
enum { enum {
EVENT_VSYNC = HWC_EVENT_VSYNC EVENT_VSYNC = HWC_EVENT_VSYNC