Added two new flags to the Activity to turn the screen on and show on the lock screen. These can be used instead of the Window flags LayouParams.FLAG_TURN_SCREEN_ON and LayoutParams.FLAG_SHOW_WHEN_LOCKED to prevent the double onStart/onResume lifecycle events. The flags can be set as an attr for the Activity in the AndroidManifest using android:showWhenLocked="true" and android:turnScreenOn="true". They can also be set through methods in the Activity class using setShowWhenLocked(true) and setTurnScreen(true). Fixes: 36850100 Test: Created sample application, tests/ShowWhenLockedApp, that set the flags in the manifest and code. Tested multiple scenarios to launch the Activity with the flags set and unset. Test: cts-tradefed run commandAndExit cts-dev --module CtsServicesHostTestCases -t android.server.cts.KeyguardTransitionTests Test: cts-tradefed run commandAndExit cts-dev --module CtsServicesHostTestCases -t android.server.cts.ActivityManagerActivityVisibilityTests Test: cts-tradefed run commandAndExit cts-dev --module CtsServicesHostTestCases -t android.server.cts.KeyguardTests Change-Id: I44f0e313df4531d49c7ac56108b6bf80e41fefc1
10 lines
191 B
Makefile
10 lines
191 B
Makefile
LOCAL_PATH:= $(call my-dir)
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_SRC_FILES := $(call all-subdir-java-files)
|
|
|
|
LOCAL_PACKAGE_NAME := ShowWhenLocked
|
|
|
|
LOCAL_MODULE_TAGS := tests
|
|
|
|
include $(BUILD_PACKAGE) |