Fix ANR for real
Imagine the following sequence: - Activity is requested to to be visible. - Activity draws, app transition starts. - Activity is requested to be invisible, but transition is still pending because of another opening activity that hasn't drawn yet. hiddenRequested=true - First app transition finishes. clientHidden=true at the end of the transition because hiddenRequested==true - Activity is requested to be visible again. However, hidden==false since we haven't started the new transition yet. But then BOOOOM clientHidden is stuck at true and we ANR because we never make the window visible again. Fix this by uncoditionally setting client visibility when changing app visibility. Test: adb shell monkey -p com.google.android.deskclock -p com.android.calculator -p com.android.calculator2 -p com.google.android.contacts -p com.android.launcher -p com.google.android.launcher -p com.android.mms -p com.google.android.apps.messaging -p com.android.phone -p com.google.android.dialer -p com.android.providers.downloads.ui -p com.android.settings -p com.google.android.calendar -p com.google.android.GoogleCamera -p com.google.android.apps.photos -p com.google.android.gms -p com.google.android.setupwizard -p com.google.android.googlequicksearchbox -p com.google.android.packageinstaller -p com.google.android.apps.nexuslauncher -c android.intent.category.LAUNCHER --ignore-security-exceptions --monitor-native-crashes -s 814 -v -v -v 125000 Change-Id: I40160266a465cb5a1a9c2ac6476d89e2829a537e Fixes: 72160186
Loading
Please register or sign in to comment