Fix null exception when switching dark/light theme mode with the rotation dialog popup
Test: Manually
Fixes: 159183077
Change-Id: I19891febb1b00461b6be4678a9515de483df313f
diff --git a/src/com/android/wallpaper/picker/individual/IndividualPickerFragment.java b/src/com/android/wallpaper/picker/individual/IndividualPickerFragment.java
index f93f68b..2fee8f1 100755
--- a/src/com/android/wallpaper/picker/individual/IndividualPickerFragment.java
+++ b/src/com/android/wallpaper/picker/individual/IndividualPickerFragment.java
@@ -622,7 +622,13 @@
@Override
public void onStartRotationDialogDismiss(@NonNull DialogInterface dialog) {
- mBottomActionBar.deselectAction(ROTATION);
+ // TODO(b/159310028): Refactor fragment layer to make it able to restore from config change.
+ // This is to handle config change with StartRotationDialog popup, the StartRotationDialog
+ // still holds a reference to the destroyed Fragment and is calling
+ // onStartRotationDialogDismissed on that destroyed Fragment.
+ if (mBottomActionBar != null) {
+ mBottomActionBar.deselectAction(ROTATION);
+ }
}
@Override