From a123129f70dc00c71ee9f782bb746a1b5e314658 Mon Sep 17 00:00:00 2001 From: Mark Renouf Date: Mon, 29 Jan 2024 14:10:07 -0500 Subject: Adds updateState to UserInteractor This allows the domain layer to modify the availability of a profile. Test: atest IntentResolver-tests-unit:UserInteractorTest Bug: 309960444 Change-Id: I70b5eac3e0d58a7b16c09b3814ad71719d3937dd --- .../android/intentresolver/v2/domain/interactor/UserInteractor.kt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'java/src') diff --git a/java/src/com/android/intentresolver/v2/domain/interactor/UserInteractor.kt b/java/src/com/android/intentresolver/v2/domain/interactor/UserInteractor.kt index e1b3fb36..f12d8197 100644 --- a/java/src/com/android/intentresolver/v2/domain/interactor/UserInteractor.kt +++ b/java/src/com/android/intentresolver/v2/domain/interactor/UserInteractor.kt @@ -82,6 +82,14 @@ constructor( } } + /** + * Request the profile state be updated. In the case of enabling, the operation could take + * significant time and/or require user input. + */ + suspend fun updateState(profile: Profile, available: Boolean) { + userRepository.requestState(profile.primary, available) + } + private fun profileFromRole(role: Role): Type = when (role) { Role.PERSONAL -> Type.PERSONAL -- cgit v1.2.3-59-g8ed1b