blob: d47f11387174e6020945d4c3be7eb0a3f936f26e [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);
37 void forgetPartition(@utf8InCpp String partGuid);
38
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 Sharkey9462bdd2017-09-07 15:27:28 -060043
Jeff Sharkey52f7a912017-09-15 12:57:44 -060044 void moveStorage(@utf8InCpp String fromVolId, @utf8InCpp String toVolId,
45 IVoldTaskListener listener);
Jeff Sharkey9462bdd2017-09-07 15:27:28 -060046
47 void remountUid(int uid, int remountMode);
48
49 void mkdirs(@utf8InCpp String path);
50
Jeff Sharkey11c2d382017-09-11 10:32:01 -060051 @utf8InCpp String createObb(@utf8InCpp String sourcePath,
52 @utf8InCpp String sourceKey, int ownerGid);
53 void destroyObb(@utf8InCpp String volId);
54
Jeff Sharkey52f7a912017-09-15 12:57:44 -060055 void fstrim(int fstrimFlags, IVoldTaskListener listener);
Jeff Sharkey11c2d382017-09-11 10:32:01 -060056
57 FileDescriptor mountAppFuse(int uid, int pid, int mountId);
58 void unmountAppFuse(int uid, int pid, int mountId);
59
Jeff Sharkey83b559c2017-09-12 16:30:52 -060060 void fdeCheckPassword(@utf8InCpp String password);
61 void fdeRestart();
62 int fdeComplete();
63 void fdeEnable(int passwordType, @utf8InCpp String password, int encryptionFlags);
64 void fdeChangePassword(int passwordType, @utf8InCpp String password);
65 void fdeVerifyPassword(@utf8InCpp String password);
66 @utf8InCpp String fdeGetField(@utf8InCpp String key);
67 void fdeSetField(@utf8InCpp String key, @utf8InCpp String value);
68 int fdeGetPasswordType();
69 @utf8InCpp String fdeGetPassword();
70 void fdeClearPassword();
71
72 void fbeEnable();
73
74 void mountDefaultEncrypted();
75 void initUser0();
76 boolean isConvertibleToFbe();
77
78 void createUserKey(int userId, int userSerial, boolean ephemeral);
79 void destroyUserKey(int userId);
80
81 void addUserKeyAuth(int userId, int userSerial, @utf8InCpp String token, @utf8InCpp String secret);
82 void fixateNewestUserKeyAuth(int userId);
83
84 void unlockUserKey(int userId, int userSerial, @utf8InCpp String token, @utf8InCpp String secret);
85 void lockUserKey(int userId);
86
87 void prepareUserStorage(@nullable @utf8InCpp String uuid, int userId, int userSerial, int storageFlags);
88 void destroyUserStorage(@nullable @utf8InCpp String uuid, int userId, int storageFlags);
89
90 void secdiscard(@utf8InCpp String path);
91
92 const int ENCRYPTION_FLAG_WIPE = 1;
93 const int ENCRYPTION_FLAG_IN_PLACE = 2;
94 const int ENCRYPTION_FLAG_NO_UI = 4;
95
96 const int ENCRYPTION_STATE_NONE = 1;
97 const int ENCRYPTION_STATE_OK = 0;
98 const int ENCRYPTION_STATE_ERROR_UNKNOWN = -1;
99 const int ENCRYPTION_STATE_ERROR_INCOMPLETE = -2;
100 const int ENCRYPTION_STATE_ERROR_INCONSISTENT = -3;
101 const int ENCRYPTION_STATE_ERROR_CORRUPT = -4;
102
Jeff Sharkey11c2d382017-09-11 10:32:01 -0600103 const int FSTRIM_FLAG_DEEP_TRIM = 1;
Jeff Sharkey11c2d382017-09-11 10:32:01 -0600104
Jeff Sharkey9462bdd2017-09-07 15:27:28 -0600105 const int MOUNT_FLAG_PRIMARY = 1;
106 const int MOUNT_FLAG_VISIBLE = 2;
107
108 const int PARTITION_TYPE_PUBLIC = 0;
109 const int PARTITION_TYPE_PRIVATE = 1;
110 const int PARTITION_TYPE_MIXED = 2;
111
Jeff Sharkey83b559c2017-09-12 16:30:52 -0600112 const int PASSWORD_TYPE_PASSWORD = 0;
113 const int PASSWORD_TYPE_DEFAULT = 1;
114 const int PASSWORD_TYPE_PIN = 2;
115 const int PASSWORD_TYPE_PATTERN = 3;
116
117 const int STORAGE_FLAG_DE = 1;
118 const int STORAGE_FLAG_CE = 2;
119
Jeff Sharkey9462bdd2017-09-07 15:27:28 -0600120 const int REMOUNT_MODE_NONE = 0;
121 const int REMOUNT_MODE_DEFAULT = 1;
122 const int REMOUNT_MODE_READ = 2;
123 const int REMOUNT_MODE_WRITE = 3;
124
Jeff Sharkey814e9d32017-09-13 11:49:44 -0600125 const int VOLUME_STATE_UNMOUNTED = 0;
126 const int VOLUME_STATE_CHECKING = 1;
127 const int VOLUME_STATE_MOUNTED = 2;
128 const int VOLUME_STATE_MOUNTED_READ_ONLY = 3;
129 const int VOLUME_STATE_FORMATTING = 4;
130 const int VOLUME_STATE_EJECTING = 5;
131 const int VOLUME_STATE_UNMOUNTABLE = 6;
132 const int VOLUME_STATE_REMOVED = 7;
133 const int VOLUME_STATE_BAD_REMOVAL = 8;
Jeff Sharkey9462bdd2017-09-07 15:27:28 -0600134
Jeff Sharkey814e9d32017-09-13 11:49:44 -0600135 const int VOLUME_TYPE_PUBLIC = 0;
136 const int VOLUME_TYPE_PRIVATE = 1;
137 const int VOLUME_TYPE_EMULATED = 2;
138 const int VOLUME_TYPE_ASEC = 3;
139 const int VOLUME_TYPE_OBB = 4;
Jeff Sharkey068c6be2017-09-06 13:47:40 -0600140}