@Override
            @SuppressWarnings("unchecked")
            public void runSafety() {
                // PackageManagerInternal mPackageManagerInt;
                // https://github.com/LineageOS/android_frameworks_base/blob/lineage-17.1/services/core/java/com/android/server/am/ActivityManagerService.java
                Object mPackageManagerInt = XposedHelpersExt.callMethodWithPreferredNames(ams, new String[]{"getPackageManagerInternal", "getPackageManagerInternalLocked"});
                XLog.w("AMSPackageInternalHooks installPackageManagerInternalHooks, mPackageManagerInt: %s", mPackageManagerInt);
                if (mPackageManagerInt == null) return;
                Object proxy = new PackageManagerInternalProxyFactory(classLoader)
                        .newProxy(mPackageManagerInt, ServiceConfigs.baseServerTmpDir());
                XLog.w("AMSPackageInternalHooks installPackageManagerInternalHooks, proxy: %s", proxy);
                XposedHelpers.setObjectField(ams, "mPackageManagerInt", proxy);
                XLog.w("AMSPackageInternalHooks installPackageManagerInternalHooks success");
            }
We provide this hook to interrupt Android Services startup.
AMS calls ActiveServices to bind or start a Service, PackageManagerInternal#resolveService
will be called while ActiveServices retrieveServiceLocked.
<p>
So, here we proxy PackageManagerInternal and return null if the Service should not be start.
android/android_framework/patch-magisk/patch-framework/src/main/java/github/tornaco/thanox/android/server/patch/framework/hooks/am/AMSPackageInternalHooks.java