Jeff Sharkey | 9087400 | 2016-12-05 11:18:55 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package android.os; |
| 18 | |
Jeff Sharkey | 6c2c056 | 2016-12-07 12:12:00 -0700 | [diff] [blame] | 19 | /** {@hide} */ |
Jeff Sharkey | 9087400 | 2016-12-05 11:18:55 -0700 | [diff] [blame] | 20 | interface IInstalld { |
Jeff Sharkey | c1e93e7 | 2016-12-05 23:39:32 -0700 | [diff] [blame] | 21 | 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 Sharkey | 36a900a | 2016-12-19 16:39:18 -0700 | [diff] [blame] | 24 | long createAppData(@nullable @utf8InCpp String uuid, in @utf8InCpp String packageName, |
Jeff Sharkey | 0274c97 | 2016-12-06 09:32:04 -0700 | [diff] [blame] | 25 | int userId, int flags, int appId, in @utf8InCpp String seInfo, int targetSdkVersion); |
Ben Murdoch | 872d2af | 2020-04-15 12:46:23 +0100 | [diff] [blame] | 26 | long createAppDataBatched(in @nullable @utf8InCpp String[] uuids, |
| 27 | in @nullable @utf8InCpp String[] packageNames, in int userId, int flags, in int[] appIds, |
| 28 | in @utf8InCpp String[] seInfos, in int[] targetSdkVersions); |
Jeff Sharkey | c1e93e7 | 2016-12-05 23:39:32 -0700 | [diff] [blame] | 29 | void restoreconAppData(@nullable @utf8InCpp String uuid, @utf8InCpp String packageName, |
| 30 | int userId, int flags, int appId, @utf8InCpp String seInfo); |
| 31 | void migrateAppData(@nullable @utf8InCpp String uuid, @utf8InCpp String packageName, |
| 32 | int userId, int flags); |
| 33 | void clearAppData(@nullable @utf8InCpp String uuid, @utf8InCpp String packageName, |
| 34 | int userId, int flags, long ceDataInode); |
| 35 | void destroyAppData(@nullable @utf8InCpp String uuid, @utf8InCpp String packageName, |
| 36 | int userId, int flags, long ceDataInode); |
Jeff Sharkey | df2d754 | 2017-01-07 09:19:35 -0700 | [diff] [blame] | 37 | |
Jeff Sharkey | e12d596 | 2017-04-03 16:41:02 -0600 | [diff] [blame] | 38 | void fixupAppData(@nullable @utf8InCpp String uuid, int flags); |
| 39 | |
Jeff Sharkey | df2d754 | 2017-01-07 09:19:35 -0700 | [diff] [blame] | 40 | long[] getAppSize(@nullable @utf8InCpp String uuid, in @utf8InCpp String[] packageNames, |
| 41 | int userId, int flags, int appId, in long[] ceDataInodes, |
| 42 | in @utf8InCpp String[] codePaths); |
| 43 | long[] getUserSize(@nullable @utf8InCpp String uuid, int userId, int flags, in int[] appIds); |
Jeff Sharkey | a084fcd | 2017-04-17 16:44:41 -0600 | [diff] [blame] | 44 | long[] getExternalSize(@nullable @utf8InCpp String uuid, int userId, int flags, in int[] appIds); |
Jeff Sharkey | c1e93e7 | 2016-12-05 23:39:32 -0700 | [diff] [blame] | 45 | |
Felka Chang | 2a0a246 | 2019-11-20 14:20:40 +0800 | [diff] [blame] | 46 | @nullable |
| 47 | android.os.storage.CrateMetadata[] getAppCrates( |
| 48 | @nullable @utf8InCpp String uuid, in @utf8InCpp String[] packageNames, |
| 49 | int userId); |
| 50 | @nullable |
| 51 | android.os.storage.CrateMetadata[] getUserCrates( |
| 52 | @nullable @utf8InCpp String uuid, int userId); |
| 53 | |
Jeff Sharkey | 88ddd94 | 2017-01-17 18:05:54 -0700 | [diff] [blame] | 54 | void setAppQuota(@nullable @utf8InCpp String uuid, int userId, int appId, long cacheQuota); |
| 55 | |
Jeff Sharkey | 0274c97 | 2016-12-06 09:32:04 -0700 | [diff] [blame] | 56 | void moveCompleteApp(@nullable @utf8InCpp String fromUuid, @nullable @utf8InCpp String toUuid, |
Songchun Fan | dc2083f | 2020-02-18 17:45:46 -0800 | [diff] [blame] | 57 | @utf8InCpp String packageName, int appId, |
Songchun Fan | aed3337 | 2020-02-05 12:02:22 -0800 | [diff] [blame] | 58 | @utf8InCpp String seInfo, int targetSdkVersion, @utf8InCpp String fromCodePath); |
Jeff Sharkey | 475c6f9 | 2016-12-07 10:37:27 -0700 | [diff] [blame] | 59 | |
Jeff Sharkey | 6c2c056 | 2016-12-07 12:12:00 -0700 | [diff] [blame] | 60 | void dexopt(@utf8InCpp String apkPath, int uid, @nullable @utf8InCpp String packageName, |
| 61 | @utf8InCpp String instructionSet, int dexoptNeeded, |
| 62 | @nullable @utf8InCpp String outputPath, int dexFlags, |
| 63 | @utf8InCpp String compilerFilter, @nullable @utf8InCpp String uuid, |
Calin Juravle | cb556e3 | 2017-04-04 20:22:50 -0700 | [diff] [blame] | 64 | @nullable @utf8InCpp String sharedLibraries, |
Calin Juravle | 562de81 | 2018-01-20 23:34:18 -0800 | [diff] [blame] | 65 | @nullable @utf8InCpp String seInfo, boolean downgrade, int targetSdkVersion, |
Calin Juravle | cc3b8ae | 2018-02-01 17:03:23 +0000 | [diff] [blame] | 66 | @nullable @utf8InCpp String profileName, |
Calin Juravle | dcccd83 | 2018-02-13 18:31:32 -0800 | [diff] [blame] | 67 | @nullable @utf8InCpp String dexMetadataPath, |
| 68 | @nullable @utf8InCpp String compilationReason); |
Eric Holk | 0ebbe0f | 2019-01-09 18:17:27 -0800 | [diff] [blame] | 69 | boolean compileLayouts(@utf8InCpp String apkPath, @utf8InCpp String packageName, |
| 70 | @utf8InCpp String outDexFile, int uid); |
Jeff Sharkey | 6c2c056 | 2016-12-07 12:12:00 -0700 | [diff] [blame] | 71 | |
Jeff Sharkey | 475c6f9 | 2016-12-07 10:37:27 -0700 | [diff] [blame] | 72 | void rmdex(@utf8InCpp String codePath, @utf8InCpp String instructionSet); |
| 73 | |
Calin Juravle | 562de81 | 2018-01-20 23:34:18 -0800 | [diff] [blame] | 74 | boolean mergeProfiles(int uid, @utf8InCpp String packageName, @utf8InCpp String profileName); |
| 75 | boolean dumpProfiles(int uid, @utf8InCpp String packageName, @utf8InCpp String profileName, |
| 76 | @utf8InCpp String codePath); |
Mathieu Chartier | f966f2a | 2017-05-10 12:48:37 -0700 | [diff] [blame] | 77 | boolean copySystemProfile(@utf8InCpp String systemProfile, int uid, |
Calin Juravle | 562de81 | 2018-01-20 23:34:18 -0800 | [diff] [blame] | 78 | @utf8InCpp String packageName, @utf8InCpp String profileName); |
| 79 | void clearAppProfiles(@utf8InCpp String packageName, @utf8InCpp String profileName); |
Jeff Sharkey | 475c6f9 | 2016-12-07 10:37:27 -0700 | [diff] [blame] | 80 | void destroyAppProfiles(@utf8InCpp String packageName); |
| 81 | |
Calin Juravle | c41dac2 | 2017-12-05 12:29:15 -0800 | [diff] [blame] | 82 | boolean createProfileSnapshot(int appId, @utf8InCpp String packageName, |
Calin Juravle | e61189e | 2018-01-23 19:54:11 -0800 | [diff] [blame] | 83 | @utf8InCpp String profileName, @utf8InCpp String classpath); |
Calin Juravle | 562de81 | 2018-01-20 23:34:18 -0800 | [diff] [blame] | 84 | void destroyProfileSnapshot(@utf8InCpp String packageName, @utf8InCpp String profileName); |
Calin Juravle | 2959173 | 2017-11-20 17:46:19 -0800 | [diff] [blame] | 85 | |
Jeff Sharkey | 475c6f9 | 2016-12-07 10:37:27 -0700 | [diff] [blame] | 86 | void rmPackageDir(@utf8InCpp String packageDir); |
Jeff Sharkey | 60f8a53 | 2017-05-30 14:38:42 -0600 | [diff] [blame] | 87 | void freeCache(@nullable @utf8InCpp String uuid, long targetFreeBytes, |
| 88 | long cacheReservedBytes, int flags); |
Jeff Sharkey | 475c6f9 | 2016-12-07 10:37:27 -0700 | [diff] [blame] | 89 | void linkNativeLibraryDirectory(@nullable @utf8InCpp String uuid, |
| 90 | @utf8InCpp String packageName, @utf8InCpp String nativeLibPath32, int userId); |
| 91 | void createOatDir(@utf8InCpp String oatDir, @utf8InCpp String instructionSet); |
| 92 | void linkFile(@utf8InCpp String relativePath, @utf8InCpp String fromBase, |
| 93 | @utf8InCpp String toBase); |
| 94 | void moveAb(@utf8InCpp String apkPath, @utf8InCpp String instructionSet, |
| 95 | @utf8InCpp String outputPath); |
| 96 | void deleteOdex(@utf8InCpp String apkPath, @utf8InCpp String instructionSet, |
Andreas Gampe | c523409 | 2017-05-31 16:39:58 -0700 | [diff] [blame] | 97 | @nullable @utf8InCpp String outputPath); |
Victor Hsieh | 18ac027 | 2018-03-12 16:03:02 -0700 | [diff] [blame] | 98 | void installApkVerity(@utf8InCpp String filePath, in FileDescriptor verityInput, |
| 99 | int contentSize); |
Victor Hsieh | c6d738a | 2018-01-20 15:06:39 -0800 | [diff] [blame] | 100 | void assertFsverityRootHashMatches(@utf8InCpp String filePath, in byte[] expectedHash); |
Jeff Sharkey | 66b1a12 | 2017-01-16 20:57:45 -0700 | [diff] [blame] | 101 | |
Calin Juravle | bd96836 | 2017-01-25 01:17:17 -0800 | [diff] [blame] | 102 | boolean reconcileSecondaryDexFile(@utf8InCpp String dexPath, @utf8InCpp String pkgName, |
| 103 | int uid, in @utf8InCpp String[] isas, @nullable @utf8InCpp String volume_uuid, |
| 104 | int storage_flag); |
| 105 | |
Alan Stokes | 753dc71 | 2017-10-16 10:56:00 +0100 | [diff] [blame] | 106 | byte[] hashSecondaryDexFile(@utf8InCpp String dexPath, @utf8InCpp String pkgName, |
| 107 | int uid, @nullable @utf8InCpp String volumeUuid, int storageFlag); |
| 108 | |
Jeff Sharkey | 66b1a12 | 2017-01-16 20:57:45 -0700 | [diff] [blame] | 109 | void invalidateMounts(); |
Jeff Sharkey | 325b8c9 | 2017-02-21 10:00:53 -0700 | [diff] [blame] | 110 | boolean isQuotaSupported(@nullable @utf8InCpp String uuid); |
Calin Juravle | bc5ab87 | 2018-01-18 22:32:58 -0800 | [diff] [blame] | 111 | |
| 112 | boolean prepareAppProfile(@utf8InCpp String packageName, |
| 113 | int userId, int appId, @utf8InCpp String profileName, @utf8InCpp String codePath, |
| 114 | @nullable @utf8InCpp String dexMetadata); |
Jeff Sharkey | 5cb0b1a | 2018-08-24 17:25:50 -0600 | [diff] [blame] | 115 | |
Nikita Ioffe | 77be2ed | 2019-01-25 13:54:43 +0000 | [diff] [blame] | 116 | long snapshotAppData(@nullable @utf8InCpp String uuid, in @utf8InCpp String packageName, |
Nikita Ioffe | b68f0d1 | 2019-02-04 11:06:37 +0000 | [diff] [blame] | 117 | int userId, int snapshotId, int storageFlags); |
Narayan Kamath | e63ca7d | 2019-01-14 15:21:52 +0000 | [diff] [blame] | 118 | void restoreAppDataSnapshot(@nullable @utf8InCpp String uuid, in @utf8InCpp String packageName, |
Nikita Ioffe | b68f0d1 | 2019-02-04 11:06:37 +0000 | [diff] [blame] | 119 | int appId, @utf8InCpp String seInfo, int user, int snapshotId, int storageflags); |
Nikita Ioffe | 77be2ed | 2019-01-25 13:54:43 +0000 | [diff] [blame] | 120 | void destroyAppDataSnapshot(@nullable @utf8InCpp String uuid, @utf8InCpp String packageName, |
Nikita Ioffe | b68f0d1 | 2019-02-04 11:06:37 +0000 | [diff] [blame] | 121 | int userId, long ceSnapshotInode, int snapshotId, int storageFlags); |
Oli Lan | 2383962 | 2020-03-16 18:18:41 +0000 | [diff] [blame] | 122 | void destroyCeSnapshotsNotSpecified(@nullable @utf8InCpp String uuid, int userId, |
| 123 | in int[] retainSnapshotIds); |
| 124 | |
Ricky Wai | 2a4983f | 2020-02-07 14:25:45 +0000 | [diff] [blame] | 125 | void tryMountDataMirror(@nullable @utf8InCpp String volumeUuid); |
Ricky Wai | ff9d3ea | 2019-11-18 18:18:24 +0000 | [diff] [blame] | 126 | void onPrivateVolumeRemoved(@nullable @utf8InCpp String volumeUuid); |
Narayan Kamath | e63ca7d | 2019-01-14 15:21:52 +0000 | [diff] [blame] | 127 | |
Narayan Kamath | 28ab93b | 2019-05-15 18:29:44 +0100 | [diff] [blame] | 128 | void migrateLegacyObbData(); |
| 129 | |
Jeff Sharkey | 5cb0b1a | 2018-08-24 17:25:50 -0600 | [diff] [blame] | 130 | const int FLAG_STORAGE_DE = 0x1; |
| 131 | const int FLAG_STORAGE_CE = 0x2; |
Jeff Sharkey | 6e17569 | 2019-05-14 14:55:33 -0600 | [diff] [blame] | 132 | const int FLAG_STORAGE_EXTERNAL = 0x4; |
Jeff Sharkey | 5cb0b1a | 2018-08-24 17:25:50 -0600 | [diff] [blame] | 133 | |
| 134 | const int FLAG_CLEAR_CACHE_ONLY = 0x10; |
| 135 | const int FLAG_CLEAR_CODE_CACHE_ONLY = 0x20; |
| 136 | |
| 137 | const int FLAG_FREE_CACHE_V2 = 0x100; |
| 138 | const int FLAG_FREE_CACHE_V2_DEFY_QUOTA = 0x200; |
| 139 | const int FLAG_FREE_CACHE_NOOP = 0x400; |
| 140 | |
| 141 | const int FLAG_USE_QUOTA = 0x1000; |
| 142 | const int FLAG_FORCE = 0x2000; |
Calin Juravle | e8ef7b0 | 2019-06-17 17:22:19 -0700 | [diff] [blame] | 143 | |
| 144 | const int FLAG_CLEAR_APP_DATA_KEEP_ART_PROFILES = 0x20000; |
Jeff Sharkey | 9087400 | 2016-12-05 11:18:55 -0700 | [diff] [blame] | 145 | } |