Fix nullability for UserManager in AOSP build (#646)
This commit is contained in:
parent
c8d21fcf34
commit
11fbd450da
1 changed files with 1 additions and 1 deletions
|
@ -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 null
|
||||
userManager.userName
|
||||
} else null
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue