Loading services/tests/PackageManagerServiceTests/host/Android.bp +10 −1 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ java_test_host { ], static_libs: [ "frameworks-base-hostutils", "PackageManagerServiceHostTestsIntentVerifyUtils", ], test_suites: ["general-tests"], java_resources: [ Loading @@ -33,7 +34,15 @@ java_test_host { ":PackageManagerTestAppVersion4", ":PackageManagerTestAppOriginalOverride", ":PackageManagerServiceDeviceSideTests", ], ":PackageManagerTestIntentVerifier", ":PackageManagerTestIntentVerifierTarget1", ":PackageManagerTestIntentVerifierTarget2", ":PackageManagerTestIntentVerifierTarget3", ":PackageManagerTestIntentVerifierTarget4Base", ":PackageManagerTestIntentVerifierTarget4NoAutoVerify", ":PackageManagerTestIntentVerifierTarget4Wildcard", ":PackageManagerTestIntentVerifierTarget4WildcardNoAutoVerify", ] } genrule { Loading services/tests/PackageManagerServiceTests/host/libs/IntentVerifyUtils/Android.bp 0 → 100644 +19 −0 Original line number Diff line number Diff line // Copyright (C) 2020 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. java_library { name: "PackageManagerServiceHostTestsIntentVerifyUtils", srcs: ["src/**/*.kt"], host_supported: true, } tests/AutoVerify/app3/src/com/android/test/autoverify/MainActivity.java→services/tests/PackageManagerServiceTests/host/libs/IntentVerifyUtils/src/com/android/server/pm/test/intent/verify/IntentVerifyTestParams.kt +9 −0 Original line number Diff line number Diff line Loading @@ -13,3 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.server.pm.test.intent.verify interface IntentVerifyTestParams { val methodName: String fun toArgsMap(): Map<String, String> } tests/AutoVerify/app2/src/com/android/test/autoverify/MainActivity.java→services/tests/PackageManagerServiceTests/host/libs/IntentVerifyUtils/src/com/android/server/pm/test/intent/verify/SetActivityAsAlwaysParams.kt +43 −0 Original line number Diff line number Diff line Loading @@ -13,3 +13,31 @@ * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.server.pm.test.intent.verify data class SetActivityAsAlwaysParams( val uri: String, val packageName: String, val activityName: String, override val methodName: String = "setActivityAsAlways" ) : IntentVerifyTestParams { companion object { private const val KEY_URI = "uri" private const val KEY_PACKAGE_NAME = "packageName" private const val KEY_ACTIVITY_NAME = "activityName" fun fromArgs(args: Map<String, String>) = SetActivityAsAlwaysParams( args.getValue(KEY_URI), args.getValue(KEY_PACKAGE_NAME), args.getValue(KEY_ACTIVITY_NAME) ) } override fun toArgsMap() = mapOf( KEY_URI to uri, KEY_PACKAGE_NAME to packageName, KEY_ACTIVITY_NAME to activityName ) } tests/AutoVerify/app4/src/com/android/test/autoverify/MainActivity.java→services/tests/PackageManagerServiceTests/host/libs/IntentVerifyUtils/src/com/android/server/pm/test/intent/verify/StartActivityParams.kt +48 −0 Original line number Diff line number Diff line Loading @@ -13,3 +13,36 @@ * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.server.pm.test.intent.verify data class StartActivityParams( val uri: String, val expected: List<String>, val withBrowsers: Boolean = false, override val methodName: String = "verifyActivityStart" ) : IntentVerifyTestParams { companion object { private const val KEY_URI = "uri" private const val KEY_EXPECTED = "expected" private const val KEY_BROWSER = "browser" fun fromArgs(args: Map<String, String>) = StartActivityParams( args.getValue(KEY_URI), args.getValue(KEY_EXPECTED).split(","), args.getValue(KEY_BROWSER).toBoolean() ) } constructor( uri: String, expected: String, withBrowsers: Boolean = false ) : this(uri, listOf(expected), withBrowsers) override fun toArgsMap() = mapOf( KEY_URI to uri, KEY_EXPECTED to expected.joinToString(separator = ","), KEY_BROWSER to withBrowsers.toString() ) } Loading
services/tests/PackageManagerServiceTests/host/Android.bp +10 −1 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ java_test_host { ], static_libs: [ "frameworks-base-hostutils", "PackageManagerServiceHostTestsIntentVerifyUtils", ], test_suites: ["general-tests"], java_resources: [ Loading @@ -33,7 +34,15 @@ java_test_host { ":PackageManagerTestAppVersion4", ":PackageManagerTestAppOriginalOverride", ":PackageManagerServiceDeviceSideTests", ], ":PackageManagerTestIntentVerifier", ":PackageManagerTestIntentVerifierTarget1", ":PackageManagerTestIntentVerifierTarget2", ":PackageManagerTestIntentVerifierTarget3", ":PackageManagerTestIntentVerifierTarget4Base", ":PackageManagerTestIntentVerifierTarget4NoAutoVerify", ":PackageManagerTestIntentVerifierTarget4Wildcard", ":PackageManagerTestIntentVerifierTarget4WildcardNoAutoVerify", ] } genrule { Loading
services/tests/PackageManagerServiceTests/host/libs/IntentVerifyUtils/Android.bp 0 → 100644 +19 −0 Original line number Diff line number Diff line // Copyright (C) 2020 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. java_library { name: "PackageManagerServiceHostTestsIntentVerifyUtils", srcs: ["src/**/*.kt"], host_supported: true, }
tests/AutoVerify/app3/src/com/android/test/autoverify/MainActivity.java→services/tests/PackageManagerServiceTests/host/libs/IntentVerifyUtils/src/com/android/server/pm/test/intent/verify/IntentVerifyTestParams.kt +9 −0 Original line number Diff line number Diff line Loading @@ -13,3 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.server.pm.test.intent.verify interface IntentVerifyTestParams { val methodName: String fun toArgsMap(): Map<String, String> }
tests/AutoVerify/app2/src/com/android/test/autoverify/MainActivity.java→services/tests/PackageManagerServiceTests/host/libs/IntentVerifyUtils/src/com/android/server/pm/test/intent/verify/SetActivityAsAlwaysParams.kt +43 −0 Original line number Diff line number Diff line Loading @@ -13,3 +13,31 @@ * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.server.pm.test.intent.verify data class SetActivityAsAlwaysParams( val uri: String, val packageName: String, val activityName: String, override val methodName: String = "setActivityAsAlways" ) : IntentVerifyTestParams { companion object { private const val KEY_URI = "uri" private const val KEY_PACKAGE_NAME = "packageName" private const val KEY_ACTIVITY_NAME = "activityName" fun fromArgs(args: Map<String, String>) = SetActivityAsAlwaysParams( args.getValue(KEY_URI), args.getValue(KEY_PACKAGE_NAME), args.getValue(KEY_ACTIVITY_NAME) ) } override fun toArgsMap() = mapOf( KEY_URI to uri, KEY_PACKAGE_NAME to packageName, KEY_ACTIVITY_NAME to activityName ) }
tests/AutoVerify/app4/src/com/android/test/autoverify/MainActivity.java→services/tests/PackageManagerServiceTests/host/libs/IntentVerifyUtils/src/com/android/server/pm/test/intent/verify/StartActivityParams.kt +48 −0 Original line number Diff line number Diff line Loading @@ -13,3 +13,36 @@ * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.server.pm.test.intent.verify data class StartActivityParams( val uri: String, val expected: List<String>, val withBrowsers: Boolean = false, override val methodName: String = "verifyActivityStart" ) : IntentVerifyTestParams { companion object { private const val KEY_URI = "uri" private const val KEY_EXPECTED = "expected" private const val KEY_BROWSER = "browser" fun fromArgs(args: Map<String, String>) = StartActivityParams( args.getValue(KEY_URI), args.getValue(KEY_EXPECTED).split(","), args.getValue(KEY_BROWSER).toBoolean() ) } constructor( uri: String, expected: String, withBrowsers: Boolean = false ) : this(uri, listOf(expected), withBrowsers) override fun toArgsMap() = mapOf( KEY_URI to uri, KEY_EXPECTED to expected.joinToString(separator = ","), KEY_BROWSER to withBrowsers.toString() ) }