Loading cmds/surfaceflinger/main_surfaceflinger.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,6 @@ using namespace android; int main(int argc, char** argv) { SurfaceFlinger::publishAndJoinThreadPool(); SurfaceFlinger::publishAndJoinThreadPool(true); return 0; } include/binder/BinderService.h +4 −4 Original line number Diff line number Diff line Loading @@ -34,15 +34,15 @@ template<typename SERVICE> class BinderService { public: static status_t publish() { static status_t publish(bool allowIsolated = false) { sp<IServiceManager> sm(defaultServiceManager()); return sm->addService(String16(SERVICE::getServiceName()), new SERVICE()); return sm->addService(String16(SERVICE::getServiceName()), new SERVICE(), allowIsolated); } static void publishAndJoinThreadPool() { static void publishAndJoinThreadPool(bool allowIsolated = false) { sp<ProcessState> proc(ProcessState::self()); sp<IServiceManager> sm(defaultServiceManager()); sm->addService(String16(SERVICE::getServiceName()), new SERVICE()); sm->addService(String16(SERVICE::getServiceName()), new SERVICE(), allowIsolated); ProcessState::self()->startThreadPool(); IPCThreadState::self()->joinThreadPool(); } Loading include/binder/IServiceManager.h +2 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,8 @@ public: * Register a service. */ virtual status_t addService( const String16& name, const sp<IBinder>& service) = 0; const sp<IBinder>& service, bool allowIsolated = false) = 0; /** * Return list of all existing services. Loading libs/binder/IServiceManager.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -151,12 +151,14 @@ public: return reply.readStrongBinder(); } virtual status_t addService(const String16& name, const sp<IBinder>& service) virtual status_t addService(const String16& name, const sp<IBinder>& service, bool allowIsolated) { Parcel data, reply; data.writeInterfaceToken(IServiceManager::getInterfaceDescriptor()); data.writeString16(name); data.writeStrongBinder(service); data.writeInt32(allowIsolated ? 1 : 0); status_t err = remote()->transact(ADD_SERVICE_TRANSACTION, data, &reply); return err == NO_ERROR ? reply.readExceptionCode() : err; } Loading Loading
cmds/surfaceflinger/main_surfaceflinger.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,6 @@ using namespace android; int main(int argc, char** argv) { SurfaceFlinger::publishAndJoinThreadPool(); SurfaceFlinger::publishAndJoinThreadPool(true); return 0; }
include/binder/BinderService.h +4 −4 Original line number Diff line number Diff line Loading @@ -34,15 +34,15 @@ template<typename SERVICE> class BinderService { public: static status_t publish() { static status_t publish(bool allowIsolated = false) { sp<IServiceManager> sm(defaultServiceManager()); return sm->addService(String16(SERVICE::getServiceName()), new SERVICE()); return sm->addService(String16(SERVICE::getServiceName()), new SERVICE(), allowIsolated); } static void publishAndJoinThreadPool() { static void publishAndJoinThreadPool(bool allowIsolated = false) { sp<ProcessState> proc(ProcessState::self()); sp<IServiceManager> sm(defaultServiceManager()); sm->addService(String16(SERVICE::getServiceName()), new SERVICE()); sm->addService(String16(SERVICE::getServiceName()), new SERVICE(), allowIsolated); ProcessState::self()->startThreadPool(); IPCThreadState::self()->joinThreadPool(); } Loading
include/binder/IServiceManager.h +2 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,8 @@ public: * Register a service. */ virtual status_t addService( const String16& name, const sp<IBinder>& service) = 0; const sp<IBinder>& service, bool allowIsolated = false) = 0; /** * Return list of all existing services. Loading
libs/binder/IServiceManager.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -151,12 +151,14 @@ public: return reply.readStrongBinder(); } virtual status_t addService(const String16& name, const sp<IBinder>& service) virtual status_t addService(const String16& name, const sp<IBinder>& service, bool allowIsolated) { Parcel data, reply; data.writeInterfaceToken(IServiceManager::getInterfaceDescriptor()); data.writeString16(name); data.writeStrongBinder(service); data.writeInt32(allowIsolated ? 1 : 0); status_t err = remote()->transact(ADD_SERVICE_TRANSACTION, data, &reply); return err == NO_ERROR ? reply.readExceptionCode() : err; } Loading