Skip to content

Commit 226a5d2

Browse files
authored
PIR: Move files from internal to impl (#6563)
Task/Issue URL: https://app.asana.com/1/137249556945/project/1203581873609357/task/1211019431680361?focus=true ### Description Moves files from `pir-internal` to `pir-impl` ### Steps to test this PR https://app.asana.com/1/137249556945/project/1203581873609357/task/1211022779363407?focus=true ### UI changes No UI changes
1 parent 6bc5fc5 commit 226a5d2

File tree

115 files changed

+828
-865
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+828
-865
lines changed

pir/pir-impl/build.gradle

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,33 +24,46 @@ plugins {
2424
apply from: "$rootProject.projectDir/gradle/android-library.gradle"
2525

2626
dependencies {
27-
implementation project(":pir-api")
27+
implementation project(":pir-api")
2828

29-
anvil project(path: ':anvil-compiler')
30-
implementation project(path: ':anvil-annotations')
31-
implementation project(path: ':di')
29+
anvil project(':anvil-compiler')
30+
implementation project(':anvil-annotations')
3231
implementation project(':browser-api')
3332
implementation project(':common-ui')
3433
implementation project(':common-utils')
35-
implementation project(':content-scope-scripts-api')
34+
implementation project(':di')
35+
implementation project(':data-store-api')
3636
implementation project(':js-messaging-api')
3737
implementation project(':navigation-api')
3838
implementation project(':subscriptions-api')
39-
40-
ksp AndroidX.room.compiler
39+
implementation project(':statistics-api')
40+
implementation "com.squareup.logcat:logcat:_"
41+
implementation "com.squareup.moshi:moshi-adapters:_"
42+
implementation "com.squareup.moshi:moshi-kotlin:_"
4143

4244
implementation AndroidX.appCompat
43-
implementation KotlinX.coroutines.android
4445
implementation AndroidX.core.ktx
46+
implementation AndroidX.webkit
4547
implementation Google.dagger
48+
implementation KotlinX.coroutines.android
4649

47-
implementation "com.squareup.logcat:logcat:_"
50+
// Room
51+
implementation AndroidX.room.runtime
52+
implementation AndroidX.room.ktx
53+
implementation Square.retrofit2.converter.moshi
54+
implementation Square.moshi
55+
ksp AndroidX.room.compiler
56+
57+
// WorkManager
58+
implementation AndroidX.work.runtimeKtx
59+
implementation "androidx.work:work-multiprocess:_"
4860

4961
testImplementation Testing.junit4
5062
testImplementation "org.mockito.kotlin:mockito-kotlin:_"
5163
testImplementation project(path: ':common-test')
5264
testImplementation CashApp.turbine
5365
testImplementation Testing.robolectric
66+
testImplementation "androidx.lifecycle:lifecycle-runtime-testing:_"
5467
testImplementation(KotlinX.coroutines.test) {
5568
// https://github.com/Kotlin/kotlinx.coroutines/issues/2023
5669
// conflicts with mockito due to direct inclusion of byte buddy
@@ -69,6 +82,9 @@ android {
6982
baseline file("lint-baseline.xml")
7083
abortOnError = !project.hasProperty("abortOnError") || project.property("abortOnError") != "false"
7184
}
85+
ksp {
86+
arg("room.schemaLocation", "$projectDir/schemas")
87+
}
7288
testOptions {
7389
unitTests {
7490
includeAndroidResources = true

pir/pir-impl/lint-baseline.xml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<!--
1+
<?xml version="1.0" encoding="UTF-8"?><!--
32
~ Copyright (c) 2025 DuckDuckGo
43
~
54
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,6 +14,15 @@
1514
~ limitations under the License.
1615
-->
1716

18-
<issues format="6" by="lint 8.5.1" type="baseline" client="gradle" dependencies="false" name="AGP (8.5.1)" variant="all" version="8.5.1">
17+
<issues format="6" by="lint 8.5.1" type="baseline" client="gradle" dependencies="false"
18+
name="AGP (8.5.1)" variant="all" version="8.5.1">
19+
20+
<issue id="SetJavaScriptEnabled"
21+
message="Using `setJavaScriptEnabled` can introduce XSS vulnerabilities into your application, review carefully"
22+
errorLine1=" javaScriptEnabled = true"
23+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~">
24+
<location file="src/main/java/com/duckduckgo/pir/impl/common/PirDetachedWebViewProvider.kt"
25+
line="158" column="17" />
26+
</issue>
1927

2028
</issues>

pir/pir-impl/src/main/AndroidManifest.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,34 @@
1616
-->
1717

1818
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
19+
1920
<uses-permission android:name="android.permission.INTERNET"/>
21+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
2022

2123
<application>
2224
<activity
2325
android:name=".dashboard.PirDashboardWebViewActivity"
2426
android:parentActivityName="com.duckduckgo.app.settings.SettingsActivity"
2527
android:label="@string/activityPirDashboard" />
28+
29+
<service
30+
android:name="com.duckduckgo.pir.impl.scan.PirForegroundScanService"
31+
android:enabled="true"
32+
android:exported="false"
33+
android:foregroundServiceType="specialUse"
34+
android:process=":pir" />
35+
36+
<service
37+
android:name=".optout.PirForegroundOptOutService"
38+
android:enabled="true"
39+
android:exported="false"
40+
android:foregroundServiceType="specialUse"
41+
android:process=":pir" />
42+
43+
<service
44+
android:name=".scan.PirRemoteWorkerService"
45+
android:exported="false"
46+
android:permission="android.permission.BIND_JOB_SERVICE"
47+
android:process=":pir" />
2648
</application>
2749
</manifest>

pir/pir-internal/src/main/java/com/duckduckgo/pir/internal/PirInternalConstants.kt renamed to pir/pir-impl/src/main/java/com/duckduckgo/pir/impl/PirConstants.kt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.duckduckgo.pir.internal
17+
package com.duckduckgo.pir.impl
1818

19-
import com.duckduckgo.pir.internal.models.Address
20-
import com.duckduckgo.pir.internal.models.ProfileQuery
19+
import com.duckduckgo.pir.impl.models.Address
20+
import com.duckduckgo.pir.impl.models.ProfileQuery
2121

22-
object PirInternalConstants {
22+
object PirConstants {
23+
24+
// TODO: This is moved from pir-internal, consider removing it
2325
val DEFAULT_PROFILE_QUERIES: List<ProfileQuery> = listOf(
2426
ProfileQuery(
2527
id = -1,
@@ -73,4 +75,8 @@ object PirInternalConstants {
7375
deprecated = false,
7476
),
7577
)
78+
79+
// TODO: This is moved from pir-internal, consider updating it
80+
const val NOTIF_CHANNEL_ID = "PirDevNotificationChannel"
81+
const val NOTIF_ID_STATUS_COMPLETE = 987
7682
}

0 commit comments

Comments
 (0)