Activity windows should not be focusable if not attached to the hierarchy
Top focused activity window was set to invisible and was removed from display. While comparing the current focused window z-order with other windows (in order to update focused window), an exception was thrown because the current focused window was already removed from the hierarchy. Bug: 144146795 Test: existing tests Change-Id: If50012d5d3cbe88d0644daa8ef035007f48d1e5f
This commit is contained in:
@@ -42,7 +42,6 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
|
||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED;
|
||||
import static android.app.WindowConfiguration.ROTATION_UNDEFINED;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
|
||||
import static android.app.WindowConfiguration.activityTypeToString;
|
||||
@@ -2241,7 +2240,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return getWindowConfiguration().canReceiveKeys() || isAlwaysFocusable();
|
||||
return (getWindowConfiguration().canReceiveKeys() || isAlwaysFocusable())
|
||||
&& getParent() != null;
|
||||
}
|
||||
|
||||
/** Move activity with its stack to front and make the stack focused. */
|
||||
|
||||
Reference in New Issue
Block a user