Keep the screen on while the test activity is on top.
Bug: 231440256 Test: atest com.android.cts.net.HostsideConnOnActivityStartTest Ignore-AOSP-First: Will cherrypick afterwards Change-Id: Ibb0cc4c8a7cc2338ca938c775706f6b779fa96d3
This commit is contained in:
parent
23ea859b8e
commit
4bfbef73bc
1 changed files with 3 additions and 0 deletions
|
|
@ -27,6 +27,7 @@ import android.content.IntentFilter;
|
|||
import android.os.Bundle;
|
||||
import android.os.RemoteCallback;
|
||||
import android.util.Log;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.annotation.GuardedBy;
|
||||
|
||||
|
|
@ -42,6 +43,8 @@ public class MyActivity extends Activity {
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
Log.d(TAG, "MyActivity.onCreate()");
|
||||
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in a new issue