The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | // |
| 2 | // Copyright 2005 The Android Open Source Project |
| 3 | // |
| 4 | #ifndef ANDROID_SERVICE_MANAGER_H |
| 5 | #define ANDROID_SERVICE_MANAGER_H |
| 6 | |
Andy McFadden | 2e37a0ca | 2009-05-26 12:05:54 -0700 | [diff] [blame] | 7 | #include <binder/IServiceManager.h> |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8 | #include <utils/KeyedVector.h> |
| 9 | #include <utils/threads.h> |
| 10 | |
| 11 | namespace android { |
| 12 | |
| 13 | // ---------------------------------------------------------------------- |
| 14 | |
| 15 | class BServiceManager : public BnServiceManager |
| 16 | { |
| 17 | public: |
| 18 | BServiceManager(); |
| 19 | |
| 20 | virtual sp<IBinder> getService( const String16& name) const; |
| 21 | virtual sp<IBinder> checkService( const String16& name) const; |
| 22 | virtual status_t addService( const String16& name, |
| 23 | const sp<IBinder>& service); |
| 24 | virtual Vector<String16> listServices(); |
| 25 | |
| 26 | |
| 27 | private: |
| 28 | mutable Mutex mLock; |
| 29 | mutable Condition mChanged; |
| 30 | sp<IPermissionController> mPermissionController; |
| 31 | KeyedVector<String16, sp<IBinder> > mServices; |
| 32 | }; |
| 33 | |
| 34 | // ---------------------------------------------------------------------- |
| 35 | |
| 36 | }; // namespace android |
| 37 | |
| 38 | #endif // ANDROID_SERVICE_MANAGER_H |