Skip to content

Commit 7a3ebf7

Browse files
committed
Allow Kotlin subclasses of SalesforceSDKManager to set themselves as the internal instance.
1 parent 395df46 commit 7a3ebf7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libs/SalesforceSDK/src/com/salesforce/androidsdk/app/SalesforceSDKManager.kt

+6
Original file line numberDiff line numberDiff line change
@@ -1487,6 +1487,12 @@ open class SalesforceSDKManager protected constructor(
14871487
@Suppress("NON_FINAL_MEMBER_IN_OBJECT") // This allows Java subtypes to override this property without an inspector warning
14881488
open fun getInstance() = INSTANCE ?: throw RuntimeException("Apps must call SalesforceSDKManager.init() first.")
14891489

1490+
/** Allow Kotlin subclasses to set themselves as the instance. */
1491+
@JvmSynthetic
1492+
fun setInstance(subclass: SalesforceSDKManager) {
1493+
INSTANCE = subclass
1494+
}
1495+
14901496
/**
14911497
* Indicates if a Salesforce SDK manager instance is initialized.
14921498
* @return true if SalesforceSDKManager has been initialized already

0 commit comments

Comments
 (0)