• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 package android.os;
18 
19 import android.os.IVoldListener;
20 import android.os.IVoldTaskListener;
21 
22 /** {@hide} */
23 interface IVold {
setListener(IVoldListener listener)24     void setListener(IVoldListener listener);
25 
monitor()26     void monitor();
reset()27     void reset();
shutdown()28     void shutdown();
29 
onUserAdded(int userId, int userSerial)30     void onUserAdded(int userId, int userSerial);
onUserRemoved(int userId)31     void onUserRemoved(int userId);
onUserStarted(int userId)32     void onUserStarted(int userId);
onUserStopped(int userId)33     void onUserStopped(int userId);
34 
onSecureKeyguardStateChanged(boolean isShowing)35     void onSecureKeyguardStateChanged(boolean isShowing);
36 
partition(@tf8InCpp String diskId, int partitionType, int ratio)37     void partition(@utf8InCpp String diskId, int partitionType, int ratio);
forgetPartition(@tf8InCpp String partGuid, @utf8InCpp String fsUuid)38     void forgetPartition(@utf8InCpp String partGuid, @utf8InCpp String fsUuid);
39 
mount(@tf8InCpp String volId, int mountFlags, int mountUserId)40     void mount(@utf8InCpp String volId, int mountFlags, int mountUserId);
unmount(@tf8InCpp String volId)41     void unmount(@utf8InCpp String volId);
format(@tf8InCpp String volId, @utf8InCpp String fsType)42     void format(@utf8InCpp String volId, @utf8InCpp String fsType);
benchmark(@tf8InCpp String volId, IVoldTaskListener listener)43     void benchmark(@utf8InCpp String volId, IVoldTaskListener listener);
checkEncryption(@tf8InCpp String volId)44     void checkEncryption(@utf8InCpp String volId);
45 
moveStorage(@tf8InCpp String fromVolId, @utf8InCpp String toVolId, IVoldTaskListener listener)46     void moveStorage(@utf8InCpp String fromVolId, @utf8InCpp String toVolId,
47             IVoldTaskListener listener);
48 
remountUid(int uid, int remountMode)49     void remountUid(int uid, int remountMode);
50 
mkdirs(@tf8InCpp String path)51     void mkdirs(@utf8InCpp String path);
52 
createObb(@tf8InCpp String sourcePath, @utf8InCpp String sourceKey, int ownerGid)53     @utf8InCpp String createObb(@utf8InCpp String sourcePath,
54             @utf8InCpp String sourceKey, int ownerGid);
destroyObb(@tf8InCpp String volId)55     void destroyObb(@utf8InCpp String volId);
56 
fstrim(int fstrimFlags, IVoldTaskListener listener)57     void fstrim(int fstrimFlags, IVoldTaskListener listener);
runIdleMaint(IVoldTaskListener listener)58     void runIdleMaint(IVoldTaskListener listener);
abortIdleMaint(IVoldTaskListener listener)59     void abortIdleMaint(IVoldTaskListener listener);
60 
mountAppFuse(int uid, int pid, int mountId)61     FileDescriptor mountAppFuse(int uid, int pid, int mountId);
unmountAppFuse(int uid, int pid, int mountId)62     void unmountAppFuse(int uid, int pid, int mountId);
63 
fdeCheckPassword(@tf8InCpp String password)64     void fdeCheckPassword(@utf8InCpp String password);
fdeRestart()65     void fdeRestart();
fdeComplete()66     int fdeComplete();
fdeEnable(int passwordType, @utf8InCpp String password, int encryptionFlags)67     void fdeEnable(int passwordType, @utf8InCpp String password, int encryptionFlags);
fdeChangePassword(int passwordType, @utf8InCpp String password)68     void fdeChangePassword(int passwordType, @utf8InCpp String password);
fdeVerifyPassword(@tf8InCpp String password)69     void fdeVerifyPassword(@utf8InCpp String password);
fdeGetField(@tf8InCpp String key)70     @utf8InCpp String fdeGetField(@utf8InCpp String key);
fdeSetField(@tf8InCpp String key, @utf8InCpp String value)71     void fdeSetField(@utf8InCpp String key, @utf8InCpp String value);
fdeGetPasswordType()72     int fdeGetPasswordType();
fdeGetPassword()73     @utf8InCpp String fdeGetPassword();
fdeClearPassword()74     void fdeClearPassword();
75 
fbeEnable()76     void fbeEnable();
77 
mountDefaultEncrypted()78     void mountDefaultEncrypted();
initUser0()79     void initUser0();
isConvertibleToFbe()80     boolean isConvertibleToFbe();
mountFstab(@tf8InCpp String mountPoint)81     void mountFstab(@utf8InCpp String mountPoint);
encryptFstab(@tf8InCpp String mountPoint)82     void encryptFstab(@utf8InCpp String mountPoint);
83 
createUserKey(int userId, int userSerial, boolean ephemeral)84     void createUserKey(int userId, int userSerial, boolean ephemeral);
destroyUserKey(int userId)85     void destroyUserKey(int userId);
86 
addUserKeyAuth(int userId, int userSerial, @utf8InCpp String token, @utf8InCpp String secret)87     void addUserKeyAuth(int userId, int userSerial, @utf8InCpp String token, @utf8InCpp String secret);
fixateNewestUserKeyAuth(int userId)88     void fixateNewestUserKeyAuth(int userId);
89 
unlockUserKey(int userId, int userSerial, @utf8InCpp String token, @utf8InCpp String secret)90     void unlockUserKey(int userId, int userSerial, @utf8InCpp String token, @utf8InCpp String secret);
lockUserKey(int userId)91     void lockUserKey(int userId);
92 
prepareUserStorage(@ullable @tf8InCpp String uuid, int userId, int userSerial, int storageFlags)93     void prepareUserStorage(@nullable @utf8InCpp String uuid, int userId, int userSerial, int storageFlags);
destroyUserStorage(@ullable @tf8InCpp String uuid, int userId, int storageFlags)94     void destroyUserStorage(@nullable @utf8InCpp String uuid, int userId, int storageFlags);
95 
96     const int ENCRYPTION_FLAG_NO_UI = 4;
97 
98     const int ENCRYPTION_STATE_NONE = 1;
99     const int ENCRYPTION_STATE_OK = 0;
100     const int ENCRYPTION_STATE_ERROR_UNKNOWN = -1;
101     const int ENCRYPTION_STATE_ERROR_INCOMPLETE = -2;
102     const int ENCRYPTION_STATE_ERROR_INCONSISTENT = -3;
103     const int ENCRYPTION_STATE_ERROR_CORRUPT = -4;
104 
105     const int FSTRIM_FLAG_DEEP_TRIM = 1;
106 
107     const int MOUNT_FLAG_PRIMARY = 1;
108     const int MOUNT_FLAG_VISIBLE = 2;
109 
110     const int PARTITION_TYPE_PUBLIC = 0;
111     const int PARTITION_TYPE_PRIVATE = 1;
112     const int PARTITION_TYPE_MIXED = 2;
113 
114     const int PASSWORD_TYPE_PASSWORD = 0;
115     const int PASSWORD_TYPE_DEFAULT = 1;
116     const int PASSWORD_TYPE_PIN = 2;
117     const int PASSWORD_TYPE_PATTERN = 3;
118 
119     const int STORAGE_FLAG_DE = 1;
120     const int STORAGE_FLAG_CE = 2;
121 
122     const int REMOUNT_MODE_NONE = 0;
123     const int REMOUNT_MODE_DEFAULT = 1;
124     const int REMOUNT_MODE_READ = 2;
125     const int REMOUNT_MODE_WRITE = 3;
126 
127     const int VOLUME_STATE_UNMOUNTED = 0;
128     const int VOLUME_STATE_CHECKING = 1;
129     const int VOLUME_STATE_MOUNTED = 2;
130     const int VOLUME_STATE_MOUNTED_READ_ONLY = 3;
131     const int VOLUME_STATE_FORMATTING = 4;
132     const int VOLUME_STATE_EJECTING = 5;
133     const int VOLUME_STATE_UNMOUNTABLE = 6;
134     const int VOLUME_STATE_REMOVED = 7;
135     const int VOLUME_STATE_BAD_REMOVAL = 8;
136 
137     const int VOLUME_TYPE_PUBLIC = 0;
138     const int VOLUME_TYPE_PRIVATE = 1;
139     const int VOLUME_TYPE_EMULATED = 2;
140     const int VOLUME_TYPE_ASEC = 3;
141     const int VOLUME_TYPE_OBB = 4;
142 }
143