diff --git a/OneSignalSDK/onesignal/core/src/main/java/com/onesignal/common/services/ServiceProvider.kt b/OneSignalSDK/onesignal/core/src/main/java/com/onesignal/common/services/ServiceProvider.kt index aaa767c3ab..207fa90e54 100644 --- a/OneSignalSDK/onesignal/core/src/main/java/com/onesignal/common/services/ServiceProvider.kt +++ b/OneSignalSDK/onesignal/core/src/main/java/com/onesignal/common/services/ServiceProvider.kt @@ -1,7 +1,5 @@ package com.onesignal.common.services -import com.onesignal.debug.internal.logging.Logging - /** * A service provider gives access to the implementations of a service. */ @@ -66,7 +64,6 @@ class ServiceProvider( override fun getService(c: Class): T { val service = getServiceOrNull(c) if (service == null) { - Logging.warn("Service not found: $c") throw Exception("Service $c could not be instantiated") } @@ -75,7 +72,6 @@ class ServiceProvider( override fun getServiceOrNull(c: Class): T? { synchronized(serviceMap) { - Logging.debug("${indent}Retrieving service $c") return serviceMap[c]?.last()?.resolve(this) as T? } } diff --git a/OneSignalSDK/onesignal/core/src/main/java/com/onesignal/common/services/ServiceRegistration.kt b/OneSignalSDK/onesignal/core/src/main/java/com/onesignal/common/services/ServiceRegistration.kt index 0298381be9..7d5ed3a5c5 100644 --- a/OneSignalSDK/onesignal/core/src/main/java/com/onesignal/common/services/ServiceRegistration.kt +++ b/OneSignalSDK/onesignal/core/src/main/java/com/onesignal/common/services/ServiceRegistration.kt @@ -11,9 +11,7 @@ import java.lang.reflect.WildcardType abstract class ServiceRegistration { val services: MutableSet> = mutableSetOf() - inline fun provides(): ServiceRegistration { - return provides(TService::class.java) - } + inline fun provides(): ServiceRegistration = provides(TService::class.java) /** * Indicate this registration wants to provide the provided class as @@ -53,14 +51,12 @@ class ServiceRegistrationReflection( override fun resolve(provider: IServiceProvider): Any? { if (obj != null) { - Logging.debug("${ServiceProvider.indent}Already instantiated: $obj") return obj } // use reflection to try to instantiate the thing for (constructor in clazz.constructors) { if (doesHaveAllParameters(constructor, provider)) { - Logging.debug("${ServiceProvider.indent}Found constructor: $constructor") var paramList: MutableList = mutableListOf() for (param in constructor.genericParameterTypes) { @@ -106,13 +102,13 @@ class ServiceRegistrationReflection( val clazz = argType.upperBounds.first() if (clazz is Class<*>) { if (!provider.hasService(clazz)) { - Logging.debug("Constructor $constructor could not find service: $clazz") + Logging.error("Constructor $constructor could not find service: $clazz") return false } } } else if (argType is Class<*>) { if (!provider.hasService(argType)) { - Logging.debug("Constructor $constructor could not find service: $argType") + Logging.error("Constructor $constructor could not find service: $argType") return false } } else { @@ -120,11 +116,11 @@ class ServiceRegistrationReflection( } } else if (param is Class<*>) { if (!provider.hasService(param)) { - Logging.debug("Constructor $constructor could not find service: $param") + Logging.error("Constructor $constructor could not find service: $param") return false } } else { - Logging.debug("Constructor $constructor could not identify param type: $param") + Logging.error("Constructor $constructor could not identify param type: $param") return false } }