Skip to content
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

Merged
merged 13 commits into from
Oct 9, 2023
Merged

Release/2.1.0 #111

merged 13 commits into from
Oct 9, 2023

Conversation

Sergey-Makarov
Copy link
Contributor

No description provided.

@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

Exception is a too generic Exception. Prefer throwing specific exceptions that indicate a specific error case.

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

Exception is a too generic Exception. Prefer throwing specific exceptions that indicate a specific error case.
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

Line detected that is longer than the defined maximum line length in the code style.
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

Line detected that is longer than the defined maximum line length in the code style.
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

Line detected that is longer than the defined maximum line length in the code style.
)

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

Line detected that is longer than the defined maximum line length in the code style.
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

This expression contains a magic number. Consider defining it to a well named constant.
@Sergey-Makarov Sergey-Makarov merged commit 0df2a9b into main Oct 9, 2023
6 checks passed
@Sergey-Makarov Sergey-Makarov deleted the release/2.1.0 branch April 23, 2024 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants