Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump AGP to 8.5.1 #21082

Merged
merged 19 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions WordPress/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@
android:name=".ui.accounts.LoginActivity"
android:theme="@style/LoginTheme.TransparentSystemBars"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize" />
android:windowSoftInputMode="adjustResize"
tools:ignore="DiscouragedApi" />

<activity
android:name=".ui.accounts.LoginMagicLinkInterceptActivity"
Expand Down Expand Up @@ -606,7 +607,8 @@
<activity
android:name=".ui.reader.ReaderVideoViewerActivity"
android:screenOrientation="landscape"
android:theme="@style/ReaderMediaViewerTheme" />
android:theme="@style/ReaderMediaViewerTheme"
tools:ignore="DiscouragedApi" />
<activity
android:name=".ui.reader.discover.interests.ReaderInterestsActivity"
android:theme="@style/WordPress.NoActionBar" />
Expand Down Expand Up @@ -688,7 +690,8 @@
android:name=".ui.main.jetpack.migration.JetpackMigrationActivity"
android:label="@string/jp_migration_welcome_title"
android:screenOrientation="portrait"
android:theme="@style/WordPress.NoActionBar"/>
android:theme="@style/WordPress.NoActionBar"
tools:ignore="DiscouragedApi" />

<!-- Notifications activities -->
<activity
Expand Down Expand Up @@ -765,7 +768,7 @@
android:name=".support.SupportWebViewActivity"
android:screenOrientation="portrait"
android:theme="@style/WordPress.NoActionBar"
tools:ignore="LockedOrientationActivity"/>
tools:ignore="DiscouragedApi,LockedOrientationActivity"/>

<!-- Lib activities-->
<activity
Expand Down Expand Up @@ -1115,13 +1118,15 @@
android:exported="false"
android:label="@string/blaze_activity_title"
android:screenOrientation="portrait"
android:theme="@style/WordPress.NoActionBar"/>
android:theme="@style/WordPress.NoActionBar"
tools:ignore="DiscouragedApi" />

<activity android:name=".ui.blaze.blazecampaigns.BlazeCampaignParentActivity"
android:exported="false"
android:label="@string/blaze_campaigns_page_title"
android:screenOrientation="portrait"
android:theme="@style/WordPress.NoActionBar"/>
android:theme="@style/WordPress.NoActionBar"
tools:ignore="DiscouragedApi" />

<activity android:name=".ui.jetpackoverlay.JetpackStaticPosterActivity"
android:exported="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,7 @@ private static void browsePostOrPageEx(
private static void openAtomicBlogPostPreview(Context context, String url, String authenticationUrl,
String frameNonce) {
try {
@SuppressWarnings("UnsafeImplicitIntentLaunch")
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(authenticationUrl + "?redirect_to=" + URLEncoder
.encode(url + "&frame-nonce=" + UrlUtils.urlEncode(frameNonce), ENCODING_UTF8)));
Expand Down Expand Up @@ -1560,6 +1561,7 @@ public static void loginForJetpackStats(Fragment fragment) {
*/
public static void openUrlExternal(Context context, @NonNull String url) {
Uri uri = Uri.parse(url);
@SuppressWarnings("UnsafeImplicitIntentLaunch")
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

Expand Down Expand Up @@ -1656,6 +1658,7 @@ public static void shareBackupDownloadFileLink(Context context, String url) {
}

public static void downloadBackupDownloadFile(Context context, String url) {
@SuppressWarnings("UnsafeImplicitIntentLaunch")
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
context.startActivity(intent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,14 @@ class HelpActivity : LocaleAwareActivity() {
}

private fun showFaq() {
@SuppressWarnings("UnsafeImplicitIntentLaunch")
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("http://apps.wordpress.com/mobile-app-support/"))
startActivity(intent)
AnalyticsTracker.track(Stat.SUPPORT_HELP_CENTER_VIEWED)
}

private fun showMigrationFaq() {
@SuppressWarnings("UnsafeImplicitIntentLaunch")
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://jetpack.com/support/switch-to-the-jetpack-app/"))
startActivity(intent)
AnalyticsTracker.track(Stat.SUPPORT_MIGRATION_FAQ_TAPPED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

package org.wordpress.android.ui.accounts.signup

import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import android.content.DialogInterface
Expand Down Expand Up @@ -764,6 +765,7 @@ class SignupEpilogueFragment : LoginBaseFormFragment<SignupEpilogueListener?>(),
}
}

@SuppressLint("SetTextI18n")
private fun undoChanges() {
mDisplayName = if (!TextUtils.isEmpty(mAccountStore.account.displayName)
) mAccountStore.account.displayName else requireArguments().getString(ARG_DISPLAY_NAME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class DeepLinkNavigator
navigateAction.site
)
is OpenInBrowser -> {
@SuppressWarnings("UnsafeImplicitIntentLaunch")
val browserIntent = Intent(Intent.ACTION_VIEW, navigateAction.uri.uri)
activity.startActivity(browserIntent)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.wordpress.android.ui.main

import android.annotation.SuppressLint
import android.content.Context
import android.graphics.ColorMatrix
import android.graphics.ColorMatrixColorFilter
Expand Down Expand Up @@ -60,6 +61,7 @@ import com.google.android.material.R as MaterialR
* insert our own custom views so we have more control over their appearance
*/
@AndroidEntryPoint
@SuppressLint("RestrictedApi") // https://github.com/wordpress-mobile/WordPress-Android/issues/21079
class WPMainNavigationView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.wordpress.android.ui.pages

import android.annotation.SuppressLint
import android.content.Context
import android.graphics.drawable.Drawable
import android.text.Spannable
Expand Down Expand Up @@ -287,6 +288,7 @@ sealed class PageItemViewHolder(internal val parent: ViewGroup, @LayoutRes layou
it
)
} ?: stringDate
@SuppressLint("SetTextI18n")
pageSubtitleSuffix.text = ""
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.wordpress.android.ui.people

import android.animation.Animator
import android.annotation.SuppressLint
import android.content.Context
import android.content.res.ColorStateList
import android.graphics.Color
Expand Down Expand Up @@ -404,6 +405,7 @@ class WPEditTextWithChipsOutlined @JvmOverloads constructor(
resetText()
}

@SuppressLint("SetTextI18n")
private fun resetText() {
editor.apply {
text?.clear() ?: setText("")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ public static Set<PostModel> getPostsThatIncludeAnyOfTheseMedia(PostStore postSt
return postsThatContainListedMedia;
}

/*
/**
Note the way we detect we're in presence of Gutenberg blocks logic is taken from
https://github.com/WordPress/gutenberg/blob/5a6693589285363341bebad15bd56d9371cf8ecc/lib/register.php#L331-L345

Expand All @@ -403,11 +403,8 @@ public static Set<PostModel> getPostsThatIncludeAnyOfTheseMedia(PostStore postSt
* but not validating its structure. For strict accuracy, you should use the
* block parser on post content.
*
* @since 1.6.0
* @see gutenberg_parse_blocks()
*
* @param string $content Content to test.
* @return bool Whether the content contains blocks.
* @param postContent Content to test.
* @return whether the content contains blocks.

function gutenberg_content_has_blocks( $content ) {
return false !== strpos( $content, '<!-- wp:' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ public void onClick(View v) {
if (mOpenInDialog) {
showDialog();
} else {
@SuppressWarnings("UnsafeImplicitIntentLaunch")
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(mUrl));
if (browserIntent.resolveActivity(v.getContext().getPackageManager()) != null) {
v.getContext().startActivity(browserIntent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,8 @@ class ReaderExpandableTagsView @JvmOverloads constructor(
private fun updateOverflowIndicatorChip() {
val showOverflowIndicatorChip = hiddenTagChipsCount > 0 || !isSingleLine
uiHelpers.updateVisibility(overflowIndicatorChip, showOverflowIndicatorChip)
overflowIndicatorChip.contentDescription = String.format(
resources.getString(R.string.show_n_hidden_items_desc),
hiddenTagChipsCount
)
overflowIndicatorChip.contentDescription =
resources.getString(R.string.show_n_hidden_items_desc, hiddenTagChipsCount.toString())

overflowIndicatorChip.text = if (isSingleLine) {
chipStyle.overflowChipText(resources, hiddenTagChipsCount)
Expand Down Expand Up @@ -207,9 +205,9 @@ class ReaderExpandableTagsView @JvmOverloads constructor(
get() = R.layout.reader_expandable_tags_view_overflow_chip

override fun overflowChipText(resources: Resources, hiddenChipsCount: Int): String {
return String.format(
resources.getString(R.string.reader_expandable_tags_view_overflow_indicator_expand_title),
hiddenChipsCount
return resources.getString(
R.string.reader_expandable_tags_view_overflow_indicator_expand_title,
hiddenChipsCount.toString()
ParaskP7 marked this conversation as resolved.
Show resolved Hide resolved
)
}

Expand All @@ -229,9 +227,9 @@ class ReaderExpandableTagsView @JvmOverloads constructor(
get() = R.layout.reader_expandable_tags_view_overflow_chip_new

override fun overflowChipText(resources: Resources, hiddenChipsCount: Int): String {
return String.format(
resources.getString(R.string.reader_expandable_tags_view_overflow_indicator_expand_title_new),
hiddenChipsCount
return resources.getString(
R.string.reader_expandable_tags_view_overflow_indicator_expand_title_new,
hiddenChipsCount.toString()
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.wordpress.android.ui.stats.refresh.lists

import android.annotation.SuppressLint
import android.os.Bundle
import android.os.Parcelable
import android.view.Menu
Expand Down Expand Up @@ -318,6 +319,7 @@ class StatsListFragment : ViewPagerFragment(R.layout.stats_list_fragment) {
if (it.subtitle != null) {
emptyView.statsEmptyView.subtitle.setText(it.subtitle)
} else {
@SuppressLint("SetTextI18n")
emptyView.statsEmptyView.subtitle.text = ""
}
if (it.image != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ class SuggestionActivity : LocaleAwareActivity() {
}
})

@SuppressLint("SetTextI18n")
if (text.isEmpty()) {
setText("$prefix")
setSelection(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class DownloadManagerWrapper
) {
val attachmentUri = toPublicUri(fileUrl)

@SuppressWarnings("UnsafeImplicitIntentLaunch")
val openAttachmentIntent = Intent(Intent.ACTION_VIEW)
openAttachmentIntent.setDataAndType(attachmentUri, attachmentMimeType)
openAttachmentIntent.flags = Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_ACTIVITY_NEW_TASK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ private static void showTappedUrl(Context context, String url) {
return;
}
try {
@SuppressWarnings("UnsafeImplicitIntentLaunch")
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
context.startActivity(intent);
} catch (ActivityNotFoundException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,18 +203,20 @@ object AppReviewManager {
val appPackage = requireActivity().packageName
val url = "market://details?id=$appPackage"
try {
requireActivity().startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
@SuppressWarnings("UnsafeImplicitIntentLaunch")
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
requireActivity().startActivity(intent)
} catch (e: ActivityNotFoundException) {
// play store app isn't on this device so open app's page in browser instead
requireActivity().startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse(
"http://play.google.com/store/apps/details?id=" +
@SuppressWarnings("UnsafeImplicitIntentLaunch")
val intent = Intent(
Intent.ACTION_VIEW,
Uri.parse(
"http://play.google.com/store/apps/details?id=" +
requireActivity().packageName
)
)
)
requireActivity().startActivity(intent)
}

setOptOut()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

package org.wordpress.android.viewmodel.helpers

import android.annotation.SuppressLint
import android.content.BroadcastReceiver
import android.content.Context
import android.net.ConnectivityManager
Expand All @@ -25,6 +26,7 @@ class ConnectionStatusLiveDataTest : BaseUnitTest() {
@Before
fun setUp() {
val captor = argumentCaptor<BroadcastReceiver>()
@SuppressLint("UnspecifiedRegisterReceiverFlag")
val context = mock<Context> {
on { registerReceiver(captor.capture(), any()) } doReturn mock()
}
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ext {
androidxConstraintlayoutVersion = '2.1.4'
androidxConstraintlayoutComposeVersion = '1.0.1'
androidxCoreVersion = '1.10.0'
androidxActivityVersion = '1.9.1'
androidxActivityVersion = '1.9.0'
androidxFragmentVersion = '1.8.1'
androidxGridlayoutVersion = '1.0.0'
androidxLifecycleVersion = '2.6.2'
Expand All @@ -64,7 +64,7 @@ ext {
androidxWorkManagerVersion = "2.9.0"
androidxComposeMaterial3Version = '1.2.1'
androidxWebkitVersion = '1.11.0'
apacheCommonsTextVersion = '1.12.0'
apacheCommonsTextVersion = '1.10.0'
ParaskP7 marked this conversation as resolved.
Show resolved Hide resolved
coilComposeVersion = '2.4.0'
chrisbanesPhotoviewVersion = '2.3.0'
eventBusVersion = '3.3.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1815,6 +1815,7 @@ public void onClick(DialogInterface dialog, int id) {
// Open the video preview in the default browser for now.
// TODO open the preview activity already available in media?
final String videoURL = meta.getString(ATTR_SRC);
@SuppressWarnings("UnsafeImplicitIntentLaunch")
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(videoURL));
startActivity(browserIntent);
} catch (JSONException e) {
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pluginManagement {
gradle.ext.kotlinVersion = '1.9.22'
gradle.ext.kspVersion = '1.9.22-1.0.17'
gradle.ext.agpVersion = '8.1.0'
gradle.ext.agpVersion = '8.5.1'
gradle.ext.googleServicesVersion = '4.3.15'
gradle.ext.navigationVersion = '2.7.7'
gradle.ext.sentryVersion = '4.3.1'
Expand Down
Loading