mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoHelpers.kt (#54106)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54106 Reviewed By: javache Differential Revision: D84130472 fbshipit-source-id: a1bfff89e0b6d36d2bcb3045a35ca15c6599f9d8
This commit is contained in:
committed by
meta-codesync[bot]
parent
1e1af623b1
commit
e4da3437d9
+3
-3
@@ -85,7 +85,7 @@ public object AndroidInfoHelpers {
|
||||
private fun getReactNativeVersionString(): String {
|
||||
val version = ReactNativeVersion.VERSION
|
||||
return "${version["major"]}.${version["minor"]}.${version["patch"]}" +
|
||||
(version["prerelease"]?.let { "-$it" } ?: "")
|
||||
(version["prerelease"]?.let { "-$it" }.orEmpty())
|
||||
}
|
||||
|
||||
private fun getDevServerPort(context: Context): Int =
|
||||
@@ -123,7 +123,7 @@ public object AndroidInfoHelpers {
|
||||
var lastLine = ""
|
||||
var line: String?
|
||||
while (reader.readLine().also { line = it } != null) {
|
||||
lastLine = line ?: ""
|
||||
lastLine = line.orEmpty()
|
||||
}
|
||||
metroHostPropValue = lastLine
|
||||
} catch (e: Exception) {
|
||||
@@ -133,6 +133,6 @@ public object AndroidInfoHelpers {
|
||||
reader?.close()
|
||||
process?.destroy()
|
||||
}
|
||||
return metroHostPropValue ?: ""
|
||||
return metroHostPropValue.orEmpty()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user