blob: 1bf4e3a563c96e1ed19d372ee606a88f5a7ba6b2 [file] [log] [blame]
Miao Chou658bf2f2015-06-26 17:14:35 -07001/*
2 * Copyright (C) 2015 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;
18
19import android.bluetooth.BluetoothAdapter;
20import android.content.Context;
Miao Chou658bf2f2015-06-26 17:14:35 -070021
22class BluetoothService extends SystemService {
Miao Chou658bf2f2015-06-26 17:14:35 -070023 private BluetoothManagerService mBluetoothManagerService;
24
25 public BluetoothService(Context context) {
26 super(context);
27 mBluetoothManagerService = new BluetoothManagerService(context);
28 }
29
30 @Override
31 public void onStart() {
Miao Chou658bf2f2015-06-26 17:14:35 -070032 }
33
34 @Override
35 public void onBootPhase(int phase) {
36 if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
Jeff Sharkeyaacb89e2016-03-05 14:42:58 -070037 publishBinderService(BluetoothAdapter.BLUETOOTH_MANAGER_SERVICE,
38 mBluetoothManagerService);
Andre Eisenbach305fdab2015-11-11 21:43:26 -080039 } else if (phase == SystemService.PHASE_ACTIVITY_MANAGER_READY) {
Miao Chou658bf2f2015-06-26 17:14:35 -070040 mBluetoothManagerService.handleOnBootPhase();
41 }
42 }
43
44 @Override
45 public void onSwitchUser(int userHandle) {
Miao Chou658bf2f2015-06-26 17:14:35 -070046 mBluetoothManagerService.handleOnSwitchUser(userHandle);
47 }
Jeff Sharkeyaacb89e2016-03-05 14:42:58 -070048
49 @Override
50 public void onUnlockUser(int userHandle) {
51 mBluetoothManagerService.handleOnUnlockUser(userHandle);
52 }
Miao Chou658bf2f2015-06-26 17:14:35 -070053}