Jeff Sharkey | 068c6be | 2017-09-06 13:47:40 -0600 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 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 | #ifndef _VOLD_NATIVE_SERVICE_H_ |
| 18 | #define _VOLD_NATIVE_SERVICE_H_ |
| 19 | |
Jeff Sharkey | 11c2d38 | 2017-09-11 10:32:01 -0600 | [diff] [blame^] | 20 | #include <android-base/unique_fd.h> |
Jeff Sharkey | 068c6be | 2017-09-06 13:47:40 -0600 | [diff] [blame] | 21 | #include <binder/BinderService.h> |
| 22 | |
| 23 | #include "android/os/BnVold.h" |
| 24 | |
| 25 | namespace android { |
| 26 | namespace vold { |
| 27 | |
| 28 | class VoldNativeService : public BinderService<VoldNativeService>, public os::BnVold { |
| 29 | public: |
| 30 | static status_t start(); |
| 31 | static char const* getServiceName() { return "vold"; } |
| 32 | virtual status_t dump(int fd, const Vector<String16> &args) override; |
| 33 | |
| 34 | binder::Status reset(); |
Jeff Sharkey | 9462bdd | 2017-09-07 15:27:28 -0600 | [diff] [blame] | 35 | binder::Status shutdown(); |
Jeff Sharkey | 11c2d38 | 2017-09-11 10:32:01 -0600 | [diff] [blame^] | 36 | binder::Status mountAll(); |
Jeff Sharkey | 9462bdd | 2017-09-07 15:27:28 -0600 | [diff] [blame] | 37 | |
| 38 | binder::Status onUserAdded(int32_t userId, int32_t userSerial); |
| 39 | binder::Status onUserRemoved(int32_t userId); |
| 40 | binder::Status onUserStarted(int32_t userId); |
| 41 | binder::Status onUserStopped(int32_t userId); |
| 42 | |
| 43 | binder::Status partition(const std::string& diskId, int32_t partitionType, int32_t ratio); |
| 44 | binder::Status forgetPartition(const std::string& partGuid); |
| 45 | |
| 46 | binder::Status mount(const std::string& volId, int32_t mountFlags, int32_t mountUserId); |
| 47 | binder::Status unmount(const std::string& volId); |
| 48 | binder::Status format(const std::string& volId, const std::string& fsType); |
| 49 | binder::Status benchmark(const std::string& volId, int64_t* _aidl_return); |
| 50 | |
| 51 | binder::Status moveStorage(const std::string& fromVolId, const std::string& toVolId); |
| 52 | |
| 53 | binder::Status remountUid(int32_t uid, int32_t remountMode); |
| 54 | |
| 55 | binder::Status mkdirs(const std::string& path); |
Jeff Sharkey | 11c2d38 | 2017-09-11 10:32:01 -0600 | [diff] [blame^] | 56 | |
| 57 | binder::Status createObb(const std::string& sourcePath, const std::string& sourceKey, |
| 58 | int32_t ownerGid, std::string* _aidl_return); |
| 59 | binder::Status destroyObb(const std::string& volId); |
| 60 | |
| 61 | binder::Status fstrim(int32_t fstrimFlags); |
| 62 | |
| 63 | binder::Status mountAppFuse(int32_t uid, int32_t pid, int32_t mountId, |
| 64 | android::base::unique_fd* _aidl_return); |
| 65 | binder::Status unmountAppFuse(int32_t uid, int32_t pid, int32_t mountId); |
Jeff Sharkey | 068c6be | 2017-09-06 13:47:40 -0600 | [diff] [blame] | 66 | }; |
| 67 | |
| 68 | } // namespace vold |
| 69 | } // namespace android |
| 70 | |
| 71 | #endif // _VOLD_NATIVE_SERVICE_H_ |