1956f54b391677d78379729dd14518edddf3c7660Etan Cohen/*
2956f54b391677d78379729dd14518edddf3c7660Etan Cohen * Copyright (C) 2016 The Android Open Source Project
3956f54b391677d78379729dd14518edddf3c7660Etan Cohen *
4956f54b391677d78379729dd14518edddf3c7660Etan Cohen * Licensed under the Apache License, Version 2.0 (the "License");
5956f54b391677d78379729dd14518edddf3c7660Etan Cohen * you may not use this file except in compliance with the License.
6956f54b391677d78379729dd14518edddf3c7660Etan Cohen * You may obtain a copy of the License at
7956f54b391677d78379729dd14518edddf3c7660Etan Cohen *
8956f54b391677d78379729dd14518edddf3c7660Etan Cohen *      http://www.apache.org/licenses/LICENSE-2.0
9956f54b391677d78379729dd14518edddf3c7660Etan Cohen *
10956f54b391677d78379729dd14518edddf3c7660Etan Cohen * Unless required by applicable law or agreed to in writing, software
11956f54b391677d78379729dd14518edddf3c7660Etan Cohen * distributed under the License is distributed on an "AS IS" BASIS,
12956f54b391677d78379729dd14518edddf3c7660Etan Cohen * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13956f54b391677d78379729dd14518edddf3c7660Etan Cohen * See the License for the specific language governing permissions and
14956f54b391677d78379729dd14518edddf3c7660Etan Cohen * limitations under the License.
15956f54b391677d78379729dd14518edddf3c7660Etan Cohen */
16956f54b391677d78379729dd14518edddf3c7660Etan Cohen
17956f54b391677d78379729dd14518edddf3c7660Etan Cohenpackage com.android.server.wifi.nan;
18956f54b391677d78379729dd14518edddf3c7660Etan Cohen
19956f54b391677d78379729dd14518edddf3c7660Etan Cohenimport android.content.Context;
20956f54b391677d78379729dd14518edddf3c7660Etan Cohenimport android.util.Log;
21956f54b391677d78379729dd14518edddf3c7660Etan Cohen
22956f54b391677d78379729dd14518edddf3c7660Etan Cohenimport com.android.server.SystemService;
23956f54b391677d78379729dd14518edddf3c7660Etan Cohen
24956f54b391677d78379729dd14518edddf3c7660Etan Cohenpublic final class WifiNanService extends SystemService {
25956f54b391677d78379729dd14518edddf3c7660Etan Cohen    private static final String TAG = "WifiNanService";
26956f54b391677d78379729dd14518edddf3c7660Etan Cohen    final WifiNanServiceImpl mImpl;
27956f54b391677d78379729dd14518edddf3c7660Etan Cohen
28956f54b391677d78379729dd14518edddf3c7660Etan Cohen    public WifiNanService(Context context) {
29956f54b391677d78379729dd14518edddf3c7660Etan Cohen        super(context);
30956f54b391677d78379729dd14518edddf3c7660Etan Cohen        mImpl = new WifiNanServiceImpl(context);
31956f54b391677d78379729dd14518edddf3c7660Etan Cohen    }
32956f54b391677d78379729dd14518edddf3c7660Etan Cohen
33956f54b391677d78379729dd14518edddf3c7660Etan Cohen    @Override
34956f54b391677d78379729dd14518edddf3c7660Etan Cohen    public void onStart() {
35956f54b391677d78379729dd14518edddf3c7660Etan Cohen        Log.i(TAG, "Registering " + Context.WIFI_NAN_SERVICE);
36956f54b391677d78379729dd14518edddf3c7660Etan Cohen        publishBinderService(Context.WIFI_NAN_SERVICE, mImpl);
37956f54b391677d78379729dd14518edddf3c7660Etan Cohen    }
38956f54b391677d78379729dd14518edddf3c7660Etan Cohen
39956f54b391677d78379729dd14518edddf3c7660Etan Cohen    @Override
40956f54b391677d78379729dd14518edddf3c7660Etan Cohen    public void onBootPhase(int phase) {
41956f54b391677d78379729dd14518edddf3c7660Etan Cohen        if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
42956f54b391677d78379729dd14518edddf3c7660Etan Cohen            mImpl.start();
43956f54b391677d78379729dd14518edddf3c7660Etan Cohen        }
44956f54b391677d78379729dd14518edddf3c7660Etan Cohen    }
45956f54b391677d78379729dd14518edddf3c7660Etan Cohen}
46956f54b391677d78379729dd14518edddf3c7660Etan Cohen
47