Allow TestActivity#startSync() to take Intent flag

This is a preparation CL to fix Bug 69002467 with tests.

This is a follow up CL to my previous CL [1], which introduced
TestActivity.  One of the limitation in my original CL is that the
Intent flags to launch TestAcitivy are fixed and cannot change.  In
some cases, however, we may want to set additional Intent flags.
Intent.FLAG_ACTIVITY_NO_ANIMATION is an example, which may help us
avoid test flakiness especially when we need to take screenshots and
evaluate them during tests.

With this CL, we can specify additional Intent flags as follows:

  TestActivity.startSync((TestActivity activity) -> {
      final LinearLayout layout = new LinearLayout(activity);
      layout.setOrientation(LinearLayout.VERTICAL);
      final EditText editText = new EditText(activity);
      layout.addView(editText);
      return layout;
  }, Intent.FLAG_ACTIVITY_NO_ANIMATION);  // skip animation

 [1]: Idab518c7adeacf9ace0b88e591ec6b9a1e63e407
      fb6eb1c90d5a7205f881b794e8ed146e75f88966

Bug: 69002467
Test: atest CtsInputMethodTestCases
Change-Id: I01e6f5dbba0af3428dc1077ba7a1e815a8b661db
1 file changed