Check that H.264 is available before checking max frame rate

Previously this test was checking for the max frame rate of H.264
before it would check if the H.264 codec actually existed on the
device. Devices that do not have this codec would fail the test
due to this ordering. This change reorders the checks so that
we only check the max frame rate if the code exists.

Bug: 32742421
Change-Id: I3a2e0806c1d6dd87095eadd7917d25273acfe190
diff --git a/tests/tests/media/src/android/media/cts/MediaRecorderTest.java b/tests/tests/media/src/android/media/cts/MediaRecorderTest.java
index 32d9eaa..3cbfdbf 100644
--- a/tests/tests/media/src/android/media/cts/MediaRecorderTest.java
+++ b/tests/tests/media/src/android/media/cts/MediaRecorderTest.java
@@ -923,13 +923,14 @@
         boolean success = false;
         Surface surface = null;
         int noOfFailure = 0;
-        final float frameRate = getMaxFrameRateForCodec(MediaRecorder.VideoEncoder.H264);
 
         if (!hasH264()) {
             MediaUtils.skipTest("no codecs");
             return true;
         }
 
+        final float frameRate = getMaxFrameRateForCodec(MediaRecorder.VideoEncoder.H264);
+
         try {
             if (persistent) {
                 surface = MediaCodec.createPersistentInputSurface();