• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "file_manager_service.h"
17 
18 #include "iservice_registry.h"
19 #include "log.h"
20 #include "system_ability_definition.h"
21 #include "ext_storage/ext_storage_subscriber.h"
22 
23 namespace OHOS {
24 namespace FileManagerService {
25 REGISTER_SYSTEM_ABILITY_BY_ID(FileManagerService, FILE_MANAGER_SERVICE_ID, true);
26 
FileManagerService(int32_t systemAbilityId,bool runOnCreate)27 FileManagerService::FileManagerService(int32_t systemAbilityId, bool runOnCreate)
28     : SystemAbility(systemAbilityId, runOnCreate) {}
OnDump()29 void FileManagerService::OnDump() {}
30 
OnStart()31 void FileManagerService::OnStart()
32 {
33     DEBUG_LOG("FileManagerService OnStart");
34     ExtStorageSubscriber::Subscriber();
35     bool res = Publish(this);
36     if (!res) {
37         ERR_LOG("FileManagerService OnStart invalid");
38     }
39 }
40 
OnStop()41 void FileManagerService::OnStop()
42 {
43     DEBUG_LOG("FileManagerService OnStop");
44 }
45 } // namespace FileManagerService
46 } // namespace OHOS