blob: 5d182c99e097095766bd222e44a91c2eb6725709 [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
Jeff Sharkey814e9d32017-09-13 11:49:44 -060019import android.os.IVoldListener;
Jeff Sharkey52f7a912017-09-15 12:57:44 -060020import android.os.IVoldTaskListener;
Jeff Sharkey814e9d32017-09-13 11:49:44 -060021
Jeff Sharkey068c6be2017-09-06 13:47:40 -060022/** {@hide} */
23interface IVold {
Jeff Sharkey814e9d32017-09-13 11:49:44 -060024 void setListener(IVoldListener listener);
25
Jeff Sharkeycbe69fc2017-09-15 16:50:28 -060026 void monitor();
Jeff Sharkey068c6be2017-09-06 13:47:40 -060027 void reset();
Jeff Sharkey9462bdd2017-09-07 15:27:28 -060028 void shutdown();
Jeff Sharkey11c2d382017-09-11 10:32:01 -060029 void mountAll();
Jeff Sharkey9462bdd2017-09-07 15:27:28 -060030
31 void onUserAdded(int userId, int userSerial);
32 void onUserRemoved(int userId);
33 void onUserStarted(int userId);
34 void onUserStopped(int userId);
35
36 void partition(@utf8InCpp String diskId, int partitionType, int ratio);
Jeff Sharkey3ce18252017-10-24 11:08:45 -060037 void forgetPartition(@utf8InCpp String partGuid, @utf8InCpp String fsUuid);
Jeff Sharkey9462bdd2017-09-07 15:27:28 -060038
39 void mount(@utf8InCpp String volId, int mountFlags, int mountUserId);
40 void unmount(@utf8InCpp String volId);
41 void format(@utf8InCpp String volId, @utf8InCpp String fsType);
Jeff Sharkey52f7a912017-09-15 12:57:44 -060042 void benchmark(@utf8InCpp String volId, IVoldTaskListener listener);
Jeff Sharkey2048a282017-06-15 09:59:43 -060043 void checkEncryption(@utf8InCpp String volId);
Jeff Sharkey9462bdd2017-09-07 15:27:28 -060044
Jeff Sharkey52f7a912017-09-15 12:57:44 -060045 void moveStorage(@utf8InCpp String fromVolId, @utf8InCpp String toVolId,
46 IVoldTaskListener listener);
Jeff Sharkey9462bdd2017-09-07 15:27:28 -060047
48 void remountUid(int uid, int remountMode);
49
50 void mkdirs(@utf8InCpp String path);
51
Jeff Sharkey11c2d382017-09-11 10:32:01 -060052 @utf8InCpp String createObb(@utf8InCpp String sourcePath,
53 @utf8InCpp String sourceKey, int ownerGid);
54 void destroyObb(@utf8InCpp String volId);
55
Jeff Sharkey52f7a912017-09-15 12:57:44 -060056 void fstrim(int fstrimFlags, IVoldTaskListener listener);
Jeff Sharkey11c2d382017-09-11 10:32:01 -060057
58 FileDescriptor mountAppFuse(int uid, int pid, int mountId);
59 void unmountAppFuse(int uid, int pid, int mountId);
60
Jeff Sharkey83b559c2017-09-12 16:30:52 -060061 void fdeCheckPassword(@utf8InCpp String password);
62 void fdeRestart();
63 int fdeComplete();
64 void fdeEnable(int passwordType, @utf8InCpp String password, int encryptionFlags);
65 void fdeChangePassword(int passwordType, @utf8InCpp String password);
66 void fdeVerifyPassword(@utf8InCpp String password);
67 @utf8InCpp String fdeGetField(@utf8InCpp String key);
68 void fdeSetField(@utf8InCpp String key, @utf8InCpp String value);
69 int fdeGetPasswordType();
70 @utf8InCpp String fdeGetPassword();
71 void fdeClearPassword();
72
73 void fbeEnable();
74
75 void mountDefaultEncrypted();
76 void initUser0();
77 boolean isConvertibleToFbe();
78
79 void createUserKey(int userId, int userSerial, boolean ephemeral);
80 void destroyUserKey(int userId);
81
82 void addUserKeyAuth(int userId, int userSerial, @utf8InCpp String token, @utf8InCpp String secret);
83 void fixateNewestUserKeyAuth(int userId);
84
85 void unlockUserKey(int userId, int userSerial, @utf8InCpp String token, @utf8InCpp String secret);
86 void lockUserKey(int userId);
87
88 void prepareUserStorage(@nullable @utf8InCpp String uuid, int userId, int userSerial, int storageFlags);
89 void destroyUserStorage(@nullable @utf8InCpp String uuid, int userId, int storageFlags);
90
91 void secdiscard(@utf8InCpp String path);
92
93 const int ENCRYPTION_FLAG_WIPE = 1;
94 const int ENCRYPTION_FLAG_IN_PLACE = 2;
95 const int ENCRYPTION_FLAG_NO_UI = 4;
96
97 const int ENCRYPTION_STATE_NONE = 1;
98 const int ENCRYPTION_STATE_OK = 0;
99 const int ENCRYPTION_STATE_ERROR_UNKNOWN = -1;
100 const int ENCRYPTION_STATE_ERROR_INCOMPLETE = -2;
101 const int ENCRYPTION_STATE_ERROR_INCONSISTENT = -3;
102 const int ENCRYPTION_STATE_ERROR_CORRUPT = -4;
103
Jeff Sharkey11c2d382017-09-11 10:32:01 -0600104 const int FSTRIM_FLAG_DEEP_TRIM = 1;
Jeff Sharkey11c2d382017-09-11 10:32:01 -0600105
Jeff Sharkey9462bdd2017-09-07 15:27:28 -0600106 const int MOUNT_FLAG_PRIMARY = 1;
107 const int MOUNT_FLAG_VISIBLE = 2;
108
109 const int PARTITION_TYPE_PUBLIC = 0;
110 const int PARTITION_TYPE_PRIVATE = 1;
111 const int PARTITION_TYPE_MIXED = 2;
112
Jeff Sharkey83b559c2017-09-12 16:30:52 -0600113 const int PASSWORD_TYPE_PASSWORD = 0;
114 const int PASSWORD_TYPE_DEFAULT = 1;
115 const int PASSWORD_TYPE_PIN = 2;
116 const int PASSWORD_TYPE_PATTERN = 3;
117
118 const int STORAGE_FLAG_DE = 1;
119 const int STORAGE_FLAG_CE = 2;
120
Jeff Sharkey9462bdd2017-09-07 15:27:28 -0600121 const int REMOUNT_MODE_NONE = 0;
122 const int REMOUNT_MODE_DEFAULT = 1;
123 const int REMOUNT_MODE_READ = 2;
124 const int REMOUNT_MODE_WRITE = 3;
125
Jeff Sharkey814e9d32017-09-13 11:49:44 -0600126 const int VOLUME_STATE_UNMOUNTED = 0;
127 const int VOLUME_STATE_CHECKING = 1;
128 const int VOLUME_STATE_MOUNTED = 2;
129 const int VOLUME_STATE_MOUNTED_READ_ONLY = 3;
130 const int VOLUME_STATE_FORMATTING = 4;
131 const int VOLUME_STATE_EJECTING = 5;
132 const int VOLUME_STATE_UNMOUNTABLE = 6;
133 const int VOLUME_STATE_REMOVED = 7;
134 const int VOLUME_STATE_BAD_REMOVAL = 8;
Jeff Sharkey9462bdd2017-09-07 15:27:28 -0600135
Jeff Sharkey814e9d32017-09-13 11:49:44 -0600136 const int VOLUME_TYPE_PUBLIC = 0;
137 const int VOLUME_TYPE_PRIVATE = 1;
138 const int VOLUME_TYPE_EMULATED = 2;
139 const int VOLUME_TYPE_ASEC = 3;
140 const int VOLUME_TYPE_OBB = 4;
Jeff Sharkey068c6be2017-09-06 13:47:40 -0600141}