forked from d4rken-org/sdmaid-se
-
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.
Stats: Track packages that were affected by AppControl
- Loading branch information
Showing
32 changed files
with
754 additions
and
70 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
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
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
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/java/eu/darken/sdmse/common/room/PkgIdTypeConverter.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 @@ | ||
package eu.darken.sdmse.common.room | ||
|
||
import androidx.room.TypeConverter | ||
import eu.darken.sdmse.common.pkgs.Pkg | ||
import eu.darken.sdmse.common.pkgs.toPkgId | ||
|
||
class PkgIdTypeConverter { | ||
@TypeConverter | ||
fun from(value: Pkg.Id): String = value.name | ||
|
||
@TypeConverter | ||
fun to(value: String): Pkg.Id = value.toPkgId() | ||
} |
16 changes: 0 additions & 16 deletions
16
app/src/main/java/eu/darken/sdmse/stats/core/AffectedApp.kt
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
app/src/main/java/eu/darken/sdmse/stats/core/AffectedPkg.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,27 @@ | ||
package eu.darken.sdmse.stats.core | ||
|
||
import androidx.annotation.DrawableRes | ||
import eu.darken.sdmse.R | ||
import eu.darken.sdmse.common.pkgs.Pkg | ||
|
||
interface AffectedPkg { | ||
val reportId: ReportId | ||
val action: Action | ||
val pkgId: Pkg.Id | ||
|
||
enum class Action { | ||
EXPORTED, | ||
STOPPED, | ||
TOGGLED, | ||
DELETED, | ||
; | ||
} | ||
} | ||
|
||
@get:DrawableRes val AffectedPkg.Action.iconRes: Int | ||
get() = when (this) { | ||
AffectedPkg.Action.EXPORTED -> R.drawable.ic_baseline_save_24 | ||
AffectedPkg.Action.STOPPED -> R.drawable.ic_alert_octagon_outline_24 | ||
AffectedPkg.Action.TOGGLED -> R.drawable.ic_snowflake_24 | ||
AffectedPkg.Action.DELETED -> R.drawable.ic_delete | ||
} |
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
Oops, something went wrong.