| Andreas Gampe | 02d0de5 | 2015-11-11 20:43:16 -0800 | [diff] [blame] | 1 | /* | 
 | 2 | ** | 
 | 3 | ** Copyright 2008, The Android Open Source Project | 
 | 4 | ** | 
| Jeff Sharkey | f3e30b9 | 2016-12-09 17:06:57 -0700 | [diff] [blame] | 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); | 
 | 6 | ** you may not use this file except in compliance with the License. | 
 | 7 | ** You may obtain a copy of the License at | 
| Andreas Gampe | 02d0de5 | 2015-11-11 20:43:16 -0800 | [diff] [blame] | 8 | ** | 
| Jeff Sharkey | f3e30b9 | 2016-12-09 17:06:57 -0700 | [diff] [blame] | 9 | **     http://www.apache.org/licenses/LICENSE-2.0 | 
| Andreas Gampe | 02d0de5 | 2015-11-11 20:43:16 -0800 | [diff] [blame] | 10 | ** | 
| Jeff Sharkey | f3e30b9 | 2016-12-09 17:06:57 -0700 | [diff] [blame] | 11 | ** Unless required by applicable law or agreed to in writing, software | 
 | 12 | ** distributed under the License is distributed on an "AS IS" BASIS, | 
 | 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
 | 14 | ** See the License for the specific language governing permissions and | 
| Andreas Gampe | 02d0de5 | 2015-11-11 20:43:16 -0800 | [diff] [blame] | 15 | ** limitations under the License. | 
 | 16 | */ | 
 | 17 |  | 
 | 18 | #ifndef COMMANDS_H_ | 
 | 19 | #define COMMANDS_H_ | 
 | 20 |  | 
 | 21 | #include <inttypes.h> | 
| Victor Hsieh | c7ab564 | 2023-07-28 15:07:55 -0700 | [diff] [blame] | 22 | #include <sys/stat.h> | 
| Andreas Gampe | 02d0de5 | 2015-11-11 20:43:16 -0800 | [diff] [blame] | 23 | #include <unistd.h> | 
 | 24 |  | 
| Alex Buynytskyy | fcd5bf3 | 2021-11-23 11:31:34 -0800 | [diff] [blame] | 25 | #include <shared_mutex> | 
| Jeff Sharkey | 66b1a12 | 2017-01-16 20:57:45 -0700 | [diff] [blame] | 26 | #include <unordered_map> | 
| Alex Buynytskyy | fcd5bf3 | 2021-11-23 11:31:34 -0800 | [diff] [blame] | 27 | #include <vector> | 
| Jeff Sharkey | 0274c97 | 2016-12-06 09:32:04 -0700 | [diff] [blame] | 28 |  | 
| Jeff Sharkey | 88ddd94 | 2017-01-17 18:05:54 -0700 | [diff] [blame] | 29 | #include <android-base/macros.h> | 
| Jeff Sharkey | 0274c97 | 2016-12-06 09:32:04 -0700 | [diff] [blame] | 30 | #include <binder/BinderService.h> | 
| Andreas Gampe | 02d0de5 | 2015-11-11 20:43:16 -0800 | [diff] [blame] | 31 | #include <cutils/multiuser.h> | 
 | 32 |  | 
| Jeff Sharkey | 0274c97 | 2016-12-06 09:32:04 -0700 | [diff] [blame] | 33 | #include "android/os/BnInstalld.h" | 
 | 34 | #include "installd_constants.h" | 
| Andreas Gampe | 02d0de5 | 2015-11-11 20:43:16 -0800 | [diff] [blame] | 35 |  | 
 | 36 | namespace android { | 
 | 37 | namespace installd { | 
 | 38 |  | 
| Victor Hsieh | c7ab564 | 2023-07-28 15:07:55 -0700 | [diff] [blame] | 39 | using IFsveritySetupAuthToken = android::os::IInstalld::IFsveritySetupAuthToken; | 
 | 40 |  | 
| Jeff Sharkey | 0274c97 | 2016-12-06 09:32:04 -0700 | [diff] [blame] | 41 | class InstalldNativeService : public BinderService<InstalldNativeService>, public os::BnInstalld { | 
 | 42 | public: | 
| Victor Hsieh | c7ab564 | 2023-07-28 15:07:55 -0700 | [diff] [blame] | 43 |     class FsveritySetupAuthToken : public os::IInstalld::BnFsveritySetupAuthToken { | 
 | 44 |     public: | 
 | 45 |         FsveritySetupAuthToken() : mStatFromAuthFd() {} | 
 | 46 |  | 
 | 47 |         binder::Status authenticate(const android::os::ParcelFileDescriptor& authFd, int32_t appUid, | 
 | 48 |                                     int32_t userId); | 
 | 49 |         bool isSameStat(const struct stat& st) const; | 
 | 50 |  | 
 | 51 |     private: | 
 | 52 |         // Not copyable or movable | 
 | 53 |         FsveritySetupAuthToken(const FsveritySetupAuthToken&) = delete; | 
 | 54 |         FsveritySetupAuthToken& operator=(const FsveritySetupAuthToken&) = delete; | 
 | 55 |  | 
 | 56 |         struct stat mStatFromAuthFd; | 
 | 57 |     }; | 
 | 58 |  | 
| Jeff Sharkey | 0274c97 | 2016-12-06 09:32:04 -0700 | [diff] [blame] | 59 |     static status_t start(); | 
 | 60 |     static char const* getServiceName() { return "installd"; } | 
 | 61 |     virtual status_t dump(int fd, const Vector<String16> &args) override; | 
| Andreas Gampe | d089ca1 | 2016-06-27 14:25:30 -0700 | [diff] [blame] | 62 |  | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 63 |     binder::Status createUserData(const std::optional<std::string>& uuid, int32_t userId, | 
| Jeff Sharkey | c1e93e7 | 2016-12-05 23:39:32 -0700 | [diff] [blame] | 64 |             int32_t userSerial, int32_t flags); | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 65 |     binder::Status destroyUserData(const std::optional<std::string>& uuid, int32_t userId, | 
| Jeff Sharkey | c1e93e7 | 2016-12-05 23:39:32 -0700 | [diff] [blame] | 66 |             int32_t flags); | 
| Jeff Sharkey | 8d3848b | 2020-08-13 14:16:46 -0600 | [diff] [blame] | 67 |  | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 68 |     binder::Status createAppData(const std::optional<std::string>& uuid, | 
| Samiul Islam | c40dff5 | 2022-01-14 16:24:48 +0000 | [diff] [blame] | 69 |                                  const std::string& packageName, int32_t userId, int32_t flags, | 
 | 70 |                                  int32_t appId, int32_t previousAppId, const std::string& seInfo, | 
| Songchun Fan | cb567f9 | 2023-09-11 17:04:47 +0000 | [diff] [blame] | 71 |                                  int32_t targetSdkVersion, int64_t* ceDataInode, | 
 | 72 |                                  int64_t* deDataInode); | 
| Jeff Sharkey | 8d3848b | 2020-08-13 14:16:46 -0600 | [diff] [blame] | 73 |  | 
 | 74 |     binder::Status createAppData( | 
 | 75 |             const android::os::CreateAppDataArgs& args, | 
 | 76 |             android::os::CreateAppDataResult* _aidl_return); | 
 | 77 |     binder::Status createAppDataBatched( | 
 | 78 |             const std::vector<android::os::CreateAppDataArgs>& args, | 
 | 79 |             std::vector<android::os::CreateAppDataResult>* _aidl_return); | 
 | 80 |  | 
| Samiul Islam | 92f5cf0 | 2022-02-03 12:45:51 +0000 | [diff] [blame] | 81 |     binder::Status reconcileSdkData(const android::os::ReconcileSdkDataArgs& args); | 
 | 82 |  | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 83 |     binder::Status restoreconAppData(const std::optional<std::string>& uuid, | 
| Jeff Sharkey | c1e93e7 | 2016-12-05 23:39:32 -0700 | [diff] [blame] | 84 |             const std::string& packageName, int32_t userId, int32_t flags, int32_t appId, | 
 | 85 |             const std::string& seInfo); | 
| Mohammad Samiul Islam | e7634ba | 2022-03-07 20:27:30 +0000 | [diff] [blame] | 86 |  | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 87 |     binder::Status migrateAppData(const std::optional<std::string>& uuid, | 
| Jeff Sharkey | c1e93e7 | 2016-12-05 23:39:32 -0700 | [diff] [blame] | 88 |             const std::string& packageName, int32_t userId, int32_t flags); | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 89 |     binder::Status clearAppData(const std::optional<std::string>& uuid, | 
| Jeff Sharkey | c1e93e7 | 2016-12-05 23:39:32 -0700 | [diff] [blame] | 90 |             const std::string& packageName, int32_t userId, int32_t flags, int64_t ceDataInode); | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 91 |     binder::Status destroyAppData(const std::optional<std::string>& uuid, | 
| Jeff Sharkey | c1e93e7 | 2016-12-05 23:39:32 -0700 | [diff] [blame] | 92 |             const std::string& packageName, int32_t userId, int32_t flags, int64_t ceDataInode); | 
| Jeff Sharkey | df2d754 | 2017-01-07 09:19:35 -0700 | [diff] [blame] | 93 |  | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 94 |     binder::Status fixupAppData(const std::optional<std::string>& uuid, int32_t flags); | 
| Jeff Sharkey | e12d596 | 2017-04-03 16:41:02 -0600 | [diff] [blame] | 95 |  | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 96 |     binder::Status snapshotAppData(const std::optional<std::string>& volumeUuid, | 
| Nikita Ioffe | b68f0d1 | 2019-02-04 11:06:37 +0000 | [diff] [blame] | 97 |             const std::string& packageName, const int32_t user, const int32_t snapshotId, | 
 | 98 |             int32_t storageFlags, int64_t* _aidl_return); | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 99 |     binder::Status restoreAppDataSnapshot(const std::optional<std::string>& volumeUuid, | 
| Nikita Ioffe | b68f0d1 | 2019-02-04 11:06:37 +0000 | [diff] [blame] | 100 |             const std::string& packageName, const int32_t appId, const std::string& seInfo, | 
 | 101 |             const int32_t user, const int32_t snapshotId, int32_t storageFlags); | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 102 |     binder::Status destroyAppDataSnapshot(const std::optional<std::string> &volumeUuid, | 
| Nikita Ioffe | 77be2ed | 2019-01-25 13:54:43 +0000 | [diff] [blame] | 103 |             const std::string& packageName, const int32_t user, const int64_t ceSnapshotInode, | 
| Nikita Ioffe | b68f0d1 | 2019-02-04 11:06:37 +0000 | [diff] [blame] | 104 |             const int32_t snapshotId, int32_t storageFlags); | 
| Oli Lan | 035abbb | 2020-03-16 18:18:41 +0000 | [diff] [blame] | 105 |     binder::Status destroyCeSnapshotsNotSpecified(const std::optional<std::string> &volumeUuid, | 
 | 106 |             const int32_t user, const std::vector<int32_t>& retainSnapshotIds); | 
| Narayan Kamath | e63ca7d | 2019-01-14 15:21:52 +0000 | [diff] [blame] | 107 |  | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 108 |     binder::Status getAppSize(const std::optional<std::string>& uuid, | 
| Jeff Sharkey | df2d754 | 2017-01-07 09:19:35 -0700 | [diff] [blame] | 109 |             const std::vector<std::string>& packageNames, int32_t userId, int32_t flags, | 
 | 110 |             int32_t appId, const std::vector<int64_t>& ceDataInodes, | 
 | 111 |             const std::vector<std::string>& codePaths, std::vector<int64_t>* _aidl_return); | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 112 |     binder::Status getUserSize(const std::optional<std::string>& uuid, | 
| Jeff Sharkey | df2d754 | 2017-01-07 09:19:35 -0700 | [diff] [blame] | 113 |             int32_t userId, int32_t flags, const std::vector<int32_t>& appIds, | 
 | 114 |             std::vector<int64_t>* _aidl_return); | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 115 |     binder::Status getExternalSize(const std::optional<std::string>& uuid, | 
| Jeff Sharkey | a084fcd | 2017-04-17 16:44:41 -0600 | [diff] [blame] | 116 |             int32_t userId, int32_t flags, const std::vector<int32_t>& appIds, | 
 | 117 |             std::vector<int64_t>* _aidl_return); | 
| Jeff Sharkey | c1e93e7 | 2016-12-05 23:39:32 -0700 | [diff] [blame] | 118 |  | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 119 |     binder::Status getAppCrates(const std::optional<std::string>& uuid, | 
| Felka Chang | 2a0a246 | 2019-11-20 14:20:40 +0800 | [diff] [blame] | 120 |             const std::vector<std::string>& packageNames, | 
 | 121 |             int32_t userId, | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 122 |             std::optional<std::vector<std::optional<android::os::storage::CrateMetadata>>>* | 
| Felka Chang | 2a0a246 | 2019-11-20 14:20:40 +0800 | [diff] [blame] | 123 |                     _aidl_return); | 
 | 124 |     binder::Status getUserCrates( | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 125 |             const std::optional<std::string>& uuid, int32_t userId, | 
 | 126 |             std::optional<std::vector<std::optional<android::os::storage::CrateMetadata>>>* | 
| Felka Chang | 2a0a246 | 2019-11-20 14:20:40 +0800 | [diff] [blame] | 127 |                     _aidl_return); | 
 | 128 |  | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 129 |     binder::Status setAppQuota(const std::optional<std::string>& uuid, | 
| Jeff Sharkey | 88ddd94 | 2017-01-17 18:05:54 -0700 | [diff] [blame] | 130 |             int32_t userId, int32_t appId, int64_t cacheQuota); | 
 | 131 |  | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 132 |     binder::Status moveCompleteApp(const std::optional<std::string>& fromUuid, | 
 | 133 |             const std::optional<std::string>& toUuid, const std::string& packageName, | 
| Songchun Fan | dc2083f | 2020-02-18 17:45:46 -0800 | [diff] [blame] | 134 |             int32_t appId, const std::string& seInfo, | 
| Songchun Fan | aed3337 | 2020-02-05 12:02:22 -0800 | [diff] [blame] | 135 |             int32_t targetSdkVersion, const std::string& fromCodePath); | 
| Jeff Sharkey | 475c6f9 | 2016-12-07 10:37:27 -0700 | [diff] [blame] | 136 |  | 
| Alex Buynytskyy | 44036e2 | 2021-11-19 08:58:23 -0800 | [diff] [blame] | 137 |     binder::Status dexopt(const std::string& apkPath, int32_t uid, const std::string& packageName, | 
 | 138 |                           const std::string& instructionSet, int32_t dexoptNeeded, | 
 | 139 |                           const std::optional<std::string>& outputPath, int32_t dexFlags, | 
 | 140 |                           const std::string& compilerFilter, const std::optional<std::string>& uuid, | 
 | 141 |                           const std::optional<std::string>& classLoaderContext, | 
 | 142 |                           const std::optional<std::string>& seInfo, bool downgrade, | 
 | 143 |                           int32_t targetSdkVersion, const std::optional<std::string>& profileName, | 
 | 144 |                           const std::optional<std::string>& dexMetadataPath, | 
 | 145 |                           const std::optional<std::string>& compilationReason, bool* aidl_return); | 
| Keun young Park | 65578d6 | 2021-06-28 17:52:05 -0700 | [diff] [blame] | 146 |  | 
 | 147 |     binder::Status controlDexOptBlocking(bool block); | 
| Jeff Sharkey | 6c2c056 | 2016-12-07 12:12:00 -0700 | [diff] [blame] | 148 |  | 
| Eric Holk | 0ebbe0f | 2019-01-09 18:17:27 -0800 | [diff] [blame] | 149 |     binder::Status compileLayouts(const std::string& apkPath, const std::string& packageName, | 
 | 150 |                                   const std::string& outDexFile, int uid, bool* _aidl_return); | 
 | 151 |  | 
| Jeff Sharkey | 475c6f9 | 2016-12-07 10:37:27 -0700 | [diff] [blame] | 152 |     binder::Status rmdex(const std::string& codePath, const std::string& instructionSet); | 
 | 153 |  | 
| Calin Juravle | 562de81 | 2018-01-20 23:34:18 -0800 | [diff] [blame] | 154 |     binder::Status mergeProfiles(int32_t uid, const std::string& packageName, | 
| Calin Juravle | e90de86 | 2021-06-08 08:04:52 -0700 | [diff] [blame] | 155 |             const std::string& profileName, int* _aidl_return); | 
| Jeff Sharkey | 475c6f9 | 2016-12-07 10:37:27 -0700 | [diff] [blame] | 156 |     binder::Status dumpProfiles(int32_t uid, const std::string& packageName, | 
| Martin Stjernholm | fd00040 | 2022-04-11 18:04:59 +0100 | [diff] [blame] | 157 |                                 const std::string& profileName, const std::string& codePath, | 
 | 158 |                                 bool dumpClassesAndMethods, bool* _aidl_return); | 
| Mathieu Chartier | f966f2a | 2017-05-10 12:48:37 -0700 | [diff] [blame] | 159 |     binder::Status copySystemProfile(const std::string& systemProfile, | 
| Calin Juravle | 562de81 | 2018-01-20 23:34:18 -0800 | [diff] [blame] | 160 |             int32_t uid, const std::string& packageName, const std::string& profileName, | 
 | 161 |             bool* _aidl_return); | 
 | 162 |     binder::Status clearAppProfiles(const std::string& packageName, const std::string& profileName); | 
| Jeff Sharkey | 475c6f9 | 2016-12-07 10:37:27 -0700 | [diff] [blame] | 163 |     binder::Status destroyAppProfiles(const std::string& packageName); | 
| Jiakai Zhang | ee00e3b | 2022-03-24 15:03:04 +0000 | [diff] [blame] | 164 |     binder::Status deleteReferenceProfile(const std::string& packageName, | 
 | 165 |                                           const std::string& profileName); | 
| Jeff Sharkey | 475c6f9 | 2016-12-07 10:37:27 -0700 | [diff] [blame] | 166 |  | 
| Calin Juravle | c41dac2 | 2017-12-05 12:29:15 -0800 | [diff] [blame] | 167 |     binder::Status createProfileSnapshot(int32_t appId, const std::string& packageName, | 
| Calin Juravle | e61189e | 2018-01-23 19:54:11 -0800 | [diff] [blame] | 168 |             const std::string& profileName, const std::string& classpath, bool* _aidl_return); | 
| Calin Juravle | 2959173 | 2017-11-20 17:46:19 -0800 | [diff] [blame] | 169 |     binder::Status destroyProfileSnapshot(const std::string& packageName, | 
| Calin Juravle | 562de81 | 2018-01-20 23:34:18 -0800 | [diff] [blame] | 170 |             const std::string& profileName); | 
| Calin Juravle | 2959173 | 2017-11-20 17:46:19 -0800 | [diff] [blame] | 171 |  | 
| Alex Buynytskyy | 44036e2 | 2021-11-19 08:58:23 -0800 | [diff] [blame] | 172 |     binder::Status rmPackageDir(const std::string& packageName, const std::string& packageDir); | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 173 |     binder::Status freeCache(const std::optional<std::string>& uuid, int64_t targetFreeBytes, | 
| Neharika Jali | 0e54231 | 2021-10-25 06:41:24 +0000 | [diff] [blame] | 174 |             int32_t flags); | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 175 |     binder::Status linkNativeLibraryDirectory(const std::optional<std::string>& uuid, | 
| Jeff Sharkey | 6c2c056 | 2016-12-07 12:12:00 -0700 | [diff] [blame] | 176 |             const std::string& packageName, const std::string& nativeLibPath32, int32_t userId); | 
| Alex Buynytskyy | 44036e2 | 2021-11-19 08:58:23 -0800 | [diff] [blame] | 177 |     binder::Status createOatDir(const std::string& packageName, const std::string& oatDir, | 
 | 178 |                                 const std::string& instructionSet); | 
 | 179 |     binder::Status linkFile(const std::string& packageName, const std::string& relativePath, | 
 | 180 |                             const std::string& fromBase, const std::string& toBase); | 
 | 181 |     binder::Status moveAb(const std::string& packageName, const std::string& apkPath, | 
 | 182 |                           const std::string& instructionSet, const std::string& outputPath); | 
 | 183 |     binder::Status deleteOdex(const std::string& packageName, const std::string& apkPath, | 
 | 184 |                               const std::string& instructionSet, | 
 | 185 |                               const std::optional<std::string>& outputPath, int64_t* _aidl_return); | 
| Calin Juravle | bd96836 | 2017-01-25 01:17:17 -0800 | [diff] [blame] | 186 |     binder::Status reconcileSecondaryDexFile(const std::string& dexPath, | 
 | 187 |         const std::string& packageName, int32_t uid, const std::vector<std::string>& isa, | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 188 |         const std::optional<std::string>& volumeUuid, int32_t storage_flag, bool* _aidl_return); | 
| Alan Stokes | 753dc71 | 2017-10-16 10:56:00 +0100 | [diff] [blame] | 189 |     binder::Status hashSecondaryDexFile(const std::string& dexPath, | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 190 |         const std::string& packageName, int32_t uid, const std::optional<std::string>& volumeUuid, | 
| Alan Stokes | 753dc71 | 2017-10-16 10:56:00 +0100 | [diff] [blame] | 191 |         int32_t storageFlag, std::vector<uint8_t>* _aidl_return); | 
| Jeff Sharkey | 7a9059e | 2017-01-16 19:07:18 -0700 | [diff] [blame] | 192 |  | 
| Jeff Sharkey | 66b1a12 | 2017-01-16 20:57:45 -0700 | [diff] [blame] | 193 |     binder::Status invalidateMounts(); | 
| Shikha Malhotra | 976ae00 | 2022-02-26 15:39:53 +0000 | [diff] [blame] | 194 |     binder::Status setFirstBoot(); | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 195 |     binder::Status isQuotaSupported(const std::optional<std::string>& volumeUuid, | 
| Jeff Sharkey | 325b8c9 | 2017-02-21 10:00:53 -0700 | [diff] [blame] | 196 |             bool* _aidl_return); | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 197 |     binder::Status tryMountDataMirror(const std::optional<std::string>& volumeUuid); | 
 | 198 |     binder::Status onPrivateVolumeRemoved(const std::optional<std::string>& volumeUuid); | 
| Jeff Sharkey | 66b1a12 | 2017-01-16 20:57:45 -0700 | [diff] [blame] | 199 |  | 
| Calin Juravle | bc5ab87 | 2018-01-18 22:32:58 -0800 | [diff] [blame] | 200 |     binder::Status prepareAppProfile(const std::string& packageName, | 
 | 201 |             int32_t userId, int32_t appId, const std::string& profileName, | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 202 |             const std::string& codePath, const std::optional<std::string>& dexMetadata, | 
| Calin Juravle | bc5ab87 | 2018-01-18 22:32:58 -0800 | [diff] [blame] | 203 |             bool* _aidl_return); | 
 | 204 |  | 
| Narayan Kamath | 28ab93b | 2019-05-15 18:29:44 +0100 | [diff] [blame] | 205 |     binder::Status migrateLegacyObbData(); | 
 | 206 |  | 
| Alex Buynytskyy | 58a7309 | 2022-02-14 13:15:53 -0800 | [diff] [blame] | 207 |     binder::Status cleanupInvalidPackageDirs(const std::optional<std::string>& uuid, int32_t userId, | 
 | 208 |                                              int32_t flags); | 
| Alex Buynytskyy | 038a19b | 2022-02-09 19:51:52 -0800 | [diff] [blame] | 209 |  | 
| Jiakai Zhang | f515a1b | 2022-02-23 18:33:26 +0000 | [diff] [blame] | 210 |     binder::Status getOdexVisibility(const std::string& packageName, const std::string& apkPath, | 
 | 211 |                                      const std::string& instructionSet, | 
 | 212 |                                      const std::optional<std::string>& outputPath, | 
 | 213 |                                      int32_t* _aidl_return); | 
 | 214 |  | 
| Victor Hsieh | c7ab564 | 2023-07-28 15:07:55 -0700 | [diff] [blame] | 215 |     binder::Status createFsveritySetupAuthToken(const android::os::ParcelFileDescriptor& authFd, | 
 | 216 |                                                 int32_t appUid, int32_t userId, | 
 | 217 |                                                 android::sp<IFsveritySetupAuthToken>* _aidl_return); | 
 | 218 |     binder::Status enableFsverity(const android::sp<IFsveritySetupAuthToken>& authToken, | 
 | 219 |                                   const std::string& filePath, const std::string& packageName, | 
 | 220 |                                   int32_t* _aidl_return); | 
 | 221 |  | 
| Jeff Sharkey | 7a9059e | 2017-01-16 19:07:18 -0700 | [diff] [blame] | 222 | private: | 
 | 223 |     std::recursive_mutex mLock; | 
| Alex Buynytskyy | fcd5bf3 | 2021-11-23 11:31:34 -0800 | [diff] [blame] | 224 |     std::unordered_map<userid_t, std::weak_ptr<std::shared_mutex>> mUserIdLock; | 
| Alex Buynytskyy | 4fef886 | 2021-11-21 16:09:33 -0800 | [diff] [blame] | 225 |     std::unordered_map<std::string, std::weak_ptr<std::recursive_mutex>> mPackageNameLock; | 
 | 226 |  | 
| Jeff Sharkey | d712f0c | 2017-05-03 11:36:42 -0600 | [diff] [blame] | 227 |     std::recursive_mutex mMountsLock; | 
 | 228 |     std::recursive_mutex mQuotasLock; | 
| Jeff Sharkey | b26786d | 2017-03-11 19:40:29 -0700 | [diff] [blame] | 229 |  | 
| Jeff Sharkey | d712f0c | 2017-05-03 11:36:42 -0600 | [diff] [blame] | 230 |     /* Map of all storage mounts from source to target */ | 
 | 231 |     std::unordered_map<std::string, std::string> mStorageMounts; | 
| Jeff Sharkey | d712f0c | 2017-05-03 11:36:42 -0600 | [diff] [blame] | 232 |  | 
| Jeff Sharkey | 88ddd94 | 2017-01-17 18:05:54 -0700 | [diff] [blame] | 233 |     /* Map from UID to cache quota size */ | 
 | 234 |     std::unordered_map<uid_t, int64_t> mCacheQuotas; | 
| Jeff Sharkey | 66b1a12 | 2017-01-16 20:57:45 -0700 | [diff] [blame] | 235 |  | 
| Jooyung Han | 2d5878e | 2020-01-23 12:45:10 +0900 | [diff] [blame] | 236 |     std::string findDataMediaPath(const std::optional<std::string>& uuid, userid_t userid); | 
| Samiul Islam | c40dff5 | 2022-01-14 16:24:48 +0000 | [diff] [blame] | 237 |  | 
 | 238 |     binder::Status createAppDataLocked(const std::optional<std::string>& uuid, | 
 | 239 |                                        const std::string& packageName, int32_t userId, | 
 | 240 |                                        int32_t flags, int32_t appId, int32_t previousAppId, | 
 | 241 |                                        const std::string& seInfo, int32_t targetSdkVersion, | 
| Songchun Fan | cb567f9 | 2023-09-11 17:04:47 +0000 | [diff] [blame] | 242 |                                        int64_t* ceDataInode, int64_t* deDataInode); | 
| Mohammad Samiul Islam | e7634ba | 2022-03-07 20:27:30 +0000 | [diff] [blame] | 243 |     binder::Status restoreconAppDataLocked(const std::optional<std::string>& uuid, | 
 | 244 |                                            const std::string& packageName, int32_t userId, | 
 | 245 |                                            int32_t flags, int32_t appId, const std::string& seInfo); | 
| Samiul Islam | c40dff5 | 2022-01-14 16:24:48 +0000 | [diff] [blame] | 246 |  | 
| Rishabh Singh | e84b0b1 | 2022-02-02 20:56:13 +0000 | [diff] [blame] | 247 |     binder::Status createSdkSandboxDataPackageDirectory(const std::optional<std::string>& uuid, | 
 | 248 |                                                         const std::string& packageName, | 
 | 249 |                                                         int32_t userId, int32_t appId, | 
| Mohammad Samiul Islam | 5288b05 | 2022-03-09 17:04:38 +0000 | [diff] [blame] | 250 |                                                         int32_t flags); | 
| Rishabh Singh | e84b0b1 | 2022-02-02 20:56:13 +0000 | [diff] [blame] | 251 |     binder::Status clearSdkSandboxDataPackageDirectory(const std::optional<std::string>& uuid, | 
 | 252 |                                                        const std::string& packageName, | 
 | 253 |                                                        int32_t userId, int32_t flags); | 
 | 254 |     binder::Status destroySdkSandboxDataPackageDirectory(const std::optional<std::string>& uuid, | 
 | 255 |                                                          const std::string& packageName, | 
 | 256 |                                                          int32_t userId, int32_t flags); | 
| Mohammad Samiul Islam | e7634ba | 2022-03-07 20:27:30 +0000 | [diff] [blame] | 257 |     binder::Status reconcileSdkData(const std::optional<std::string>& uuid, | 
 | 258 |                                     const std::string& packageName, | 
| Mohammad Samiul Islam | 5288b05 | 2022-03-09 17:04:38 +0000 | [diff] [blame] | 259 |                                     const std::vector<std::string>& subDirNames, int32_t userId, | 
| Mohammad Samiul Islam | e7634ba | 2022-03-07 20:27:30 +0000 | [diff] [blame] | 260 |                                     int32_t appId, int32_t previousAppId, const std::string& seInfo, | 
 | 261 |                                     int flags); | 
 | 262 |     binder::Status restoreconSdkDataLocked(const std::optional<std::string>& uuid, | 
 | 263 |                                            const std::string& packageName, int32_t userId, | 
 | 264 |                                            int32_t flags, int32_t appId, const std::string& seInfo); | 
| Jeff Sharkey | 0274c97 | 2016-12-06 09:32:04 -0700 | [diff] [blame] | 265 | }; | 
 | 266 |  | 
| Andreas Gampe | 02d0de5 | 2015-11-11 20:43:16 -0800 | [diff] [blame] | 267 | }  // namespace installd | 
 | 268 | }  // namespace android | 
 | 269 |  | 
 | 270 | #endif  // COMMANDS_H_ |