blob: 49f72789736ea3b9e054564ffa26c6f261556b4b [file] [log] [blame]
Andreas Huberd7bee3a2012-08-29 11:41:50 -07001/*
2 * Copyright 2012, 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#include "RemoteDisplay.h"
18
19#include "ANetworkSession.h"
20#include "source/WifiDisplaySource.h"
21
22namespace android {
23
24RemoteDisplay::RemoteDisplay()
25 : mInitCheck(NO_INIT),
26 mLooper(new ALooper),
27 mNetSession(new ANetworkSession),
28 mSource(new WifiDisplaySource(mNetSession)) {
29 mLooper->registerHandler(mSource);
30}
31
32RemoteDisplay::~RemoteDisplay() {
33}
34
Andreas Huberbcf09f82012-08-30 14:51:40 -070035status_t RemoteDisplay::start(const char *iface) {
Andreas Huberd7bee3a2012-08-29 11:41:50 -070036 mNetSession->start();
37 mLooper->start();
38
Andreas Huberbcf09f82012-08-30 14:51:40 -070039 mSource->start(iface);
Andreas Huberd7bee3a2012-08-29 11:41:50 -070040
41 return OK;
42}
43
44status_t RemoteDisplay::stop() {
45 mSource->stop();
46
47 mLooper->stop();
48 mNetSession->stop();
49
50 return OK;
51}
52
53} // namespace android
54