xref: /aosp_15_r20/system/apex/apexd/aidl/android/apex/IApexService.aidl (revision 33f3758387333dbd2962d7edbd98681940d895da)
1 /*
2  * Copyright (C) 2018 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.apex;
18 
19 import android.apex.ApexInfo;
20 import android.apex.ApexInfoList;
21 import android.apex.ApexSessionInfo;
22 import android.apex.ApexSessionParams;
23 import android.apex.CompressedApexInfoList;
24 
25 interface IApexService {
submitStagedSession(in ApexSessionParams params, out ApexInfoList packages)26    void submitStagedSession(in ApexSessionParams params, out ApexInfoList packages);
markStagedSessionReady(int session_id)27    void markStagedSessionReady(int session_id);
markStagedSessionSuccessful(int session_id)28    void markStagedSessionSuccessful(int session_id);
29 
getSessions()30    ApexSessionInfo[] getSessions();
getStagedSessionInfo(int session_id)31    ApexSessionInfo getStagedSessionInfo(int session_id);
getStagedApexInfos(in ApexSessionParams params)32    ApexInfo[] getStagedApexInfos(in ApexSessionParams params);
getActivePackages()33    ApexInfo[] getActivePackages();
getAllPackages()34    ApexInfo[] getAllPackages();
35 
abortStagedSession(int session_id)36    void abortStagedSession(int session_id);
revertActiveSessions()37    void revertActiveSessions();
38 
39    /**
40     * Copies the CE apex data directory for the given user to the backup
41     * location.
42     */
snapshotCeData(int user_id, int rollback_id, in @utf8InCpp String apex_name)43    void snapshotCeData(int user_id, int rollback_id, in @utf8InCpp String apex_name);
44 
45    /**
46     * Restores the snapshot of the CE apex data directory for the given user and
47     * apex. Note the snapshot will be deleted after restoration succeeded.
48     */
restoreCeData(int user_id, int rollback_id, in @utf8InCpp String apex_name)49    void restoreCeData(int user_id, int rollback_id, in @utf8InCpp String apex_name);
50 
51    /**
52     * Deletes device-encrypted snapshots for the given rollback id.
53     */
destroyDeSnapshots(int rollback_id)54    void destroyDeSnapshots(int rollback_id);
55 
56    /**
57     * Deletes credential-encrypted snapshots for the given user, for the given rollback id.
58     */
destroyCeSnapshots(int user_id, int rollback_id)59    void destroyCeSnapshots(int user_id, int rollback_id);
60 
61    /**
62     * Deletes all credential-encrypted snapshots for the given user, except for
63     * those listed in retain_rollback_ids.
64     */
destroyCeSnapshotsNotSpecified(int user_id, in int[] retain_rollback_ids)65    void destroyCeSnapshotsNotSpecified(int user_id, in int[] retain_rollback_ids);
66 
unstagePackages(in @tf8InCpp List<String> active_package_paths)67    void unstagePackages(in @utf8InCpp List<String> active_package_paths);
68 
69    /**
70     * Returns the active package corresponding to |package_name| and null
71     * if none exists.
72     */
getActivePackage(in @tf8InCpp String package_name)73    ApexInfo getActivePackage(in @utf8InCpp String package_name);
74 
75    /**
76     * Not meant for use outside of testing. The call will not be
77     * functional on user builds.
78     */
stagePackages(in @tf8InCpp List<String> package_tmp_paths)79    void stagePackages(in @utf8InCpp List<String> package_tmp_paths);
80    /**
81     * Not meant for use outside of testing. The call will not be
82     * functional on user builds.
83     */
resumeRevertIfNeeded()84    void resumeRevertIfNeeded();
85    /**
86     * Forces apexd to recollect pre-installed data from all the supported built-in dirs.
87     *
88     * Not meant for use outside of testing. This call will not be functional
89     * on user builds. Only root is allowed to call this method.
90     */
recollectPreinstalledData()91    void recollectPreinstalledData();
92 
93    /**
94     * Informs apexd that the boot has completed.
95     */
markBootCompleted()96    void markBootCompleted();
97 
98    /**
99    * Assuming the provided compressed APEX will be installed on next boot,
100    * calculate how much space will be required for decompression
101    */
calculateSizeForCompressedApex(in CompressedApexInfoList compressed_apex_info_list)102    long calculateSizeForCompressedApex(in CompressedApexInfoList compressed_apex_info_list);
103 
104    /**
105    * Reserve space on /data partition for compressed APEX decompression. Returns error if
106    * reservation fails. If empty list is passed, then reserved space is deallocated.
107    */
reserveSpaceForCompressedApex(in CompressedApexInfoList compressed_apex_info_list)108    void reserveSpaceForCompressedApex(in CompressedApexInfoList compressed_apex_info_list);
109 
110    /**
111     * Performs a non-staged install of the given APEX.
112     */
installAndActivatePackage(in @tf8InCpp String packagePath, boolean force)113    ApexInfo installAndActivatePackage(in @utf8InCpp String packagePath, boolean force);
114 }
115