The Android Open Source Project | 89fa4ad | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | ** |
| 3 | ** Copyright 2008, The Android Open Source Project |
| 4 | ** |
| 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | ** you may not use this file except in compliance with the License. |
| 7 | ** You may obtain a copy of the License at |
| 8 | ** |
| 9 | ** http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | ** |
| 11 | ** Unless required by applicable law or agreed to in writing, software |
| 12 | ** distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | ** See the License for the specific language governing permissions and |
| 15 | ** limitations under the License. |
| 16 | */ |
| 17 | |
Glenn Kasten | 33df529 | 2011-12-19 14:09:14 -0800 | [diff] [blame] | 18 | #define LOG_TAG "mediaserver" |
Glenn Kasten | b4d3074 | 2012-03-13 14:46:23 -0700 | [diff] [blame] | 19 | //#define LOG_NDEBUG 0 |
Glenn Kasten | 33df529 | 2011-12-19 14:09:14 -0800 | [diff] [blame] | 20 | |
Neil Fuller | 9447c68 | 2019-03-11 19:35:25 +0000 | [diff] [blame] | 21 | #include <aicu/AIcu.h> |
Mathias Agopian | 7562408 | 2009-05-19 19:08:10 -0700 | [diff] [blame] | 22 | #include <binder/IPCThreadState.h> |
| 23 | #include <binder/ProcessState.h> |
| 24 | #include <binder/IServiceManager.h> |
Pawin Vongmasa | a4c3965 | 2020-06-30 09:30:58 -0700 | [diff] [blame] | 25 | #include <hidl/HidlTransportSupport.h> |
The Android Open Source Project | 89fa4ad | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 26 | #include <utils/Log.h> |
Glenn Kasten | feb2179 | 2013-02-20 16:47:28 -0800 | [diff] [blame] | 27 | #include "RegisterExtensions.h" |
The Android Open Source Project | 89fa4ad | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 28 | |
Glenn Kasten | b4d3074 | 2012-03-13 14:46:23 -0700 | [diff] [blame] | 29 | // from LOCAL_C_INCLUDES |
Glenn Kasten | b4d3074 | 2012-03-13 14:46:23 -0700 | [diff] [blame] | 30 | #include "MediaPlayerService.h" |
Ronghua Wu | 67e7f54 | 2015-03-13 10:47:08 -0700 | [diff] [blame] | 31 | #include "ResourceManagerService.h" |
The Android Open Source Project | 89fa4ad | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 32 | |
| 33 | using namespace android; |
| 34 | |
Marco Nelissen | dcb346b | 2015-09-09 10:47:29 -0700 | [diff] [blame] | 35 | int main(int argc __unused, char **argv __unused) |
The Android Open Source Project | 89fa4ad | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 36 | { |
Glenn Kasten | 879d503 | 2012-10-17 12:16:50 -0700 | [diff] [blame] | 37 | signal(SIGPIPE, SIG_IGN); |
Marco Nelissen | dcb346b | 2015-09-09 10:47:29 -0700 | [diff] [blame] | 38 | |
| 39 | sp<ProcessState> proc(ProcessState::self()); |
| 40 | sp<IServiceManager> sm(defaultServiceManager()); |
| 41 | ALOGI("ServiceManager: %p", sm.get()); |
Neil Fuller | 9447c68 | 2019-03-11 19:35:25 +0000 | [diff] [blame] | 42 | AIcu_initializeIcuOrDie(); |
Marco Nelissen | dcb346b | 2015-09-09 10:47:29 -0700 | [diff] [blame] | 43 | MediaPlayerService::instantiate(); |
Chong Zhang | fdd512a | 2019-11-22 11:03:14 -0800 | [diff] [blame] | 44 | ResourceManagerService::instantiate(); |
Marco Nelissen | dcb346b | 2015-09-09 10:47:29 -0700 | [diff] [blame] | 45 | registerExtensions(); |
Pawin Vongmasa | a4c3965 | 2020-06-30 09:30:58 -0700 | [diff] [blame] | 46 | ::android::hardware::configureRpcThreadpool(16, false); |
Marco Nelissen | dcb346b | 2015-09-09 10:47:29 -0700 | [diff] [blame] | 47 | ProcessState::self()->startThreadPool(); |
| 48 | IPCThreadState::self()->joinThreadPool(); |
Pawin Vongmasa | a4c3965 | 2020-06-30 09:30:58 -0700 | [diff] [blame] | 49 | ::android::hardware::joinRpcThreadpool(); |
The Android Open Source Project | 89fa4ad | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 50 | } |