Skip to content

Commit

Permalink
Fix nullability for UserManager in AOSP build (#646)
Browse files Browse the repository at this point in the history
  • Loading branch information
grote authored Apr 16, 2024
1 parent c8d21fc commit 11fbd45
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 11fbd45

Please sign in to comment.