diff options
author | jacquarg <guillaume.jacquart@hoodbrains.com> | 2022-05-04 19:17:40 +0200 |
---|---|---|
committer | jacquarg <guillaume.jacquart@hoodbrains.com> | 2022-05-04 19:17:40 +0200 |
commit | b9b0f890b95ff1674d4e8e9396a16a68d82829e7 (patch) | |
tree | e0d30b1c502b96390fad542215e506f71ed5fd76 /app | |
parent | 730c2bc7566c03a9774509ab35bbbbca578ecf72 (diff) |
Update PR
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/AndroidManifest.xml | 3 | ||||
-rw-r--r-- | app/src/main/java/foundation/e/privacycentralapp/domain/usecases/TrackersStatisticsUseCase.kt | 22 |
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> { |