zoukankan      html  css  js  c++  java
  • [android] add system services

     

    add system services

    1. add ACTIVITY_SERVICE

    frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java

        public void setSystemProcess() {
            try {
                ServiceManager.addService(Context.ACTIVITY_SERVICE, this, /* allowIsolated= */ true,
                        DUMP_FLAG_PRIORITY_CRITICAL | DUMP_FLAG_PRIORITY_NORMAL | DUMP_FLAG_PROTO);
                ServiceManager.addService(ProcessStats.SERVICE_NAME, mProcessStats);
                ServiceManager.addService("meminfo", new MemBinder(this), /* allowIsolated= */ false,
                        DUMP_FLAG_PRIORITY_HIGH);
                ServiceManager.addService("gfxinfo", new GraphicsBinder(this));
                ServiceManager.addService("dbinfo", new DbBinder(this));
                if (MONITOR_CPU_USAGE) {
                    ServiceManager.addService("cpuinfo", new CpuBinder(this),
                            /* allowIsolated= */ false, DUMP_FLAG_PRIORITY_CRITICAL);
                }
                ServiceManager.addService("permission", new PermissionController(this));
                ServiceManager.addService("processinfo", new ProcessInfoService(this));
           ...

    2. add TV_INPUT_SERVICE

    frameworks/base/services/core/java/com/android/server/tv/TvInputManagerService.java

        @Override
        public void onStart() {
            publishBinderService(Context.TV_INPUT_SERVICE, new BinderService());
        }
    

    3.  

    frameworks/base/services/java/com/android/server/SystemService.java

        private void run() {
            try {
                traceBeginAndSlog("StartServices");
                startBootstrapServices();
                startCoreServices();
                startOtherServices();
                ...
    

      

        private void startOtherServices() {
                try {
                    networkManagement = NetworkManagementService.create(context);
                    ServiceManager.addService(Context.NETWORKMANAGEMENT_SERVICE, networkManagement);
                try {
                    networkStats = NetworkStatsService.create(context, networkManagement);
                    ServiceManager.addService(Context.NETWORK_STATS_SERVICE, networkStats);
                try {
                    networkPolicy = new NetworkPolicyManagerService(context, mActivityManagerService,
                            networkManagement);
                    ServiceManager.addService(Context.NETWORK_POLICY_SERVICE, networkPolicy);
    

      

     

      

  • 相关阅读:
    pip安装软件时出现Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build*的解决方案
    tidb安装
    TIDB 5.0 安装体验 怎么快速玩起来
    利用Tampermonkey(油猴)+ IDM 实现百度云盘大文件下载(IDM安装教程)
    python字典及相关操作
    【转载】CEO:我需要什么样的产品经理?
    2014年3月第三周/第一次跳槽、心情低潮期、与老总沟通问题
    hello word!
    function(event)中的event详解
    CSS 伪类
  • 原文地址:https://www.cnblogs.com/aspirs/p/11517420.html
Copyright © 2011-2022 走看看