blob: f123fa009bc82388e8c8c847933114e7c97ca1d9
1 | /* |
2 | * Copyright (C) 2008 The Android Open Source Project |
3 | * |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | * you may not use this file except in compliance with the License. |
6 | * You may obtain a copy of the License at |
7 | * |
8 | * http://www.apache.org/licenses/LICENSE-2.0 |
9 | * |
10 | * Unless required by applicable law or agreed to in writing, software |
11 | * distributed under the License is distributed on an "AS IS" BASIS, |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | * See the License for the specific language governing permissions and |
14 | * limitations under the License. |
15 | */ |
16 | |
17 | #ifndef _NETLINKMANAGER_H |
18 | #define _NETLINKMANAGER_H |
19 | |
20 | #include <sysutils/SocketListener.h> |
21 | #include <sysutils/NetlinkListener.h> |
22 | #include "DroidVold.h" |
23 | |
24 | using namespace android; |
25 | using ::vendor::amlogic::hardware::droidvold::V1_0::implementation::DroidVold; |
26 | |
27 | class NetlinkHandler; |
28 | |
29 | class NetlinkManager { |
30 | private: |
31 | static NetlinkManager *sInstance; |
32 | |
33 | private: |
34 | DroidVold *mBroadcaster; |
35 | NetlinkHandler *mHandler; |
36 | int mSock; |
37 | |
38 | public: |
39 | virtual ~NetlinkManager(); |
40 | |
41 | int start(); |
42 | int stop(); |
43 | |
44 | void setBroadcaster(DroidVold *sl) { mBroadcaster = sl; } |
45 | DroidVold *getBroadcaster() { return mBroadcaster; } |
46 | |
47 | static NetlinkManager *Instance(); |
48 | |
49 | private: |
50 | NetlinkManager(); |
51 | }; |
52 | #endif |
53 |