1
0
Fork 0

Fix nullability for UserManager in AOSP build

This commit is contained in:
Torsten Grote 2024-04-16 14:00:06 -03:00 committed by GitHub
parent c8d21fcf34
commit 2b465f81da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -312,7 +312,7 @@ internal class MetadataManager(
private fun getUserName(): String? {
val perm = "android.permission.QUERY_USERS"
return if (context.checkSelfPermission(perm) == PERMISSION_GRANTED) {
val userManager = context.getSystemService(UserManager::class.java)
val userManager = context.getSystemService(UserManager::class.java) ?: return false
userManager.userName
} else null
}