Fix ConfigurationScreenLayoutTest

Bug 5739739

The test fails when the screen is locked. The disable keyguard
code isn't invoked, because this test package doesn't use
InstrumentationCtsTestRunner. Rather than depending on
InstrumentationCtsTestRunner and having to move this
activity to com.android.cts.stubs, I added code to disable the
keyguard which is simpler than the one InstrumentationCtsTestRunner.

Change-Id: Iaacba8407d6fc8615d2e87c4c45fca9e76515107
diff --git a/tests/tests/dpi/src/android/dpi/cts/ConfigurationScreenLayoutActivity.java b/tests/tests/dpi/src/android/dpi/cts/ConfigurationScreenLayoutActivity.java
index 8ee800c..d4d268d 100644
--- a/tests/tests/dpi/src/android/dpi/cts/ConfigurationScreenLayoutActivity.java
+++ b/tests/tests/dpi/src/android/dpi/cts/ConfigurationScreenLayoutActivity.java
@@ -18,6 +18,8 @@
 
 import android.app.Activity;
 import android.os.Bundle;
+import android.view.Window;
+import android.view.WindowManager;
 
 /** {@link Activity} that calls {@link #setRequestedOrientation(int)} with the extra value. */
 public class ConfigurationScreenLayoutActivity extends Activity {
@@ -27,6 +29,10 @@
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
+
+        Window window = getWindow();
+        window.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
+
         int orientation = getIntent().getIntExtra(EXTRA_ORIENTATION, -1);
         setRequestedOrientation(orientation);
     }