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

Unverified Commit ecd74da0 authored by Adnan Begovic's avatar Adnan Begovic Committed by Michael Bestas
Browse files

services: Kick off to LineageSystemServer for external service init.

Change-Id: I2dfe51a4cadfe02f0295be36fb30a304219047ff
parent 5ba1ff44
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -310,6 +310,9 @@ import java.io.File;
import java.io.FileDescriptor;
import java.io.IOException;
import java.io.PrintWriter;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
@@ -2939,6 +2942,26 @@ public final class SystemServer implements Dumpable {
            t.traceEnd();
        }

        // Lineage Services
        String externalServer = context.getResources().getString(
                org.lineageos.platform.internal.R.string.config_externalSystemServer);
        final Class<?> serverClazz;
        try {
            serverClazz = Class.forName(externalServer);
            final Constructor<?> constructor = serverClazz.getDeclaredConstructor(Context.class);
            constructor.setAccessible(true);
            final Object baseObject = constructor.newInstance(mSystemContext);
            final Method method = baseObject.getClass().getDeclaredMethod("run");
            method.setAccessible(true);
            method.invoke(baseObject);
        } catch (ClassNotFoundException
                | IllegalAccessException
                | InvocationTargetException
                | InstantiationException
                | NoSuchMethodException e) {
            reportWtf("Making " + externalServer + " ready", e);
        }

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

        t.traceBegin("MakeLockSettingsServiceReady");