Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e4ac33b authored by Adnan Begovic's avatar Adnan Begovic
Browse files

SystemServer: Allow starting of overlaid external services.

  This allows external services overlaid in vendor/ whose implementation is
  in a different framework jar to be explicitly started via reflection
  similar to WIFI_SERVICE

Change-Id: I119eda4ab0f447b5bee88e7634a20bdd569ef017
parent b5f732fa
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2012-2015 The CyanogenMod Project
     Copyright (c) 2013, The Linux Foundation. All rights reserved.

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<resources>
    <!-- We don't want to publish private symbols in android.R as part of the
         SDK.  Instead, put them here. -->
    <private-symbols package="com.android.internal" />

    <!-- Private symbols that we need to reference from framework code.  See
         frameworks/base/core/res/MakeJavaSymbols.sed for how to easily generate
         this.
    -->
    <!-- External CM specific core services -->
    <java-symbol type="array" name="config_externalCMServices" />
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -2317,4 +2317,7 @@
    <!-- Configuration that determines if PROTOCOL_ERRORS is to be treated as a
         permanent error -->
    <bool translatable="false" name="config_protocol_errors_perm_failure">true</bool>

    <!-- External CM Services list -->
    <string-array name="config_externalCMServices"></string-array>
</resources>
+11 −0
Original line number Diff line number Diff line
@@ -438,6 +438,8 @@ public final class SystemServer {
        boolean disableNetwork = SystemProperties.getBoolean("config.disable_network", false);
        boolean disableNetworkTime = SystemProperties.getBoolean("config.disable_networktime", false);
        boolean isEmulator = SystemProperties.get("ro.kernel.qemu").equals("1");
        String[] externalServices = context.getResources()
                .getStringArray(com.android.internal.R.array.config_externalCMServices);

        try {
            Slog.i(TAG, "Reading configuration...");
@@ -1002,6 +1004,15 @@ public final class SystemServer {
        // MMS service broker
        mmsService = mSystemServiceManager.startService(MmsServiceBroker.class);

        for (String service : externalServices) {
            try {
                Slog.i(TAG, service);
                mSystemServiceManager.startService(service);
            } catch (Throwable e) {
                Slog.e(TAG, "Failure starting " + service , e);
            }
        }

        // It is now time to start up the app processes...

        try {