ActivityTaskManagerService: clear previous if it becomes topApp

The same app shouldn't be top and previous. When topApp changes, if
the same app is previous, clear previous.

Test: atest WmTests:WindowStateTests
Bug: 262213347

Change-Id: Ia0e3fd2adf1c9c16e8d24b89785d6cd33f74d962
1 file changed