Fix NPE when calling recreate in onCreate am: 6c675a3a48 am: 36b8c779f6

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15435289

Change-Id: Ia4e5a22c171f703ebf9de005f2a79b1d28610cea
This commit is contained in:
Riddle Hsu
2021-08-04 05:52:48 +00:00
committed by Automerger Merge Worker

View File

@@ -5666,8 +5666,8 @@ public final class ActivityThread extends ClientTransactionHandler
*/
private void scheduleRelaunchActivityIfPossible(@NonNull ActivityClientRecord r,
boolean preserveWindow) {
if (r.activity.mFinished || r.token instanceof Binder) {
// Do not schedule relaunch if the activity is finishing or not a local object (e.g.
if ((r.activity != null && r.activity.mFinished) || r.token instanceof Binder) {
// Do not schedule relaunch if the activity is finishing or is a local object (e.g.
// created by ActivtiyGroup that server side doesn't recognize it).
return;
}