diff options
Diffstat (limited to 'PermissionController/src/com/android/permissioncontroller/permission/data/EnabledInputMethodsLiveData.kt')
-rw-r--r-- | PermissionController/src/com/android/permissioncontroller/permission/data/EnabledInputMethodsLiveData.kt | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/data/EnabledInputMethodsLiveData.kt b/PermissionController/src/com/android/permissioncontroller/permission/data/EnabledInputMethodsLiveData.kt index d0d2783ab..e48c432d8 100644 --- a/PermissionController/src/com/android/permissioncontroller/permission/data/EnabledInputMethodsLiveData.kt +++ b/PermissionController/src/com/android/permissioncontroller/permission/data/EnabledInputMethodsLiveData.kt @@ -30,22 +30,19 @@ import kotlinx.coroutines.Job * @param app The current application * @param user The user the services should be determined for */ -class EnabledInputMethodsLiveData( - private val app: Application, - private val user: UserHandle -) : SmartAsyncMediatorLiveData<List<String>>() { +class EnabledInputMethodsLiveData(private val app: Application, private val user: UserHandle) : + SmartAsyncMediatorLiveData<List<String>>() { override suspend fun loadDataAndPostValue(job: Job) { if (job.isCancelled) { return } - val packageNames = Utils.getUserContext(app, user) + val packageNames = + Utils.getUserContext(app, user) .getSystemService(InputMethodManager::class.java)!! .enabledInputMethodList - .map { info: InputMethodInfo -> - info.component.packageName - } + .map { info: InputMethodInfo -> info.component.packageName } postValue(packageNames) } @@ -55,10 +52,9 @@ class EnabledInputMethodsLiveData( * * <p> Key value is a user, value is its corresponding LiveData. */ - companion object : DataRepositoryForPackage<UserHandle, - EnabledInputMethodsLiveData>() { + companion object : DataRepositoryForPackage<UserHandle, EnabledInputMethodsLiveData>() { override fun newValue(key: UserHandle): EnabledInputMethodsLiveData { return EnabledInputMethodsLiveData(PermissionControllerApplication.get(), key) } } -}
\ No newline at end of file +} |