blob: 5e5af736247dd2b88502fd3c1b368629ab479798 [file] [log] [blame]
Jeff Sharkey90874002016-12-05 11:18:55 -07001/*
2 * Copyright (C) 2016 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
17package android.os;
18
Jeff Sharkey6c2c0562016-12-07 12:12:00 -070019/** {@hide} */
Jeff Sharkey90874002016-12-05 11:18:55 -070020interface IInstalld {
Jeff Sharkeyc1e93e72016-12-05 23:39:32 -070021 void createUserData(@nullable @utf8InCpp String uuid, int userId, int userSerial, int flags);
22 void destroyUserData(@nullable @utf8InCpp String uuid, int userId, int flags);
23
Jeff Sharkey36a900a2016-12-19 16:39:18 -070024 long createAppData(@nullable @utf8InCpp String uuid, in @utf8InCpp String packageName,
Jeff Sharkey0274c972016-12-06 09:32:04 -070025 int userId, int flags, int appId, in @utf8InCpp String seInfo, int targetSdkVersion);
Jeff Sharkeyc1e93e72016-12-05 23:39:32 -070026 void restoreconAppData(@nullable @utf8InCpp String uuid, @utf8InCpp String packageName,
27 int userId, int flags, int appId, @utf8InCpp String seInfo);
28 void migrateAppData(@nullable @utf8InCpp String uuid, @utf8InCpp String packageName,
29 int userId, int flags);
30 void clearAppData(@nullable @utf8InCpp String uuid, @utf8InCpp String packageName,
31 int userId, int flags, long ceDataInode);
32 void destroyAppData(@nullable @utf8InCpp String uuid, @utf8InCpp String packageName,
33 int userId, int flags, long ceDataInode);
Jeff Sharkeydf2d7542017-01-07 09:19:35 -070034
Jeff Sharkeye12d5962017-04-03 16:41:02 -060035 void fixupAppData(@nullable @utf8InCpp String uuid, int flags);
36
Jeff Sharkeydf2d7542017-01-07 09:19:35 -070037 long[] getAppSize(@nullable @utf8InCpp String uuid, in @utf8InCpp String[] packageNames,
38 int userId, int flags, int appId, in long[] ceDataInodes,
39 in @utf8InCpp String[] codePaths);
40 long[] getUserSize(@nullable @utf8InCpp String uuid, int userId, int flags, in int[] appIds);
Jeff Sharkeya084fcd2017-04-17 16:44:41 -060041 long[] getExternalSize(@nullable @utf8InCpp String uuid, int userId, int flags, in int[] appIds);
Jeff Sharkeyc1e93e72016-12-05 23:39:32 -070042
Felka Chang2a0a2462019-11-20 14:20:40 +080043 @nullable
44 android.os.storage.CrateMetadata[] getAppCrates(
45 @nullable @utf8InCpp String uuid, in @utf8InCpp String[] packageNames,
46 int userId);
47 @nullable
48 android.os.storage.CrateMetadata[] getUserCrates(
49 @nullable @utf8InCpp String uuid, int userId);
50
Jeff Sharkey88ddd942017-01-17 18:05:54 -070051 void setAppQuota(@nullable @utf8InCpp String uuid, int userId, int appId, long cacheQuota);
52
Jeff Sharkey0274c972016-12-06 09:32:04 -070053 void moveCompleteApp(@nullable @utf8InCpp String fromUuid, @nullable @utf8InCpp String toUuid,
Songchun Fandc2083f2020-02-18 17:45:46 -080054 @utf8InCpp String packageName, int appId,
Songchun Fanaed33372020-02-05 12:02:22 -080055 @utf8InCpp String seInfo, int targetSdkVersion, @utf8InCpp String fromCodePath);
Jeff Sharkey475c6f92016-12-07 10:37:27 -070056
Jeff Sharkey6c2c0562016-12-07 12:12:00 -070057 void dexopt(@utf8InCpp String apkPath, int uid, @nullable @utf8InCpp String packageName,
58 @utf8InCpp String instructionSet, int dexoptNeeded,
59 @nullable @utf8InCpp String outputPath, int dexFlags,
60 @utf8InCpp String compilerFilter, @nullable @utf8InCpp String uuid,
Calin Juravlecb556e32017-04-04 20:22:50 -070061 @nullable @utf8InCpp String sharedLibraries,
Calin Juravle562de812018-01-20 23:34:18 -080062 @nullable @utf8InCpp String seInfo, boolean downgrade, int targetSdkVersion,
Calin Juravlecc3b8ae2018-02-01 17:03:23 +000063 @nullable @utf8InCpp String profileName,
Calin Juravledcccd832018-02-13 18:31:32 -080064 @nullable @utf8InCpp String dexMetadataPath,
65 @nullable @utf8InCpp String compilationReason);
Eric Holk0ebbe0f2019-01-09 18:17:27 -080066 boolean compileLayouts(@utf8InCpp String apkPath, @utf8InCpp String packageName,
67 @utf8InCpp String outDexFile, int uid);
Jeff Sharkey6c2c0562016-12-07 12:12:00 -070068
Jeff Sharkey475c6f92016-12-07 10:37:27 -070069 void rmdex(@utf8InCpp String codePath, @utf8InCpp String instructionSet);
70
Calin Juravle562de812018-01-20 23:34:18 -080071 boolean mergeProfiles(int uid, @utf8InCpp String packageName, @utf8InCpp String profileName);
72 boolean dumpProfiles(int uid, @utf8InCpp String packageName, @utf8InCpp String profileName,
73 @utf8InCpp String codePath);
Mathieu Chartierf966f2a2017-05-10 12:48:37 -070074 boolean copySystemProfile(@utf8InCpp String systemProfile, int uid,
Calin Juravle562de812018-01-20 23:34:18 -080075 @utf8InCpp String packageName, @utf8InCpp String profileName);
76 void clearAppProfiles(@utf8InCpp String packageName, @utf8InCpp String profileName);
Jeff Sharkey475c6f92016-12-07 10:37:27 -070077 void destroyAppProfiles(@utf8InCpp String packageName);
78
Calin Juravlec41dac22017-12-05 12:29:15 -080079 boolean createProfileSnapshot(int appId, @utf8InCpp String packageName,
Calin Juravlee61189e2018-01-23 19:54:11 -080080 @utf8InCpp String profileName, @utf8InCpp String classpath);
Calin Juravle562de812018-01-20 23:34:18 -080081 void destroyProfileSnapshot(@utf8InCpp String packageName, @utf8InCpp String profileName);
Calin Juravle29591732017-11-20 17:46:19 -080082
Jeff Sharkey475c6f92016-12-07 10:37:27 -070083 void rmPackageDir(@utf8InCpp String packageDir);
Jeff Sharkey60f8a532017-05-30 14:38:42 -060084 void freeCache(@nullable @utf8InCpp String uuid, long targetFreeBytes,
85 long cacheReservedBytes, int flags);
Jeff Sharkey475c6f92016-12-07 10:37:27 -070086 void linkNativeLibraryDirectory(@nullable @utf8InCpp String uuid,
87 @utf8InCpp String packageName, @utf8InCpp String nativeLibPath32, int userId);
88 void createOatDir(@utf8InCpp String oatDir, @utf8InCpp String instructionSet);
89 void linkFile(@utf8InCpp String relativePath, @utf8InCpp String fromBase,
90 @utf8InCpp String toBase);
91 void moveAb(@utf8InCpp String apkPath, @utf8InCpp String instructionSet,
92 @utf8InCpp String outputPath);
93 void deleteOdex(@utf8InCpp String apkPath, @utf8InCpp String instructionSet,
Andreas Gampec5234092017-05-31 16:39:58 -070094 @nullable @utf8InCpp String outputPath);
Victor Hsieh18ac0272018-03-12 16:03:02 -070095 void installApkVerity(@utf8InCpp String filePath, in FileDescriptor verityInput,
96 int contentSize);
Victor Hsiehc6d738a2018-01-20 15:06:39 -080097 void assertFsverityRootHashMatches(@utf8InCpp String filePath, in byte[] expectedHash);
Jeff Sharkey66b1a122017-01-16 20:57:45 -070098
Calin Juravlebd968362017-01-25 01:17:17 -080099 boolean reconcileSecondaryDexFile(@utf8InCpp String dexPath, @utf8InCpp String pkgName,
100 int uid, in @utf8InCpp String[] isas, @nullable @utf8InCpp String volume_uuid,
101 int storage_flag);
102
Alan Stokes753dc712017-10-16 10:56:00 +0100103 byte[] hashSecondaryDexFile(@utf8InCpp String dexPath, @utf8InCpp String pkgName,
104 int uid, @nullable @utf8InCpp String volumeUuid, int storageFlag);
105
Jeff Sharkey66b1a122017-01-16 20:57:45 -0700106 void invalidateMounts();
Jeff Sharkey325b8c92017-02-21 10:00:53 -0700107 boolean isQuotaSupported(@nullable @utf8InCpp String uuid);
Calin Juravlebc5ab872018-01-18 22:32:58 -0800108
109 boolean prepareAppProfile(@utf8InCpp String packageName,
110 int userId, int appId, @utf8InCpp String profileName, @utf8InCpp String codePath,
111 @nullable @utf8InCpp String dexMetadata);
Jeff Sharkey5cb0b1a2018-08-24 17:25:50 -0600112
Nikita Ioffe77be2ed2019-01-25 13:54:43 +0000113 long snapshotAppData(@nullable @utf8InCpp String uuid, in @utf8InCpp String packageName,
Nikita Ioffeb68f0d12019-02-04 11:06:37 +0000114 int userId, int snapshotId, int storageFlags);
Narayan Kamathe63ca7d2019-01-14 15:21:52 +0000115 void restoreAppDataSnapshot(@nullable @utf8InCpp String uuid, in @utf8InCpp String packageName,
Nikita Ioffeb68f0d12019-02-04 11:06:37 +0000116 int appId, @utf8InCpp String seInfo, int user, int snapshotId, int storageflags);
Nikita Ioffe77be2ed2019-01-25 13:54:43 +0000117 void destroyAppDataSnapshot(@nullable @utf8InCpp String uuid, @utf8InCpp String packageName,
Nikita Ioffeb68f0d12019-02-04 11:06:37 +0000118 int userId, long ceSnapshotInode, int snapshotId, int storageFlags);
Oli Lan23839622020-03-16 18:18:41 +0000119 void destroyCeSnapshotsNotSpecified(@nullable @utf8InCpp String uuid, int userId,
120 in int[] retainSnapshotIds);
121
Ricky Wai2a4983f2020-02-07 14:25:45 +0000122 void tryMountDataMirror(@nullable @utf8InCpp String volumeUuid);
Ricky Waiff9d3ea2019-11-18 18:18:24 +0000123 void onPrivateVolumeRemoved(@nullable @utf8InCpp String volumeUuid);
Narayan Kamathe63ca7d2019-01-14 15:21:52 +0000124
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100125 void migrateLegacyObbData();
126
Jeff Sharkey5cb0b1a2018-08-24 17:25:50 -0600127 const int FLAG_STORAGE_DE = 0x1;
128 const int FLAG_STORAGE_CE = 0x2;
Jeff Sharkey6e175692019-05-14 14:55:33 -0600129 const int FLAG_STORAGE_EXTERNAL = 0x4;
Jeff Sharkey5cb0b1a2018-08-24 17:25:50 -0600130
131 const int FLAG_CLEAR_CACHE_ONLY = 0x10;
132 const int FLAG_CLEAR_CODE_CACHE_ONLY = 0x20;
133
134 const int FLAG_FREE_CACHE_V2 = 0x100;
135 const int FLAG_FREE_CACHE_V2_DEFY_QUOTA = 0x200;
136 const int FLAG_FREE_CACHE_NOOP = 0x400;
137
138 const int FLAG_USE_QUOTA = 0x1000;
139 const int FLAG_FORCE = 0x2000;
Calin Juravlee8ef7b02019-06-17 17:22:19 -0700140
141 const int FLAG_CLEAR_APP_DATA_KEEP_ART_PROFILES = 0x20000;
Jeff Sharkey90874002016-12-05 11:18:55 -0700142}