blob: e8a8f2aee41c3e931976096f2c0b10f8ac7b0282 [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
17package android.os;
18
19/** {@hide} */
20interface IVold {
21 void reset();
Jeff Sharkey9462bdd2017-09-07 15:27:28 -060022 void shutdown();
Jeff Sharkey11c2d382017-09-11 10:32:01 -060023 void mountAll();
Jeff Sharkey9462bdd2017-09-07 15:27:28 -060024
25 void onUserAdded(int userId, int userSerial);
26 void onUserRemoved(int userId);
27 void onUserStarted(int userId);
28 void onUserStopped(int userId);
29
30 void partition(@utf8InCpp String diskId, int partitionType, int ratio);
31 void forgetPartition(@utf8InCpp String partGuid);
32
33 void mount(@utf8InCpp String volId, int mountFlags, int mountUserId);
34 void unmount(@utf8InCpp String volId);
35 void format(@utf8InCpp String volId, @utf8InCpp String fsType);
36 long benchmark(@utf8InCpp String volId);
37
38 void moveStorage(@utf8InCpp String fromVolId, @utf8InCpp String toVolId);
39
40 void remountUid(int uid, int remountMode);
41
42 void mkdirs(@utf8InCpp String path);
43
Jeff Sharkey11c2d382017-09-11 10:32:01 -060044 @utf8InCpp String createObb(@utf8InCpp String sourcePath,
45 @utf8InCpp String sourceKey, int ownerGid);
46 void destroyObb(@utf8InCpp String volId);
47
48 void fstrim(int fstrimFlags);
49
50 FileDescriptor mountAppFuse(int uid, int pid, int mountId);
51 void unmountAppFuse(int uid, int pid, int mountId);
52
Jeff Sharkey83b559c2017-09-12 16:30:52 -060053 void fdeCheckPassword(@utf8InCpp String password);
54 void fdeRestart();
55 int fdeComplete();
56 void fdeEnable(int passwordType, @utf8InCpp String password, int encryptionFlags);
57 void fdeChangePassword(int passwordType, @utf8InCpp String password);
58 void fdeVerifyPassword(@utf8InCpp String password);
59 @utf8InCpp String fdeGetField(@utf8InCpp String key);
60 void fdeSetField(@utf8InCpp String key, @utf8InCpp String value);
61 int fdeGetPasswordType();
62 @utf8InCpp String fdeGetPassword();
63 void fdeClearPassword();
64
65 void fbeEnable();
66
67 void mountDefaultEncrypted();
68 void initUser0();
69 boolean isConvertibleToFbe();
70
71 void createUserKey(int userId, int userSerial, boolean ephemeral);
72 void destroyUserKey(int userId);
73
74 void addUserKeyAuth(int userId, int userSerial, @utf8InCpp String token, @utf8InCpp String secret);
75 void fixateNewestUserKeyAuth(int userId);
76
77 void unlockUserKey(int userId, int userSerial, @utf8InCpp String token, @utf8InCpp String secret);
78 void lockUserKey(int userId);
79
80 void prepareUserStorage(@nullable @utf8InCpp String uuid, int userId, int userSerial, int storageFlags);
81 void destroyUserStorage(@nullable @utf8InCpp String uuid, int userId, int storageFlags);
82
83 void secdiscard(@utf8InCpp String path);
84
85 const int ENCRYPTION_FLAG_WIPE = 1;
86 const int ENCRYPTION_FLAG_IN_PLACE = 2;
87 const int ENCRYPTION_FLAG_NO_UI = 4;
88
89 const int ENCRYPTION_STATE_NONE = 1;
90 const int ENCRYPTION_STATE_OK = 0;
91 const int ENCRYPTION_STATE_ERROR_UNKNOWN = -1;
92 const int ENCRYPTION_STATE_ERROR_INCOMPLETE = -2;
93 const int ENCRYPTION_STATE_ERROR_INCONSISTENT = -3;
94 const int ENCRYPTION_STATE_ERROR_CORRUPT = -4;
95
Jeff Sharkey11c2d382017-09-11 10:32:01 -060096 const int FSTRIM_FLAG_DEEP_TRIM = 1;
97 const int FSTRIM_FLAG_BENCHMARK_AFTER = 2;
98
Jeff Sharkey9462bdd2017-09-07 15:27:28 -060099 const int MOUNT_FLAG_PRIMARY = 1;
100 const int MOUNT_FLAG_VISIBLE = 2;
101
102 const int PARTITION_TYPE_PUBLIC = 0;
103 const int PARTITION_TYPE_PRIVATE = 1;
104 const int PARTITION_TYPE_MIXED = 2;
105
Jeff Sharkey83b559c2017-09-12 16:30:52 -0600106 const int PASSWORD_TYPE_PASSWORD = 0;
107 const int PASSWORD_TYPE_DEFAULT = 1;
108 const int PASSWORD_TYPE_PIN = 2;
109 const int PASSWORD_TYPE_PATTERN = 3;
110
111 const int STORAGE_FLAG_DE = 1;
112 const int STORAGE_FLAG_CE = 2;
113
Jeff Sharkey9462bdd2017-09-07 15:27:28 -0600114 const int REMOUNT_MODE_NONE = 0;
115 const int REMOUNT_MODE_DEFAULT = 1;
116 const int REMOUNT_MODE_READ = 2;
117 const int REMOUNT_MODE_WRITE = 3;
118
119 const int STATE_UNMOUNTED = 0;
120 const int STATE_CHECKING = 1;
121 const int STATE_MOUNTED = 2;
122 const int STATE_MOUNTED_READ_ONLY = 3;
123 const int STATE_FORMATTING = 4;
124 const int STATE_EJECTING = 5;
125 const int STATE_UNMOUNTABLE = 6;
126 const int STATE_REMOVED = 7;
127 const int STATE_BAD_REMOVAL = 8;
128
129 const int TYPE_PUBLIC = 0;
130 const int TYPE_PRIVATE = 1;
131 const int TYPE_EMULATED = 2;
132 const int TYPE_ASEC = 3;
133 const int TYPE_OBB = 4;
Jeff Sharkey068c6be2017-09-06 13:47:40 -0600134}