Skip to content

Commit

Permalink
Check if Android device name is not blank (#1013)
Browse files Browse the repository at this point in the history
* fix(android): check if device name is not blank

* refactor: use `!isNullOrBlank()`
  • Loading branch information
jarnedemeulemeester authored Oct 27, 2024
1 parent 9e66cfa commit eb255a7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ private fun Context.getDeviceName(): String {
// Use name from device settings
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
val name = Settings.Global.getString(contentResolver, Settings.Global.DEVICE_NAME)
if (name != null) return name
if (!name.isNullOrBlank()) return name
}

// Concatenate the name based on manufacturer and model
Expand Down

0 comments on commit eb255a7

Please sign in to comment.