Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6cf9cd82 authored by Haijie Hong's avatar Haijie Hong
Browse files

Use stopTimeoutMillis to avoid unnecessary bind/unbind

BUG: 343317785
Test: local tested
Flag: com.android.settings.flags.enable_bluetooth_device_details_polish
Change-Id: I1f0adb97fc3d4669ad6a730b73c3fd64d102c98e
parent 8731e602
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -279,7 +279,7 @@ class DeviceSettingServiceConnection(
                            getService(intent, IDeviceSettingsProviderService.Stub::asInterface)
                                .stateIn(
                                    coroutineScope.plus(backgroundCoroutineContext),
                                    SharingStarted.WhileSubscribed(),
                                    SharingStarted.WhileSubscribed(stopTimeoutMillis = SERVICE_CONNECTION_STOP_MILLIS),
                                    ServiceConnectionStatus.Connecting,
                                )
                        },
@@ -370,5 +370,6 @@ class DeviceSettingServiceConnection(
        const val CONFIG_SERVICE_PACKAGE_NAME = "DEVICE_SETTINGS_CONFIG_PACKAGE_NAME"
        const val CONFIG_SERVICE_CLASS_NAME = "DEVICE_SETTINGS_CONFIG_CLASS"
        const val CONFIG_SERVICE_INTENT_ACTION = "DEVICE_SETTINGS_CONFIG_ACTION"
        const val SERVICE_CONNECTION_STOP_MILLIS = 1000L
    }
}