blob: 090ca6de648b22772e5fce02e19e0d3228ef8f30 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001//
2// Copyright 2005 The Android Open Source Project
3//
4#ifndef ANDROID_SERVICE_MANAGER_H
5#define ANDROID_SERVICE_MANAGER_H
6
Andy McFadden2e37a0ca2009-05-26 12:05:54 -07007#include <binder/IServiceManager.h>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008#include <utils/KeyedVector.h>
9#include <utils/threads.h>
10
11namespace android {
12
13// ----------------------------------------------------------------------
14
15class BServiceManager : public BnServiceManager
16{
17public:
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
27private:
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