When a multipackage session is verified to fail, destroyInternal() is
only called for the parent session. However, the child session
doesn't call destroyInternal(). It makes the child session data
occupy the storage space. The device user can't get the storage
space back except to execute factory reset or root the device.
This patch calls destroyInternal() for all of child sessions if the
verification failed.
This patch also creates a new test that needs a rooted device. The
test verifies that the child session stage dir is cleaned.
* using "dumpsys package" to get stage dir
* using "su root" to check the stage dir exist or not so it needs a
rooted device
Test: TID="PackageManagerServiceHostTests"; \
TC="com.android.server.pm.test.PackageInstallerSessionTest"; \
atest "${TID}:${TC}"
Fix: 196522826
Change-Id: Ice257df8dd541c7ca732279ddf0353e6fde83e64
34 lines
1.4 KiB
XML
34 lines
1.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!--
|
|
~ 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.
|
|
-->
|
|
|
|
<configuration description="Test module config for PackageManagerServiceHostTests">
|
|
<option name="test-tag" value="PackageManagerServiceHostTests" />
|
|
|
|
<target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
|
|
|
|
<target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
|
|
<option name="run-command"
|
|
value="pm uninstall com.android.cts.install.lib.testapp.A" />
|
|
<option name="teardown-command"
|
|
value="pm uninstall com.android.cts.install.lib.testapp.A" />
|
|
</target_preparer>
|
|
|
|
<test class="com.android.tradefed.testtype.HostTest">
|
|
<option name="jar" value="PackageManagerServiceHostTests.jar" />
|
|
</test>
|
|
</configuration>
|