blob: 50244d258af29bab73b3a99d86e5744f6da919b1 [file] [log] [blame]
Jeff Sharkey068c6be2017-09-06 13:47:40 -06001/*
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 Sharkey11c2d382017-09-11 10:32:01 -060020#include <android-base/unique_fd.h>
Jeff Sharkey068c6be2017-09-06 13:47:40 -060021#include <binder/BinderService.h>
22
23#include "android/os/BnVold.h"
24
25namespace android {
26namespace vold {
27
28class VoldNativeService : public BinderService<VoldNativeService>, public os::BnVold {
29public:
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 Sharkey9462bdd2017-09-07 15:27:28 -060035 binder::Status shutdown();
Jeff Sharkey11c2d382017-09-11 10:32:01 -060036 binder::Status mountAll();
Jeff Sharkey9462bdd2017-09-07 15:27:28 -060037
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 Sharkey11c2d382017-09-11 10:32:01 -060056
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 Sharkey83b559c2017-09-12 16:30:52 -060066
67 binder::Status fdeCheckPassword(const std::string& password);
68 binder::Status fdeRestart();
69 binder::Status fdeComplete(int32_t* _aidl_return);
70 binder::Status fdeEnable(int32_t passwordType,
71 const std::string& password, int32_t encryptionFlags);
72 binder::Status fdeChangePassword(int32_t passwordType,
73 const std::string& password);
74 binder::Status fdeVerifyPassword(const std::string& password);
75 binder::Status fdeGetField(const std::string& key, std::string* _aidl_return);
76 binder::Status fdeSetField(const std::string& key, const std::string& value);
77 binder::Status fdeGetPasswordType(int32_t* _aidl_return);
78 binder::Status fdeGetPassword(std::string* _aidl_return);
79 binder::Status fdeClearPassword();
80
81 binder::Status fbeEnable();
82
83 binder::Status mountDefaultEncrypted();
84 binder::Status initUser0();
85 binder::Status isConvertibleToFbe(bool* _aidl_return);
86
87 binder::Status createUserKey(int32_t userId, int32_t userSerial, bool ephemeral);
88 binder::Status destroyUserKey(int32_t userId);
89
90 binder::Status addUserKeyAuth(int32_t userId, int32_t userSerial,
91 const std::string& token, const std::string& secret);
92 binder::Status fixateNewestUserKeyAuth(int32_t userId);
93
94 binder::Status unlockUserKey(int32_t userId, int32_t userSerial,
95 const std::string& token, const std::string& secret);
96 binder::Status lockUserKey(int32_t userId);
97
98 binder::Status prepareUserStorage(const std::unique_ptr<std::string>& uuid,
99 int32_t userId, int32_t userSerial, int32_t flags);
100 binder::Status destroyUserStorage(const std::unique_ptr<std::string>& uuid,
101 int32_t userId, int32_t flags);
102
103 binder::Status secdiscard(const std::string& path);
Jeff Sharkey068c6be2017-09-06 13:47:40 -0600104};
105
106} // namespace vold
107} // namespace android
108
109#endif // _VOLD_NATIVE_SERVICE_H_