Skip to content

Commit 4ce0b1e

Browse files
authored
Update AGP to 8.2.0 (#4580)
1 parent 693fe84 commit 4ce0b1e

File tree

23 files changed

+102
-29
lines changed

23 files changed

+102
-29
lines changed

app-tracking-protection/vpn-impl/src/main/java/com/duckduckgo/mobile/android/vpn/service/DeviceShieldTileService.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class DeviceShieldTileService : TileService() {
8787
}
8888
}
8989

90-
@SuppressLint("NewApi") // IDE doesn't get we use appBuildConfig
90+
@SuppressLint("NewApi", "StartActivityAndCollapseDeprecated") // IDE doesn't get we use appBuildConfig
9191
private fun launchActivity() {
9292
val intent = Intent(this, VpnPermissionRequesterActivity::class.java).apply { addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) }
9393
if (appBuildConfig.sdkInt >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {

app/src/main/java/com/duckduckgo/app/WidgetThemeConfiguration.kt

+6-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.duckduckgo.app
1818

1919
import android.appwidget.AppWidgetManager
20+
import android.content.ComponentName
2021
import android.content.Intent
2122
import android.content.res.Configuration
2223
import android.os.Build
@@ -30,6 +31,7 @@ import com.duckduckgo.app.statistics.pixels.Pixel
3031
import com.duckduckgo.appbuildconfig.api.AppBuildConfig
3132
import com.duckduckgo.common.ui.DuckDuckGoActivity
3233
import com.duckduckgo.di.scopes.ActivityScope
34+
import com.duckduckgo.widget.SearchAndFavoritesWidget
3335
import com.duckduckgo.widget.WidgetPreferences
3436
import com.duckduckgo.widget.WidgetTheme
3537
import javax.inject.Inject
@@ -123,7 +125,10 @@ class WidgetThemeConfiguration : DuckDuckGoActivity() {
123125
) {
124126
widgetPrefs.saveWidgetSelectedTheme(widgetId, selectedTheme.toString())
125127
pixelSelectedTheme(selectedTheme)
126-
val widgetUpdateIntent = Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE)
128+
129+
val widgetUpdateIntent = Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE).apply {
130+
component = ComponentName(this@WidgetThemeConfiguration, SearchAndFavoritesWidget::class.java)
131+
}
127132
val widgetsToUpdate = IntArray(1).also { it[0] = widgetId }
128133
widgetUpdateIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, widgetsToUpdate)
129134
sendBroadcast(widgetUpdateIntent)

autoconsent/autoconsent-impl/build.gradle

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ apply from: "$rootProject.projectDir/gradle/android-library.gradle"
2424

2525
android {
2626
namespace 'com.duckduckgo.autoconsent.impl'
27+
compileOptions {
28+
coreLibraryDesugaringEnabled = true
29+
}
2730
}
2831

2932
dependencies {
@@ -76,6 +79,8 @@ dependencies {
7679
testImplementation Testing.robolectric
7780
testImplementation 'app.cash.turbine:turbine:_'
7881
testImplementation project(path: ':common-test')
82+
83+
coreLibraryDesugaring Android.tools.desugarJdkLibs
7984
}
8085

8186
android {

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
spotless = '6.1.2'
88
anvil_version = '2.5.0-beta07'
99
ksp_version = '1.9.22-1.0.17'
10-
gradle_plugin = '8.1.2'
10+
gradle_plugin = '8.2.0'
1111
min_sdk = 26
1212
target_sdk = 34
1313
compile_sdk = 34

content-scope-scripts/content-scope-scripts-impl/build.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ dependencies {
6464
exclude group: "org.jetbrains.kotlinx", module: "kotlinx-coroutines-debug"
6565
}
6666

67+
coreLibraryDesugaring Android.tools.desugarJdkLibs
6768
}
6869

6970
android {
@@ -84,5 +85,8 @@ android {
8485
includeAndroidResources = true
8586
}
8687
}
88+
compileOptions {
89+
coreLibraryDesugaringEnabled = true
90+
}
8791
namespace 'com.duckduckgo.contentscopescripts.impl'
8892
}

cookies/cookies-impl/build.gradle

+5
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ dependencies {
6868
testImplementation AndroidX.work.testing
6969

7070
testImplementation project(path: ':common-test')
71+
72+
coreLibraryDesugaring Android.tools.desugarJdkLibs
7173
}
7274

7375
android {
@@ -79,5 +81,8 @@ android {
7981
includeAndroidResources = true
8082
}
8183
}
84+
compileOptions {
85+
coreLibraryDesugaringEnabled = true
86+
}
8287
namespace 'com.duckduckgo.cookies.impl'
8388
}

data-store/data-store-api/build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ dependencies {
3333

3434
implementation KotlinX.coroutines.core
3535
implementation AndroidX.appCompat
36+
37+
coreLibraryDesugaring Android.tools.desugarJdkLibs
3638
}
3739

3840

experiments/experiments-impl/build.gradle

+5
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ dependencies {
7373

7474
androidTestImplementation project(path: ':common-test')
7575
testImplementation project(path: ':common-test')
76+
77+
coreLibraryDesugaring Android.tools.desugarJdkLibs
7678
}
7779

7880
android {
@@ -94,6 +96,9 @@ android {
9496
sourceSets {
9597
test.assets.srcDirs += files("$projectDir/schemas".toString())
9698
}
99+
compileOptions {
100+
coreLibraryDesugaringEnabled = true
101+
}
97102
namespace 'com.duckduckgo.experiments.impl'
98103
}
99104

gradle/wrapper/gradle-wrapper.jar

-19.5 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=38f66cd6eef217b4c35855bb11ea4e9fbc53594ccccb5fb82dfd317ef8c2c5a3
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
3+
distributionSha256Sum=a4b4158601f8636cdeeab09bd76afb640030bb5b144aafe261a5e8af027dc612
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

gradlew

+10-9
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -83,7 +83,8 @@ done
8383
# This is normally unused
8484
# shellcheck disable=SC2034
8585
APP_BASE_NAME=${0##*/}
86-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
86+
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87+
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
8788

8889
# Use the maximum available, or set MAX_FD != -1 to use that value.
8990
MAX_FD=maximum
@@ -144,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144145
case $MAX_FD in #(
145146
max*)
146147
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147-
# shellcheck disable=SC3045
148+
# shellcheck disable=SC2039,SC3045
148149
MAX_FD=$( ulimit -H -n ) ||
149150
warn "Could not query maximum file descriptor limit"
150151
esac
151152
case $MAX_FD in #(
152153
'' | soft) :;; #(
153154
*)
154155
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155-
# shellcheck disable=SC3045
156+
# shellcheck disable=SC2039,SC3045
156157
ulimit -n "$MAX_FD" ||
157158
warn "Could not set maximum file descriptor limit to $MAX_FD"
158159
esac
@@ -201,11 +202,11 @@ fi
201202
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
202203
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
203204

204-
# Collect all arguments for the java command;
205-
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
206-
# shell script including quotes and variable substitutions, so put them in
207-
# double quotes to make sure that they get re-expanded; and
208-
# * put everything else in single quotes, so that it's not re-expanded.
205+
# Collect all arguments for the java command:
206+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207+
# and any embedded shellness will be escaped.
208+
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209+
# treated as '${Hostname}' itself on the command line.
209210

210211
set -- \
211212
"-Dorg.gradle.appname=$APP_BASE_NAME" \

gradlew.bat

+10-10
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
4343
%JAVA_EXE% -version >NUL 2>&1
4444
if %ERRORLEVEL% equ 0 goto execute
4545

46-
echo.
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48-
echo.
49-
echo Please set the JAVA_HOME variable in your environment to match the
50-
echo location of your Java installation.
46+
echo. 1>&2
47+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48+
echo. 1>&2
49+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50+
echo location of your Java installation. 1>&2
5151

5252
goto fail
5353

@@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5757

5858
if exist "%JAVA_EXE%" goto execute
5959

60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
60+
echo. 1>&2
61+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62+
echo. 1>&2
63+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64+
echo location of your Java installation. 1>&2
6565

6666
goto fail
6767

httpsupgrade/httpsupgrade-impl/build.gradle

+5
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ dependencies {
5555
// WorkManager
5656
implementation AndroidX.work.runtimeKtx
5757
testImplementation AndroidX.work.testing
58+
59+
coreLibraryDesugaring Android.tools.desugarJdkLibs
5860
}
5961

6062
android {
@@ -73,6 +75,9 @@ android {
7375
includeAndroidResources = true
7476
}
7577
}
78+
compileOptions {
79+
coreLibraryDesugaringEnabled = true
80+
}
7681
}
7782

7883
fulladleModuleConfig {

installation/installation-impl/build.gradle

+6-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ dependencies {
4242
testImplementation "org.mockito.kotlin:mockito-kotlin:_"
4343
testImplementation Testing.robolectric
4444
testImplementation project(path: ':common-test')
45+
46+
coreLibraryDesugaring Android.tools.desugarJdkLibs
4547
}
4648

4749
android {
@@ -53,5 +55,8 @@ android {
5355
includeAndroidResources = true
5456
}
5557
}
56-
namespace 'com.duckduckgo.installation.impl'
58+
compileOptions {
59+
coreLibraryDesugaringEnabled = true
60+
}
61+
namespace 'com.duckduckgo.installation.impl'
5762
}

js-messaging/js-messaging-impl/build.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ dependencies {
5454
exclude group: "org.jetbrains.kotlinx", module: "kotlinx-coroutines-debug"
5555
}
5656

57+
coreLibraryDesugaring Android.tools.desugarJdkLibs
5758
}
5859

5960
android {
@@ -65,5 +66,8 @@ android {
6566
includeAndroidResources = true
6667
}
6768
}
69+
compileOptions {
70+
coreLibraryDesugaringEnabled = true
71+
}
6872
namespace 'com.duckduckgo.js.messaging.impl'
6973
}

macos/macos-impl/build.gradle

+5
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ dependencies {
7575
testImplementation "androidx.test:runner:_"
7676
testImplementation Testing.robolectric
7777
testImplementation CashApp.turbine
78+
79+
coreLibraryDesugaring Android.tools.desugarJdkLibs
7880
}
7981

8082
android {
@@ -86,5 +88,8 @@ android {
8688
includeAndroidResources = true
8789
}
8890
}
91+
compileOptions {
92+
coreLibraryDesugaringEnabled = true
93+
}
8994
}
9095

network-protection/network-protection-impl/src/main/java/com/duckduckgo/networkprotection/impl/quickaccess/VpnTileService.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class VpnTileService : TileService() {
7676
AndroidInjection.inject(this, VpnTileServiceBindingKey::class.java)
7777
}
7878

79-
@SuppressLint("NewApi") // IDE doesn't get we use appBuildConfig
79+
@SuppressLint("NewApi", "StartActivityAndCollapseDeprecated") // IDE doesn't get we use appBuildConfig
8080
override fun onClick() {
8181
serviceScope.launch(dispatcherProvider.io()) {
8282
if (networkProtectionState.isRunning()) {

privacy-dashboard/privacy-dashboard-impl/build.gradle

+5
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ dependencies {
7575
androidTestImplementation CashApp.turbine
7676
androidTestImplementation "org.mockito:mockito-android:_"
7777
androidTestImplementation "org.mockito.kotlin:mockito-kotlin:_"
78+
79+
coreLibraryDesugaring Android.tools.desugarJdkLibs
7880
}
7981

8082
android {
@@ -86,6 +88,9 @@ android {
8688
includeAndroidResources = true
8789
}
8890
}
91+
compileOptions {
92+
coreLibraryDesugaringEnabled = true
93+
}
8994
}
9095

9196
fulladleModuleConfig {

request-filterer/request-filterer-impl/build.gradle

+5
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ dependencies {
6363
testImplementation Testing.robolectric
6464

6565
testImplementation project(path: ':common-test')
66+
67+
coreLibraryDesugaring Android.tools.desugarJdkLibs
6668
}
6769

6870
android {
@@ -74,5 +76,8 @@ android {
7476
includeAndroidResources = true
7577
}
7678
}
79+
compileOptions {
80+
coreLibraryDesugaringEnabled = true
81+
}
7782
namespace 'com.duckduckgo.request.filterer.impl'
7883
}

site-permissions/site-permissions-impl/src/main/java/com/duckduckgo/site/permissions/impl/SitePermissionsDialogActivityLauncher.kt

+5-3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import android.content.Intent
2222
import android.content.res.Configuration
2323
import android.net.Uri
2424
import android.provider.Settings
25+
import android.view.ViewGroup
2526
import android.webkit.PermissionRequest
2627
import androidx.activity.result.ActivityResultCaller
2728
import androidx.annotation.StringRes
@@ -43,7 +44,6 @@ import com.duckduckgo.site.permissions.store.sitepermissions.SitePermissionsEnti
4344
import com.google.android.material.dialog.MaterialAlertDialogBuilder
4445
import com.google.android.material.snackbar.BaseTransientBottomBar.BaseCallback
4546
import com.google.android.material.snackbar.Snackbar
46-
import com.google.android.material.snackbar.Snackbar.SnackbarLayout
4747
import com.squareup.anvil.annotations.ContributesBinding
4848
import java.lang.IllegalStateException
4949
import javax.inject.Inject
@@ -333,9 +333,11 @@ class SitePermissionsDialogActivityLauncher @Inject constructor(
333333
}
334334

335335
val snackbar = Snackbar.make(activity.window.decorView.rootView, message, Snackbar.LENGTH_LONG)
336-
val layout = snackbar.view as SnackbarLayout
336+
val snackbarView = snackbar.view
337337
if (activity.resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT) {
338-
layout.setPadding(0, 0, 0, 40.toPx())
338+
val layoutParams = snackbarView.layoutParams as ViewGroup.MarginLayoutParams
339+
layoutParams.setMargins(layoutParams.leftMargin, layoutParams.topMargin, layoutParams.rightMargin, 32.toPx())
340+
snackbarView.layoutParams = layoutParams
339341
}
340342
snackbar.apply {
341343
setAction(R.string.sitePermissionsDeniedSnackBarAction) { onPermissionAllowed() }

subscriptions/subscriptions-impl/build.gradle

+5
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ dependencies {
8888
// conflicts with mockito due to direct inclusion of byte buddy
8989
exclude group: "org.jetbrains.kotlinx", module: "kotlinx-coroutines-debug"
9090
}
91+
92+
coreLibraryDesugaring Android.tools.desugarJdkLibs
9193
}
9294

9395
android {
@@ -99,5 +101,8 @@ android {
99101
includeAndroidResources = true
100102
}
101103
}
104+
compileOptions {
105+
coreLibraryDesugaringEnabled = true
106+
}
102107
namespace 'com.duckduckgo.subscriptions.impl'
103108
}

0 commit comments

Comments
 (0)