From 734b0b716325e55700bb99e99bbb0f170edf65bc Mon Sep 17 00:00:00 2001 From: Sudheer Shanka Date: Fri, 11 Aug 2017 18:22:16 -0700 Subject: [PATCH] Fix and enable ConnOnActivityStartTest. - Set parole duration to 0 so that it won't affect app standby test. - Use a bound service to send commands to test app instead of broadcasts. - Remove code to install/delete test app as it will be done as part of tests initialization. Bug: 38432755 Test: forrest --extra_args='--class com.android.server.net.ConnOnActivityStartTest' \ test FrameworksServicesTests Change-Id: Ic6cd574a60c4449195f2c8cd4e04b9cb47f225c8 Merged-In: Ic6cd574a60c4449195f2c8cd4e04b9cb47f225c8 --- services/tests/servicestests/Android.mk | 5 +- services/tests/servicestests/AndroidTest.xml | 1 + services/tests/servicestests/aidl/Android.mk | 3 +- .../aidl/ICmdReceiverService.aidl | 21 ++ .../tests/servicestests/res/raw/conntestapp | Bin 8260 -> 0 bytes .../server/net/ConnOnActivityStartTest.java | 185 ++++++++---------- .../tests/servicestests/test-apps/Android.mk | 1 + .../test-apps/ConnTestApp/Android.mk | 2 + .../test-apps/ConnTestApp/AndroidManifest.xml | 2 + .../apps/conntestapp/CmdReceiverService.java | 36 ++++ .../apps/conntestapp/ConnTestActivity.java | 34 ++++ 11 files changed, 185 insertions(+), 105 deletions(-) create mode 100644 services/tests/servicestests/aidl/com/android/servicestests/aidl/ICmdReceiverService.aidl delete mode 100644 services/tests/servicestests/res/raw/conntestapp create mode 100644 services/tests/servicestests/test-apps/Android.mk create mode 100644 services/tests/servicestests/test-apps/ConnTestApp/src/com/android/servicestests/apps/conntestapp/CmdReceiverService.java diff --git a/services/tests/servicestests/Android.mk b/services/tests/servicestests/Android.mk index 507b4830e455b..19396d43e15e4 100644 --- a/services/tests/servicestests/Android.mk +++ b/services/tests/servicestests/Android.mk @@ -29,7 +29,8 @@ LOCAL_STATIC_JAVA_LIBRARIES := \ LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/aidl -LOCAL_SRC_FILES += aidl/com/android/servicestests/aidl/INetworkStateObserver.aidl +LOCAL_SRC_FILES += aidl/com/android/servicestests/aidl/INetworkStateObserver.aidl \ + aidl/com/android/servicestests/aidl/ICmdReceiverService.aidl LOCAL_JAVA_LIBRARIES := android.test.mock legacy-android-test @@ -61,3 +62,5 @@ LOCAL_DX_FLAGS := --multi-dex LOCAL_STATIC_JAVA_LIBRARIES += ub-uiautomator include $(BUILD_PACKAGE) + +include $(call all-makefiles-under, $(LOCAL_PATH)) \ No newline at end of file diff --git a/services/tests/servicestests/AndroidTest.xml b/services/tests/servicestests/AndroidTest.xml index 63f3b75604677..6a9983e87d903 100644 --- a/services/tests/servicestests/AndroidTest.xml +++ b/services/tests/servicestests/AndroidTest.xml @@ -16,6 +16,7 @@