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

Commit 18402fcd authored by Mateusz Cicheński's avatar Mateusz Cicheński
Browse files

Adopt shell permissions identify for running the 1P/3P pip tests

This also requires updating the MOCK_LOCATION permission to shell
process, as it is now recognized as that instead of the test package.

Bug: 302034872
Test: manually, modified Android.bp java_defaults by removing
certificate signing, make csuite and run -> fail due to permissions
Added the changes made in this CL still without the certificate signing
make csuite and run -> tests run successfully, even though the apk is
not signed with platform certificate

Change-Id: I324cc94bd53d333afa7ec3aef0cb7e46c72b0a3b
parent 2d0e12df
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -124,6 +124,10 @@ android_test {
        ":WMShellFlickerTestsPipCommon-src",
    ],
    static_libs: ["WMShellFlickerTestsBase"],
    test_suites: [
        "device-tests",
        "csuite",
    ],
}

csuite_test {
+2 −2
Original line number Diff line number Diff line
@@ -71,9 +71,9 @@
    <!-- Enable mocking GPS location by the test app -->
    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
        <option name="run-command"
                value="appops set com.android.wm.shell.flicker.pip.apps android:mock_location allow"/>
                value="appops set com.android.shell android:mock_location allow"/>
        <option name="teardown-command"
                value="appops set com.android.wm.shell.flicker.pip.apps android:mock_location deny"/>
                value="appops set com.android.shell android:mock_location deny"/>
    </target_preparer>

    <!-- Needed for pushing the trace config file -->
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ abstract class AppsEnterPipTransition(flicker: LegacyFlickerTest) : EnterPipTran
    @FlickerBuilderProvider
    override fun buildFlicker(): FlickerBuilder {
        return FlickerBuilder(instrumentation).apply {
            withoutScreenRecorder()
            instrumentation.uiAutomation.adoptShellPermissionIdentity()
            setup { flicker.scenario.setIsTablet(tapl.isTablet) }
            transition()
        }