Fixed
Status Update
Comments
il...@google.com <il...@google.com>
jb...@google.com <jb...@google.com> #2
Hi Ed, Thank you so much for these suggestions. I've been reviewing them and merging them in. Hopefully it should be live. I've included a thank you note too in the article.
se...@gmail.com <se...@gmail.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit b2a3eca325760e3686411e619048e2bc52befda8
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Sep 16 16:55:46 2020
Ensure request code start is consistent after restore
When the ActivityResultRegistry is recreated due to either config change
or process death, the next request code is started at the number of
current request codes without including the initial offset.
We should make sure to include the initial offset on restore to remain
consistent.
Relnote: "When restoring the ActivityResultRegistry, the request codes
are now properly started from their previous value instead of the value
of the number of existing request codes."
Test: all ActivityResultRegistryTest pass
Bug: 168374000
Change-Id: I463711fe19233877f1b534e4a7a3325fcfd8f983
M activity/activity/src/main/java/androidx/activity/result/ActivityResultRegistry.java
https://android-review.googlesource.com/1428862
Branch: androidx-master-dev
commit b2a3eca325760e3686411e619048e2bc52befda8
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Sep 16 16:55:46 2020
Ensure request code start is consistent after restore
When the ActivityResultRegistry is recreated due to either config change
or process death, the next request code is started at the number of
current request codes without including the initial offset.
We should make sure to include the initial offset on restore to remain
consistent.
Relnote: "When restoring the ActivityResultRegistry, the request codes
are now properly started from their previous value instead of the value
of the number of existing request codes."
Test: all ActivityResultRegistryTest pass
Bug: 168374000
Change-Id: I463711fe19233877f1b534e4a7a3325fcfd8f983
M activity/activity/src/main/java/androidx/activity/result/ActivityResultRegistry.java
jb...@google.com <jb...@google.com> #5
This change ensures the request code matches, if your issue is not solved and you find a way to reproduce it, please file another bug.
Description
Component used: Activity
Version used: 1.2.0-alpha08
Devices/Android versions reproduced on: Pixel 2 XL Android 10
I've received several crash reports with the following stacktrace:
It looks like the issue was starting to happen after these changes:
The default start number of request codes is set to 0x00010000, but in onRestoreInstanceState the value is set to the key map size:
This line should probably look like this:
mNextRc.set(0x00010000 + numKeys);
This issue is a copy of https://issuetracker.google.com/issues/157584993 . I've decided to create a new issue in androidx activity component since there is a little chance that anyone will look at the old issue which is closed without a proper fix.