-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5803262
commit 2eb6f3d
Showing
7 changed files
with
85 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
app/src/main/kotlin/ru/pixnews/util/strictmode/IgnoredViolation.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* Copyright (c) 2024, the Pixnews project authors and contributors. Please see the AUTHORS file for details. | ||
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. | ||
*/ | ||
|
||
package ru.pixnews.util.strictmode | ||
|
||
import android.os.strictmode.Violation | ||
|
||
class IgnoredViolation( | ||
val name: String, | ||
val predicate: Violation.() -> Boolean, | ||
) |
8 changes: 8 additions & 0 deletions
8
app/src/main/kotlin/ru/pixnews/util/strictmode/StrictModeViolationException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* Copyright (c) 2024, the Pixnews project authors and contributors. Please see the AUTHORS file for details. | ||
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. | ||
*/ | ||
|
||
package ru.pixnews.util.strictmode | ||
|
||
class StrictModeViolationException(throwable: Throwable) : RuntimeException(throwable) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
app/src/main/kotlin/ru/pixnews/util/strictmode/ViolationPolicy.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* Copyright (c) 2024, the Pixnews project authors and contributors. Please see the AUTHORS file for details. | ||
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. | ||
*/ | ||
|
||
package ru.pixnews.util.strictmode | ||
|
||
enum class ViolationPolicy { | ||
IGNORE, | ||
LOG, | ||
FAIL, | ||
} |