Skip to content

Commit

Permalink
Apply code changes due to downgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
awush-stripe committed Jul 15, 2021
1 parent 9b1651a commit de7170c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ fun getPlatform() = "android"
* from https://stackoverflow.com/a/27836910/947883
*/
fun getDeviceName(): String {
val manufacturer = Build.MANUFACTURER?.lowercase() ?: ""
val model = Build.MODEL?.lowercase() ?: ""
// TODO: change this back once we can support newer kotlin versions
// val manufacturer = Build.MANUFACTURER?.lowercase() ?: ""
// val model = Build.MODEL?.lowercase() ?: ""
val manufacturer = Build.MANUFACTURER?.toLowerCase(Locale.ROOT) ?: ""
val model = Build.MODEL?.toLowerCase(Locale.ROOT) ?: ""
return if (model.startsWith(manufacturer)) {
model
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ class AlphabetDetect private constructor(interpreter: Interpreter) :
val prediction = mlOutput[0]
val index = prediction.indexOfMax()
val character = if (index != null && index > 0) {
('A'.code - 1 + index).toChar()
// TODO: change this back once we support newer gradle versions
// ('A'.code - 1 + index).toChar()
('A'.toInt() - 1 + index).toChar()
} else {
' '
}
Expand Down

0 comments on commit de7170c

Please sign in to comment.