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

Commit 17e97359 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add config resource to specify device specific services"

parents 169dddf8 edfcb00f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3124,4 +3124,8 @@
    <!-- Decide whether to display 'No service' on status bar instead of 'Emergency calls only'
         when SIM is unready. -->
    <bool name="config_display_no_service_when_sim_unready">false</bool>

    <!-- Class names of device specific services inheriting com.android.server.SystemService. The
         classes are instantiated in the order of the array. -->
    <string-array translatable="false" name="config_deviceSpecificSystemServices"></string-array>
</resources>
+1 −0
Original line number Diff line number Diff line
@@ -454,6 +454,7 @@
  <java-symbol type="integer" name="config_keepPreloadsMinDays" />
  <java-symbol type="bool" name="config_hasPermanentDpad" />
  <java-symbol type="bool" name="config_useDefaultFocusHighlight" />
  <java-symbol type="array" name="config_deviceSpecificSystemServices" />

  <java-symbol type="color" name="tab_indicator_text_v4" />

+5 −0
Original line number Diff line number Diff line
@@ -63,6 +63,11 @@ public abstract class SystemService {
     */
    public static final int PHASE_SYSTEM_SERVICES_READY = 500;

    /**
     * After receiving this boot phase, services can safely call into device specific services.
     */
    public static final int PHASE_DEVICE_SPECIFIC_SERVICES_READY = 520;

    /**
     * After receiving this boot phase, services can broadcast Intents.
     */
+19 −0
Original line number Diff line number Diff line
@@ -1656,6 +1656,25 @@ public final class SystemServer {

        mSystemServiceManager.setSafeMode(safeMode);

        // Start device specific services
        traceBeginAndSlog("StartDeviceSpecificServices");
        final String[] classes = mSystemContext.getResources().getStringArray(
                R.array.config_deviceSpecificSystemServices);
        for (final String className : classes) {
            traceBeginAndSlog("StartDeviceSpecificServices " + className);
            try {
                mSystemServiceManager.startService(className);
            } catch (Throwable e) {
                reportWtf("starting " + className, e);
            }
            traceEnd();
        }
        traceEnd();

        traceBeginAndSlog("StartBootPhaseDeviceSpecificServicesReady");
        mSystemServiceManager.startBootPhase(SystemService.PHASE_DEVICE_SPECIFIC_SERVICES_READY);
        traceEnd();

        // These are needed to propagate to the runnable below.
        final NetworkManagementService networkManagementF = networkManagement;
        final NetworkStatsService networkStatsF = networkStats;