Fix nullability for UserManager in AOSP build
This commit is contained in:
parent
c8d21fcf34
commit
2b465f81da
1 changed files with 1 additions and 1 deletions
|
|
@ -312,7 +312,7 @@ internal class MetadataManager(
|
||||||
private fun getUserName(): String? {
|
private fun getUserName(): String? {
|
||||||
val perm = "android.permission.QUERY_USERS"
|
val perm = "android.permission.QUERY_USERS"
|
||||||
return if (context.checkSelfPermission(perm) == PERMISSION_GRANTED) {
|
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
|
userManager.userName
|
||||||
} else null
|
} else null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue