Android 将最新的 AOSP 提交到我的项目中

Android get latest AOSP commits into my project

我的 Android 应用程序在一些罕见的情况下遇到了一些冻结问题。经过一些研究,我发现这个问题是由 Android 错误引起的,该错误已在 issuetracker.google.com 上报告。最近我收到通知说这个问题已经解决了。

现在我的问题是,我如何确保我的项目中已经包含了这个可能会修复冻结的 AOSP 提交?它可能与 build.gradle 文件有关,它看起来像这样:

dependencies {
    implementation 'androidx.preference:preference:1.1.0'
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'com.google.android.material:material:1.2.0-alpha03'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    ...
}

对于每个实现,都有一个版本号。那么我是否必须等到 Google 发布包含修复程序的最新版本的软件包,然后再使用这个最新版本?还是仅通过重新同步项目就能获得最新修复?

如果这是一个愚蠢的问题,我深表歉意,但我还不太明白 AOSP 存储库和我的 Android 项目之间的同步是如何工作的。在此先感谢您的帮助。

Link 到 Issuetracker 上的 Bug。需要使用 Google 帐户登录才能查看 Issuetracker。

我会说'androidx.appcompat:appcompat:1.2.0-alpha03'。

来自修复错误的 Issue Tracker we learn the link to the Patch。在补丁页面中,我们看到修复在 'appcompat' folder/library(底部的修改文件列表)中。此外,在左上角,我们看到了存储库和合并补丁的分支(repo platform/frameworks/support,branch androidx-master-dev)。将补丁标记为 MERGED 很重要。只有合并的补丁才会集成到已发布的库中。

点击 the branch link sends us to the repo/branch from which all androidx.* libs are built (See these instructions how to build androidx.* libs yourself and use them locally). Here we have to search for the patch that fixed that bug but the androidx repository receives a lot of patches and the list is pretty long. Fortunately, that search/filter box from top-right accepts a directory key. By adding 'directory:appcompat' in the search box we see only the patches from appcompat lib。很容易发现“Fix stopped Activities not resuming on < API 24”补丁和就在它上面的另一个补丁“Bump AppCompat version to 1.2。 0-alpha03' 为固定的 appcompat lib 设置版本。