@SuppressWarnings("unchecked")
    @Nullable
    public static <T> T getSystemService(@NonNull Context context, @NonNull Class<T> serviceClass) {
        if (Build.VERSION.SDK_INT >= 23) {
            return context.getSystemService(serviceClass);
        }

        String serviceName = getSystemServiceName(context, serviceClass);
        return serviceName != null ? (T) context.getSystemService(serviceName) : null;
    }
Return the handle to a system-level service by class.

@param context      Context to retrieve service from.
@param serviceClass The class of the desired service.
@return The service or null if the class is not a supported system service.
@see Context#getSystemService(Class)
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/compat/ContextCompat.java