chage activity to handle layout change

- to prevent test failure due to orientation change

Change-Id: Ie6ae6b7ea8a391474784ac38e82c105e671aab70
diff --git a/tests/tests/mediastress/AndroidManifest.xml b/tests/tests/mediastress/AndroidManifest.xml
index 1ee4104..7388fe3 100644
--- a/tests/tests/mediastress/AndroidManifest.xml
+++ b/tests/tests/mediastress/AndroidManifest.xml
@@ -28,7 +28,8 @@
         <uses-library android:name="android.test.runner" />
         <activity android:label="@string/app_name"
                 android:name="android.mediastress.cts.MediaFrameworkTest"
-                android:screenOrientation="landscape">
+                android:screenOrientation="landscape"
+                android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER"/>
diff --git a/tests/tests/mediastress/src/android/mediastress/cts/NativeMediaActivity.java b/tests/tests/mediastress/src/android/mediastress/cts/NativeMediaActivity.java
index 6a34f88..4232fbf 100644
--- a/tests/tests/mediastress/src/android/mediastress/cts/NativeMediaActivity.java
+++ b/tests/tests/mediastress/src/android/mediastress/cts/NativeMediaActivity.java
@@ -18,6 +18,7 @@
 package android.mediastress.cts;
 
 import android.app.Activity;
+import android.content.res.Configuration;
 import android.graphics.SurfaceTexture;
 import android.media.CamcorderProfile;
 import android.os.Bundle;
@@ -61,6 +62,12 @@
         setContentView(mGLView);
     }
 
+    @Override
+    public void onConfigurationChanged(Configuration newConfig) {
+        Log.w(TAG, "configuration changed " + newConfig.orientation);
+        super.onConfigurationChanged(newConfig);
+    }
+
     /**
      * should be called by GLThread after GlSurface is created.
      */