Skip to content

Commit ec23c08

Browse files
author
Jooyung Han
committed
Add stagedApexInfos to ApexStagedEvent
Previously, the event struct had the list of staged APEX names. This leads to calling getStagedApexInfo(name), which in turn calls getStagedApexInfos(session). Note that StagingManager gets the list of APEX names by calling getStagedApexInfos(session). Hence, the same method gets called repeatedly. getStagedApexInfos(session) is quite heavy because it involes mounting APEXes in the session and running an external program. Passing stagedApexInfos in ApexStagedEvent and providing getStagedApexInfos() make apexd & observers happy. (no need to run the same operation over and over.) Bug: 370712193 Test: StagingManagerTest Test: StagedInstallInternalTest Change-Id: I8d6a0baf6caff453f22d87a694a9eae91361a490
1 parent 4811398 commit ec23c08

3 files changed

Lines changed: 6 additions & 9 deletions

File tree

libs/binder/aidl/android/content/pm/ApexStagedEvent.aidl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@
1616

1717
package android.content.pm;
1818

19+
import android.content.pm.StagedApexInfo;
20+
1921
/**
2022
* This event is designed for notification to native code listener about
2123
* any changes to set of apex packages staged for installation on next boot.
2224
*
2325
* @hide
2426
*/
2527
parcelable ApexStagedEvent {
26-
@utf8InCpp String[] stagedApexModuleNames;
28+
StagedApexInfo[] stagedApexInfos;
2729
}

libs/binder/aidl/android/content/pm/IPackageManagerNative.aidl

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,7 @@ interface IPackageManagerNative {
135135
void unregisterStagedApexObserver(in IStagedApexObserver observer);
136136

137137
/**
138-
* Get APEX module names of all APEX that are staged ready for installation
138+
* Get information of staged APEXes.
139139
*/
140-
@utf8InCpp String[] getStagedApexModuleNames();
141-
142-
/**
143-
* Get information of APEX which is staged ready for installation.
144-
* Returns null if no such APEX is found.
145-
*/
146-
@nullable StagedApexInfo getStagedApexInfo(in @utf8InCpp String moduleName);
140+
StagedApexInfo[] getStagedApexInfos();
147141
}

libs/binder/aidl/android/content/pm/StagedApexInfo.aidl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ package android.content.pm;
2222
*
2323
* @hide
2424
*/
25+
@JavaDerive(equals=true)
2526
parcelable StagedApexInfo {
2627
@utf8InCpp String moduleName;
2728
@utf8InCpp String diskImagePath;

0 commit comments

Comments
 (0)