summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/src/main/AndroidManifest.xml3
-rw-r--r--app/src/main/java/foundation/e/privacycentralapp/domain/usecases/TrackersStatisticsUseCase.kt22
2 files changed, 12 insertions, 13 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index b288588..d285b6f 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -63,8 +63,7 @@
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER"/>
-<!-- <category android:name="android.intent.category.INFO"/>-->
+ <category android:name="android.intent.category.INFO"/>
</intent-filter>
</activity>
</application>
diff --git a/app/src/main/java/foundation/e/privacycentralapp/domain/usecases/TrackersStatisticsUseCase.kt b/app/src/main/java/foundation/e/privacycentralapp/domain/usecases/TrackersStatisticsUseCase.kt
index d8eed5c..1fddb74 100644
--- a/app/src/main/java/foundation/e/privacycentralapp/domain/usecases/TrackersStatisticsUseCase.kt
+++ b/app/src/main/java/foundation/e/privacycentralapp/domain/usecases/TrackersStatisticsUseCase.kt
@@ -176,18 +176,18 @@ class TrackersStatisticsUseCase(
blockedLeaks = blockedLeaks,
leaks = leaks
)
- }.sortedWith(
- Comparator { o1, o2 ->
- val leaks = o2.leaks - o1.leaks
- if (leaks != 0) leaks else {
- val whitelisted = o2.whiteListedTrackersCount - o1.whiteListedTrackersCount
- if (whitelisted != 0) whitelisted else {
- o2.trackersCount - o1.trackersCount
- }
- }
- }
- )
+ }.sortedWith(mostLeakedAppsComparator)
+ }
+ }
+
+ private val mostLeakedAppsComparator: Comparator<AppWithCounts> = Comparator { o1, o2 ->
+ val leaks = o2.leaks - o1.leaks
+ if (leaks != 0) leaks else {
+ val whitelisted = o2.whiteListedTrackersCount - o1.whiteListedTrackersCount
+ if (whitelisted != 0) whitelisted else {
+ o2.trackersCount - o1.trackersCount
}
+ }
}
fun getNonBlockedTrackersCount(): Flow<Int> {