19087400f3c82b97aa17a74329c7e65c0a5ff4062Jeff Sharkey/*
29087400f3c82b97aa17a74329c7e65c0a5ff4062Jeff Sharkey * Copyright (C) 2016 The Android Open Source Project
39087400f3c82b97aa17a74329c7e65c0a5ff4062Jeff Sharkey *
49087400f3c82b97aa17a74329c7e65c0a5ff4062Jeff Sharkey * Licensed under the Apache License, Version 2.0 (the "License");
59087400f3c82b97aa17a74329c7e65c0a5ff4062Jeff Sharkey * you may not use this file except in compliance with the License.
69087400f3c82b97aa17a74329c7e65c0a5ff4062Jeff Sharkey * You may obtain a copy of the License at
79087400f3c82b97aa17a74329c7e65c0a5ff4062Jeff Sharkey *
89087400f3c82b97aa17a74329c7e65c0a5ff4062Jeff Sharkey *      http://www.apache.org/licenses/LICENSE-2.0
99087400f3c82b97aa17a74329c7e65c0a5ff4062Jeff Sharkey *
109087400f3c82b97aa17a74329c7e65c0a5ff4062Jeff Sharkey * Unless required by applicable law or agreed to in writing, software
119087400f3c82b97aa17a74329c7e65c0a5ff4062Jeff Sharkey * distributed under the License is distributed on an "AS IS" BASIS,
129087400f3c82b97aa17a74329c7e65c0a5ff4062Jeff Sharkey * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
139087400f3c82b97aa17a74329c7e65c0a5ff4062Jeff Sharkey * See the License for the specific language governing permissions and
149087400f3c82b97aa17a74329c7e65c0a5ff4062Jeff Sharkey * limitations under the License.
159087400f3c82b97aa17a74329c7e65c0a5ff4062Jeff Sharkey */
169087400f3c82b97aa17a74329c7e65c0a5ff4062Jeff Sharkey
179087400f3c82b97aa17a74329c7e65c0a5ff4062Jeff Sharkeypackage android.os;
189087400f3c82b97aa17a74329c7e65c0a5ff4062Jeff Sharkey
196c2c056193010cf93b4264810d462c120ce801c8Jeff Sharkey/** {@hide} */
209087400f3c82b97aa17a74329c7e65c0a5ff4062Jeff Sharkeyinterface IInstalld {
21c1e93e7d746e07791b0667c80ad43a407c515fa8Jeff Sharkey    void createUserData(@nullable @utf8InCpp String uuid, int userId, int userSerial, int flags);
22c1e93e7d746e07791b0667c80ad43a407c515fa8Jeff Sharkey    void destroyUserData(@nullable @utf8InCpp String uuid, int userId, int flags);
23c1e93e7d746e07791b0667c80ad43a407c515fa8Jeff Sharkey
2436a900a0db526d63e899ed5d5b0a463ad7f9236eJeff Sharkey    long createAppData(@nullable @utf8InCpp String uuid, in @utf8InCpp String packageName,
250274c977e3b10b52936fd5b2eb464857f0ca6358Jeff Sharkey            int userId, int flags, int appId, in @utf8InCpp String seInfo, int targetSdkVersion);
26c1e93e7d746e07791b0667c80ad43a407c515fa8Jeff Sharkey    void restoreconAppData(@nullable @utf8InCpp String uuid, @utf8InCpp String packageName,
27c1e93e7d746e07791b0667c80ad43a407c515fa8Jeff Sharkey            int userId, int flags, int appId, @utf8InCpp String seInfo);
28c1e93e7d746e07791b0667c80ad43a407c515fa8Jeff Sharkey    void migrateAppData(@nullable @utf8InCpp String uuid, @utf8InCpp String packageName,
29c1e93e7d746e07791b0667c80ad43a407c515fa8Jeff Sharkey            int userId, int flags);
30c1e93e7d746e07791b0667c80ad43a407c515fa8Jeff Sharkey    void clearAppData(@nullable @utf8InCpp String uuid, @utf8InCpp String packageName,
31c1e93e7d746e07791b0667c80ad43a407c515fa8Jeff Sharkey            int userId, int flags, long ceDataInode);
32c1e93e7d746e07791b0667c80ad43a407c515fa8Jeff Sharkey    void destroyAppData(@nullable @utf8InCpp String uuid, @utf8InCpp String packageName,
33c1e93e7d746e07791b0667c80ad43a407c515fa8Jeff Sharkey            int userId, int flags, long ceDataInode);
34df2d754b38796e0c49c70e0a67f7d383e3079ff2Jeff Sharkey
35e12d5964a8d14abe7f2eb6e57469cbe7f7391a19Jeff Sharkey    void fixupAppData(@nullable @utf8InCpp String uuid, int flags);
36e12d5964a8d14abe7f2eb6e57469cbe7f7391a19Jeff Sharkey
37df2d754b38796e0c49c70e0a67f7d383e3079ff2Jeff Sharkey    long[] getAppSize(@nullable @utf8InCpp String uuid, in @utf8InCpp String[] packageNames,
38df2d754b38796e0c49c70e0a67f7d383e3079ff2Jeff Sharkey            int userId, int flags, int appId, in long[] ceDataInodes,
39df2d754b38796e0c49c70e0a67f7d383e3079ff2Jeff Sharkey            in @utf8InCpp String[] codePaths);
40df2d754b38796e0c49c70e0a67f7d383e3079ff2Jeff Sharkey    long[] getUserSize(@nullable @utf8InCpp String uuid, int userId, int flags, in int[] appIds);
41a084fcdcd052d71e8205a2eea0955911b99160b9Jeff Sharkey    long[] getExternalSize(@nullable @utf8InCpp String uuid, int userId, int flags, in int[] appIds);
42c1e93e7d746e07791b0667c80ad43a407c515fa8Jeff Sharkey
4388ddd94834dae9c5862a07a1e4432b171b2f5d9fJeff Sharkey    void setAppQuota(@nullable @utf8InCpp String uuid, int userId, int appId, long cacheQuota);
4488ddd94834dae9c5862a07a1e4432b171b2f5d9fJeff Sharkey
450274c977e3b10b52936fd5b2eb464857f0ca6358Jeff Sharkey    void moveCompleteApp(@nullable @utf8InCpp String fromUuid, @nullable @utf8InCpp String toUuid,
460274c977e3b10b52936fd5b2eb464857f0ca6358Jeff Sharkey            @utf8InCpp String packageName, @utf8InCpp String dataAppName, int appId,
470274c977e3b10b52936fd5b2eb464857f0ca6358Jeff Sharkey            @utf8InCpp String seInfo, int targetSdkVersion);
48475c6f9743e5f6696c38fb22b8b8e9d49a82ab56Jeff Sharkey
496c2c056193010cf93b4264810d462c120ce801c8Jeff Sharkey    void dexopt(@utf8InCpp String apkPath, int uid, @nullable @utf8InCpp String packageName,
506c2c056193010cf93b4264810d462c120ce801c8Jeff Sharkey            @utf8InCpp String instructionSet, int dexoptNeeded,
516c2c056193010cf93b4264810d462c120ce801c8Jeff Sharkey            @nullable @utf8InCpp String outputPath, int dexFlags,
526c2c056193010cf93b4264810d462c120ce801c8Jeff Sharkey            @utf8InCpp String compilerFilter, @nullable @utf8InCpp String uuid,
53cb556e340b50d16e8fac41b0c69d8d35bd7915f9Calin Juravle            @nullable @utf8InCpp String sharedLibraries,
54562de815339bedd29206f5f98be44c824945b627Calin Juravle            @nullable @utf8InCpp String seInfo, boolean downgrade, int targetSdkVersion,
55cc3b8aeff19f39afb8d4f2c198ee6cd2ec132d22Calin Juravle            @nullable @utf8InCpp String profileName,
56dcccd832b4a3df77bac551a118b2a35fd6f65d9bCalin Juravle            @nullable @utf8InCpp String dexMetadataPath,
57dcccd832b4a3df77bac551a118b2a35fd6f65d9bCalin Juravle            @nullable @utf8InCpp String compilationReason);
586c2c056193010cf93b4264810d462c120ce801c8Jeff Sharkey
59475c6f9743e5f6696c38fb22b8b8e9d49a82ab56Jeff Sharkey    void rmdex(@utf8InCpp String codePath, @utf8InCpp String instructionSet);
60475c6f9743e5f6696c38fb22b8b8e9d49a82ab56Jeff Sharkey
61562de815339bedd29206f5f98be44c824945b627Calin Juravle    boolean mergeProfiles(int uid, @utf8InCpp String packageName, @utf8InCpp String profileName);
62562de815339bedd29206f5f98be44c824945b627Calin Juravle    boolean dumpProfiles(int uid, @utf8InCpp String packageName, @utf8InCpp String  profileName,
63562de815339bedd29206f5f98be44c824945b627Calin Juravle            @utf8InCpp String codePath);
64f966f2a5af6cc2022a5af4edeb20cf4b5ede0d40Mathieu Chartier    boolean copySystemProfile(@utf8InCpp String systemProfile, int uid,
65562de815339bedd29206f5f98be44c824945b627Calin Juravle            @utf8InCpp String packageName, @utf8InCpp String profileName);
66562de815339bedd29206f5f98be44c824945b627Calin Juravle    void clearAppProfiles(@utf8InCpp String packageName, @utf8InCpp String profileName);
67475c6f9743e5f6696c38fb22b8b8e9d49a82ab56Jeff Sharkey    void destroyAppProfiles(@utf8InCpp String packageName);
68475c6f9743e5f6696c38fb22b8b8e9d49a82ab56Jeff Sharkey
69c41dac27c540971d8877911d6a3908af2046c9ebCalin Juravle    boolean createProfileSnapshot(int appId, @utf8InCpp String packageName,
70e61189e0ad2104360a188d36210bd1ee43803a64Calin Juravle            @utf8InCpp String profileName, @utf8InCpp String classpath);
71562de815339bedd29206f5f98be44c824945b627Calin Juravle    void destroyProfileSnapshot(@utf8InCpp String packageName, @utf8InCpp String profileName);
7229591736958a7ed45f4b5982ca9a46756baa0f6dCalin Juravle
73475c6f9743e5f6696c38fb22b8b8e9d49a82ab56Jeff Sharkey    void idmap(@utf8InCpp String targetApkPath, @utf8InCpp String overlayApkPath, int uid);
745c6944c35211accd783d2584fac6421dd0af5bddMårten Kongstad    void removeIdmap(@utf8InCpp String overlayApkPath);
75475c6f9743e5f6696c38fb22b8b8e9d49a82ab56Jeff Sharkey    void rmPackageDir(@utf8InCpp String packageDir);
76475c6f9743e5f6696c38fb22b8b8e9d49a82ab56Jeff Sharkey    void markBootComplete(@utf8InCpp String instructionSet);
7760f8a5330ca921d936ae306bf6d17596b82b518cJeff Sharkey    void freeCache(@nullable @utf8InCpp String uuid, long targetFreeBytes,
7860f8a5330ca921d936ae306bf6d17596b82b518cJeff Sharkey            long cacheReservedBytes, int flags);
79475c6f9743e5f6696c38fb22b8b8e9d49a82ab56Jeff Sharkey    void linkNativeLibraryDirectory(@nullable @utf8InCpp String uuid,
80475c6f9743e5f6696c38fb22b8b8e9d49a82ab56Jeff Sharkey            @utf8InCpp String packageName, @utf8InCpp String nativeLibPath32, int userId);
81475c6f9743e5f6696c38fb22b8b8e9d49a82ab56Jeff Sharkey    void createOatDir(@utf8InCpp String oatDir, @utf8InCpp String instructionSet);
82475c6f9743e5f6696c38fb22b8b8e9d49a82ab56Jeff Sharkey    void linkFile(@utf8InCpp String relativePath, @utf8InCpp String fromBase,
83475c6f9743e5f6696c38fb22b8b8e9d49a82ab56Jeff Sharkey            @utf8InCpp String toBase);
84475c6f9743e5f6696c38fb22b8b8e9d49a82ab56Jeff Sharkey    void moveAb(@utf8InCpp String apkPath, @utf8InCpp String instructionSet,
85475c6f9743e5f6696c38fb22b8b8e9d49a82ab56Jeff Sharkey            @utf8InCpp String outputPath);
86475c6f9743e5f6696c38fb22b8b8e9d49a82ab56Jeff Sharkey    void deleteOdex(@utf8InCpp String apkPath, @utf8InCpp String instructionSet,
87c523409f0fd03aa498cedc486f85e9a4b7257f3aAndreas Gampe            @nullable @utf8InCpp String outputPath);
8818ac0279c2ea52c72a539cae340502ca0dddcbc4Victor Hsieh    void installApkVerity(@utf8InCpp String filePath, in FileDescriptor verityInput,
8918ac0279c2ea52c72a539cae340502ca0dddcbc4Victor Hsieh            int contentSize);
90c6d738a320a612454e6c7588affcfb1f8886dd8cVictor Hsieh    void assertFsverityRootHashMatches(@utf8InCpp String filePath, in byte[] expectedHash);
9166b1a12e7a120f85042669bb58f1db864616b506Jeff Sharkey
92bd9683607d391a29b1422a50f8972267e9bddc47Calin Juravle    boolean reconcileSecondaryDexFile(@utf8InCpp String dexPath, @utf8InCpp String pkgName,
93bd9683607d391a29b1422a50f8972267e9bddc47Calin Juravle        int uid, in @utf8InCpp String[] isas, @nullable @utf8InCpp String volume_uuid,
94bd9683607d391a29b1422a50f8972267e9bddc47Calin Juravle        int storage_flag);
95bd9683607d391a29b1422a50f8972267e9bddc47Calin Juravle
96753dc71734927f86c277991be9326cb9a82202b1Alan Stokes    byte[] hashSecondaryDexFile(@utf8InCpp String dexPath, @utf8InCpp String pkgName,
97753dc71734927f86c277991be9326cb9a82202b1Alan Stokes        int uid, @nullable @utf8InCpp String volumeUuid, int storageFlag);
98753dc71734927f86c277991be9326cb9a82202b1Alan Stokes
9966b1a12e7a120f85042669bb58f1db864616b506Jeff Sharkey    void invalidateMounts();
100325b8c94a5ae47b7903ea5fe386a78466d6cb3b7Jeff Sharkey    boolean isQuotaSupported(@nullable @utf8InCpp String uuid);
101bc5ab878b56bcd3a300cc5fc0facc864421dfcb6Calin Juravle
102bc5ab878b56bcd3a300cc5fc0facc864421dfcb6Calin Juravle    boolean prepareAppProfile(@utf8InCpp String packageName,
103bc5ab878b56bcd3a300cc5fc0facc864421dfcb6Calin Juravle        int userId, int appId, @utf8InCpp String profileName, @utf8InCpp String codePath,
104bc5ab878b56bcd3a300cc5fc0facc864421dfcb6Calin Juravle        @nullable @utf8InCpp String dexMetadata);
1059087400f3c82b97aa17a74329c7e65c0a5ff4062Jeff Sharkey}
106