-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release/2.1.0 #111
Release/2.1.0 #111
Conversation
…predictable, as "structured concurrency" is not supported by safe call for now.
…I (previously on CI executionThread1 != executionThread2)
…h-timeout Remove nested safe calls with timeouts, adjust timeouts & change dummy results to empty strings
@Test | ||
fun safeWithTimeoutErrorRetrievable() { | ||
val errorId = "Hello" | ||
val v = safeWithTimeout { throw Exception(errorId) } |
Check warning
Code scanning / detekt
Thrown exception is too generic. Prefer throwing project specific exceptions to handle error cases. Warning
|
||
safeWithTimeout { | ||
if (whenBlockThrows) | ||
throw Exception() |
Check warning
Code scanning / detekt
Thrown exception is too generic. Prefer throwing project specific exceptions to handle error cases. Warning
TestCase.assertTrue( | ||
err is ExecutionTimeoutException | ||
&& err.executionThreadStackTrace != null | ||
&& err.executionThreadStackTrace.any { it.className == "java.lang.Thread" && it.methodName == "sleep" } |
Check warning
Code scanning / detekt
Line detected that is longer than the defined maximum line length in the code style. Warning
activityManager = safe { context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager }.getOrNull(), | ||
internalStorageStats = safe { StatFs(Environment.getRootDirectory()!!.absolutePath!!) }.getOrNull(), | ||
externalStorageStats = safe { | ||
activityManager = safeWithTimeout { context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager }.getOrNull(), |
Check warning
Code scanning / detekt
Line detected that is longer than the defined maximum line length in the code style. Warning
internalStorageStats = safe { StatFs(Environment.getRootDirectory()!!.absolutePath!!) }.getOrNull(), | ||
externalStorageStats = safe { | ||
activityManager = safeWithTimeout { context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager }.getOrNull(), | ||
internalStorageStats = safeWithTimeout { StatFs(Environment.getRootDirectory()!!.absolutePath!!) }.getOrNull(), |
Check warning
Code scanning / detekt
Line detected that is longer than the defined maximum line length in the code style. Warning
) | ||
|
||
private fun createBatteryInfoDataSource(context: Context) = BatteryInfoProviderImpl(context) | ||
|
||
private fun createCameraInfoProvider(): CameraInfoProvider = CameraInfoProviderImpl() | ||
|
||
private fun createGpuInfoProvider(context: Context) = | ||
GpuInfoProviderImpl(safe { context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager }.getOrNull()) | ||
GpuInfoProviderImpl(safeWithTimeout { context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager }.getOrNull()) |
Check warning
Code scanning / detekt
Line detected that is longer than the defined maximum line length in the code style. Warning
private const val WIDEWINE_UUID_LEAST_SIG_BITS = -0x5c37d8232ae2de13L | ||
// on CI, the timeout of 1s is not enough for emulator with api 32 and google apis. | ||
// therefore, let's make it much higher for CI tests and a bit higher for all builds (just in case) | ||
private val MEDIA_DRM_ID_TIMEOUT_MS = if (BuildConfig.CI_TEST) 600_000L else Safe.timeoutLong |
Check warning
Code scanning / detekt
Report magic numbers. Magic number is a numeric literal that is not defined as a constant and hence it's unclear what the purpose of this number is. It's better to declare such numbers as constants and give them a proper name. By default, -1, 0, 1, and 2 are not considered to be magic numbers. Warning
No description provided.