Avoid pausing bar appearance by starting window when relaunching

1. Starting window is valid to affect bar appearance, so if the
   activity is relaunching with starting window, do not add
   to mRelaunchingSystemBarColorApps. Also because the original
   purpose is to avoid changing the candidate window due to
   the activity doesn't contain a window in a short time, e.g.
   rotation changes without persevering window.
2. When the main window of activity completes draw relaunch, it
   should compare with the actual main window. Otherwise
   findMainWindow() may return starting window that doesn't match
   the activity window.

Bug: 263066320
Test: 1. Assume an activity's splash starting window is white
         background with non-light bar theme.
      2. Launch it and then it requests light bar.
      3. Return to home.
      4. Launch it again and it calls recreate().
         The final appearance should be light bar.
Change-Id: I4f93c1d577ac22a53a9b55ae80260041ce5b5b4b
2 files changed