diff options
author | yueg <yueg@google.com> | 2017-09-28 15:06:58 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-10-02 14:57:34 -0700 |
commit | 90b570e4f427f14fd17d53561c209d5eb1ac1936 (patch) | |
tree | a7fb6b6ab287054cf1806ff1b75067fc0d79a438 /java/com/android/incallui/AudioRouteSelectorActivity.java | |
parent | 4d705e558d25a8fd810cb551c43c5a517cd1c2b9 (diff) |
Fix audio route selector.
1. Use onCancel() instead of onDismiss(). onCancel() is not called when changing orientation, so it won't crash on getParentUnsafe(). onCancel() is also not called when pressing home button, but it will be handled by AudioRouteSelectorActivity.onPause(). b/67013452 will happen after the fix.
2. Use FLAG_ACTIVITY_NEW_TASK and FLAG_ACTIVITY_MULTIPLE_TASK when starting AudioRouteSelectorActivity. This prevents showing Dialer with AudioRouteSelectorActivity. The downside is that the activity is no longer excluded from recent screen.
The two fixes can affect each other, so they are in one CL.
Video: https://drive.google.com/open?id=0Bz1rQbdSCWSKYVJkd3R1SkI4c3c
Test: manual
PiperOrigin-RevId: 170404203
Change-Id: Ifa8ebcd566670115d3865b0d67c311c296fbbd51
Diffstat (limited to 'java/com/android/incallui/AudioRouteSelectorActivity.java')
-rw-r--r-- | java/com/android/incallui/AudioRouteSelectorActivity.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/java/com/android/incallui/AudioRouteSelectorActivity.java b/java/com/android/incallui/AudioRouteSelectorActivity.java index f0ae79bc2..2fdc89aa8 100644 --- a/java/com/android/incallui/AudioRouteSelectorActivity.java +++ b/java/com/android/incallui/AudioRouteSelectorActivity.java @@ -57,7 +57,9 @@ public class AudioRouteSelectorActivity extends FragmentActivity if (audioRouteSelectorDialogFragment != null) { audioRouteSelectorDialogFragment.dismiss(); } - // We don't expect the activity to resume - finish(); + // We don't expect the activity to resume, except for orientation change. + if (!isChangingConfigurations()) { + finish(); + } } } |