@@ -230,7 +230,7 @@ open class SalesforceSDKManager protected constructor(
230
230
}.also { field = it }
231
231
232
232
/* * The Salesforce SDK manager's login server manager */
233
- val loginServerManager by lazy {
233
+ open val loginServerManager by lazy {
234
234
LoginServerManager (appContext)
235
235
}
236
236
@@ -316,8 +316,8 @@ open class SalesforceSDKManager protected constructor(
316
316
* based on the value configured on the server
317
317
*/
318
318
@set:Synchronized
319
- var isBrowserLoginEnabled = false
320
- private set
319
+ open var isBrowserLoginEnabled = false
320
+ protected set
321
321
322
322
/* * Optionally enables browser session sharing */
323
323
var isShareBrowserSessionEnabled = false
@@ -379,8 +379,9 @@ open class SalesforceSDKManager protected constructor(
379
379
* By default, the display name under
380
380
* [android.content.pm.ApplicationInfo.labelRes] will be used.
381
381
*/
382
+ @Suppress(" INAPPLICABLE_JVM_NAME" )
382
383
@get:JvmName(" provideAppName" )
383
- var appName: String? = null
384
+ open var appName: String? = null
384
385
get() = runCatching {
385
386
if (field == null ) {
386
387
val packageInfo = appContext.packageManager.getPackageInfo(
@@ -437,7 +438,7 @@ open class SalesforceSDKManager protected constructor(
437
438
* BuildConfig.DEBUG unless another value is specified.
438
439
* @return Boolean true enables developer support features; false otherwise
439
440
*/
440
- fun isDevSupportEnabled () = isDevSupportEnabledOverride ? : isDebugBuild
441
+ open fun isDevSupportEnabled () = isDevSupportEnabledOverride ? : isDebugBuild
441
442
442
443
/* *
443
444
* Sets if developer support features are enabled.
@@ -486,15 +487,15 @@ open class SalesforceSDKManager protected constructor(
486
487
}
487
488
488
489
/* * Login options associated with the app */
489
- val loginOptions: LoginOptions get() = getLoginOptions(null , null )
490
+ open val loginOptions: LoginOptions get() = getLoginOptions(null , null )
490
491
491
492
/* *
492
493
* Sets the login options associated with the app.
493
494
*
494
495
* @param jwt The `jwt`
495
496
* @param url The URL
496
497
*/
497
- fun getLoginOptions (
498
+ open fun getLoginOptions (
498
499
jwt : String? ,
499
500
url : String?
500
501
) = loginOptionsInternal?.apply {
@@ -530,10 +531,10 @@ open class SalesforceSDKManager protected constructor(
530
531
* @return True if the Salesforce Mobile SDK should automatically logout when
531
532
* the access token is revoked
532
533
*/
533
- fun shouldLogoutWhenTokenRevoked () = true
534
+ open fun shouldLogoutWhenTokenRevoked () = true
534
535
535
536
/* * The Salesforce SDK manager's user account manager */
536
- val userAccountManager: UserAccountManager by lazy {
537
+ open val userAccountManager: UserAccountManager by lazy {
537
538
UserAccountManager .getInstance()
538
539
}
539
540
@@ -546,7 +547,7 @@ open class SalesforceSDKManager protected constructor(
546
547
* for this option. This functionality will eventually be provided by the
547
548
* backend.
548
549
*/
549
- var shouldBlockSalesforceIntegrationUser = false
550
+ open var shouldBlockSalesforceIntegrationUser = false
550
551
551
552
/* *
552
553
* Creates a NativeLoginManager instance that allows the app to use its
@@ -638,7 +639,7 @@ open class SalesforceSDKManager protected constructor(
638
639
639
640
/* * Returns the app display name used by the passcode dialog */
640
641
@Suppress(" unused" )
641
- val appDisplayString = DEFAULT_APP_DISPLAY_NAME
642
+ open val appDisplayString = DEFAULT_APP_DISPLAY_NAME
642
643
643
644
/* * Returns the name of the app as defined in AndroidManifest.xml */
644
645
val applicationName
@@ -719,8 +720,7 @@ open class SalesforceSDKManager protected constructor(
719
720
/* *
720
721
* Starts the login flow if user account has been removed.
721
722
*/
722
- @Suppress(" MemberVisibilityCanBePrivate" )
723
- protected fun startLoginPage () {
723
+ protected open fun startLoginPage () {
724
724
725
725
// Clear cookies
726
726
CookieManager .getInstance().removeAllCookies(null )
@@ -870,7 +870,7 @@ open class SalesforceSDKManager protected constructor(
870
870
* @param showLoginPage If true, displays the login page after removing the
871
871
* account
872
872
*/
873
- fun logout (
873
+ open fun logout (
874
874
/* Note: Kotlin's @JvmOverloads annotations does not generate this overload */
875
875
frontActivity : Activity ? ,
876
876
showLoginPage : Boolean = true
@@ -889,7 +889,7 @@ open class SalesforceSDKManager protected constructor(
889
889
* account
890
890
*/
891
891
@JvmOverloads
892
- fun logout (
892
+ open fun logout (
893
893
account : Account ? = null,
894
894
frontActivity : Activity ? ,
895
895
showLoginPage : Boolean = true
@@ -1386,7 +1386,7 @@ open class SalesforceSDKManager protected constructor(
1386
1386
*
1387
1387
* @param activity The activity used to set style attributes
1388
1388
*/
1389
- fun setViewNavigationVisibility (activity : Activity ) {
1389
+ open fun setViewNavigationVisibility (activity : Activity ) {
1390
1390
if (! isDarkTheme || activity.javaClass.name == loginActivityClass.name) {
1391
1391
/*
1392
1392
* This covers the case where OS dark theme is true, but app has
@@ -1400,7 +1400,7 @@ open class SalesforceSDKManager protected constructor(
1400
1400
* Determines whether the device has a compact screen.
1401
1401
* Taken directly from https://developer.android.com/guide/topics/large-screens/large-screen-cookbook#kotlin
1402
1402
*/
1403
- fun compactScreen (activity : Activity ): Boolean {
1403
+ open fun compactScreen (activity : Activity ): Boolean {
1404
1404
val metrics = WindowMetricsCalculator .getOrCreate().computeMaximumWindowMetrics(activity)
1405
1405
val width = metrics.bounds.width()
1406
1406
val height = metrics.bounds.height()
@@ -1413,7 +1413,7 @@ open class SalesforceSDKManager protected constructor(
1413
1413
1414
1414
@Suppress(" unused" )
1415
1415
@OnLifecycleEvent(ON_STOP )
1416
- protected fun onAppBackgrounded () {
1416
+ protected open fun onAppBackgrounded () {
1417
1417
screenLockManager?.onAppBackgrounded()
1418
1418
(biometricAuthenticationManager as ? BiometricAuthenticationManager )?.onAppBackgrounded()
1419
1419
@@ -1425,7 +1425,7 @@ open class SalesforceSDKManager protected constructor(
1425
1425
1426
1426
@Suppress(" unused" )
1427
1427
@OnLifecycleEvent(ON_START )
1428
- protected fun onAppForegrounded () {
1428
+ protected open fun onAppForegrounded () {
1429
1429
screenLockManager?.onAppForegrounded()
1430
1430
(biometricAuthenticationManager as ? BiometricAuthenticationManager )?.onAppForegrounded()
1431
1431
@@ -1448,7 +1448,7 @@ open class SalesforceSDKManager protected constructor(
1448
1448
protected var INSTANCE : SalesforceSDKManager ? = null
1449
1449
1450
1450
/* * The current version of this SDK */
1451
- const val SDK_VERSION = " 12.0 .0.dev"
1451
+ const val SDK_VERSION = " 12.1 .0.dev"
1452
1452
1453
1453
/* *
1454
1454
* An intent action meant for instances of Salesforce SDK manager
@@ -1487,6 +1487,12 @@ open class SalesforceSDKManager protected constructor(
1487
1487
@Suppress(" NON_FINAL_MEMBER_IN_OBJECT" ) // This allows Java subtypes to override this property without an inspector warning
1488
1488
open fun getInstance () = INSTANCE ? : throw RuntimeException (" Apps must call SalesforceSDKManager.init() first." )
1489
1489
1490
+ /* * Allow Kotlin subclasses to set themselves as the instance. */
1491
+ @JvmSynthetic
1492
+ fun setInstance (subclass : SalesforceSDKManager ) {
1493
+ INSTANCE = subclass
1494
+ }
1495
+
1490
1496
/* *
1491
1497
* Indicates if a Salesforce SDK manager instance is initialized.
1492
1498
* @return true if SalesforceSDKManager has been initialized already
0 commit comments