Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b801a8b authored by Chiao Cheng's avatar Chiao Cheng Committed by Android (Google) Code Review
Browse files

Merge "Show screen during unit test even if locked."

parents 63cefb6c d500f633
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
package com.android.contacts.test;

import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;

import com.android.contacts.ContactsActivity;
import com.android.contacts.R;
@@ -30,6 +32,13 @@ public class FragmentTestActivity extends ContactsActivity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // Normally fragment/activity onStart() methods will not be called when screen is locked.
        // Use the following flags to ensure that activities can be show for testing.
        Window window = getWindow();
        window.addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON |
                WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);

        setContentView(R.layout.fragment_test);
    }
}