Loosen timing expectations in SurfaceViewSyncTests

bug:31799648

Also adds additional lifecycle logging.

Change-Id: Idce61a0a6033495ac475cd065202136671bacbec
diff --git a/tests/tests/view/src/android/view/cts/surfacevalidator/CapturedActivity.java b/tests/tests/view/src/android/view/cts/surfacevalidator/CapturedActivity.java
index 07cb88c..7c2aacd 100644
--- a/tests/tests/view/src/android/view/cts/surfacevalidator/CapturedActivity.java
+++ b/tests/tests/view/src/android/view/cts/surfacevalidator/CapturedActivity.java
@@ -48,7 +48,7 @@
     }
 
     private static final String TAG = "CapturedActivity";
-    private static final long TIME_OUT_MS = 20000;
+    private static final long TIME_OUT_MS = 25000;
     private static final int PERMISSION_CODE = 1;
     private MediaProjectionManager mProjectionManager;
     private MediaProjection mMediaProjection;
@@ -59,7 +59,7 @@
 
     public static final long CAPTURE_DURATION_MS = 10000;
 
-    private static final long START_CAPTURE_DELAY_MS = 1500;
+    private static final long START_CAPTURE_DELAY_MS = 4000;
     private static final long END_CAPTURE_DELAY_MS = START_CAPTURE_DELAY_MS + CAPTURE_DURATION_MS;
     private static final long END_DELAY_MS = END_CAPTURE_DELAY_MS + 1000;
 
@@ -118,6 +118,7 @@
         if (resultCode != RESULT_OK) {
             throw new IllegalStateException("User denied screen sharing permission");
         }
+        Log.d(TAG, "onActivityResult");
         mMediaProjection = mProjectionManager.getMediaProjection(resultCode, data);
         mMediaProjection.registerCallback(new MediaProjectionCallback(), null);
     }