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
17package com.android.server.wifi;
18
19
20import android.content.Context;
21import android.util.Log;
22
23import com.android.server.SystemService;
24
25public class WifiScanningService extends SystemService {
26
27    private static final String TAG = "WifiScanningService";
28    WifiScanningServiceImpl mImpl;
29
30    public WifiScanningService(Context context) {
31        super(context);
32        Log.i(TAG, "Creating " + Context.WIFI_SCANNING_SERVICE);
33    }
34
35    @Override
36    public void onStart() {
37        mImpl = new WifiScanningServiceImpl(getContext());
38
39        Log.i(TAG, "Starting " + Context.WIFI_SCANNING_SERVICE);
40        publishBinderService(Context.WIFI_SCANNING_SERVICE, mImpl);
41    }
42
43    @Override
44    public void onBootPhase(int phase) {
45        if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
46            Log.i(TAG, "Registering " + Context.WIFI_SCANNING_SERVICE);
47            if (mImpl == null) {
48                mImpl = new WifiScanningServiceImpl(getContext());
49            }
50            mImpl.startService(getContext());
51        }
52    }
53}
54