Commit 30594fe5 authored by Robbie McElrath's avatar Robbie McElrath Committed by Commit Bot

[WebLayer] Patch r.android.com/1302016 into androidx fragment library

This CL modifies our copy of the AndroidX fragment library to include
r.android.com/1302016, which prevents a problematic getActivity() call
in DialogFragment.java.

Bug: 1123216
Change-Id: I33ffcdc00b694ac5b521ba30014053d2acdbdfc9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2406600Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806787}
parent 3790688d
......@@ -334,6 +334,11 @@ android_aar_prebuilt("androidx_fragment_fragment_java") {
":androidx_viewpager_viewpager_java",
]
resource_overlay = true
deps += [ "//third_party/android_deps/local_modifications/androidx_fragment_fragment:androidx_fragment_fragment_prebuilt_java" ]
# Omit this file since we use our own copy, included above.
# We can remove this once we migrate to AndroidX master for all libraries.
jar_excluded_patterns = [ "androidx/fragment/app/DialogFragment*" ]
ignore_proguard_configs = true
}
......
......@@ -299,8 +299,16 @@ class BuildConfigGenerator extends DefaultTask {
sb.append(' ignore_proguard_configs = true\n')
break
case 'androidx_fragment_fragment':
sb.append('\n')
sb.append(' ignore_proguard_configs = true\n')
sb.append("""\
| deps += [ "//third_party/android_deps/local_modifications/androidx_fragment_fragment:androidx_fragment_fragment_prebuilt_java" ]
| # Omit this file since we use our own copy, included above.
| # We can remove this once we migrate to AndroidX master for all libraries.
| jar_excluded_patterns = [
| "androidx/fragment/app/DialogFragment.java",
| ]
|
| ignore_proguard_configs = true
|""".stripMargin())
break
case 'androidx_media_media':
case 'androidx_versionedparcelable_versionedparcelable':
......
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/android/rules.gni")
# This rule contains the jar file produced by building
# :androidx_fragment_fragment_partial_java. After building the
# aforementioned target, the jar file can be found in:
# out/<dir>/lib.java/third_party/android_deps/local_modifications/androidx_fragment_fragment/androidx_fragment_fragment_partial_java.jar
android_java_prebuilt("androidx_fragment_fragment_prebuilt_java") {
jar_path = "androidx_fragment_fragment_java.jar"
# Normally this would depend on //third_party/android_deps:androidx_fragment_fragment_java,
# but the dependency is reversed to keep the .class file customization
# transparent to dependents. Disable bytecode checks, which would otherwise
# complain about this.
enable_bytecode_checks = false
}
android_library("androidx_fragment_fragment_partial_java") {
sources = [ "java/androidx/fragment/app/DialogFragment.java" ]
deps = [
"//third_party/android_deps:androidx_annotation_annotation_java",
"//third_party/android_deps:androidx_fragment_fragment_java",
]
}
This directory contains AndroidX's DialogFragment.java, copied from commit
88c22bfb, with c07daa2 merged in, which removes a problematic
Fragment.getActivity() call.
To pull in these changes, we exclude DialogFragment from the
androidx_fragment_fragment library in CIPD (which is from an official
release), and add a dependency from that library to a prebuilt jar file
containing our customized DialogFragment.java.
Note that this customization can be removed once we start pulling our
AndroidX dependencies from master.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment