• 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.incremental.IncrementalFileSystemControlParcel;
20 import android.os.IVoldListener;
21 import android.os.IVoldMountCallback;
22 import android.os.IVoldTaskListener;
23 
24 /** {@hide} */
25 interface IVold {
setListener(IVoldListener listener)26     void setListener(IVoldListener listener);
27 
abortFuse()28     void abortFuse();
monitor()29     void monitor();
reset()30     void reset();
shutdown()31     void shutdown();
32 
onUserAdded(int userId, int userSerial)33     void onUserAdded(int userId, int userSerial);
onUserRemoved(int userId)34     void onUserRemoved(int userId);
onUserStarted(int userId)35     void onUserStarted(int userId);
onUserStopped(int userId)36     void onUserStopped(int userId);
37 
addAppIds(in @tf8InCpp String[] packageNames, in int[] appIds)38     void addAppIds(in @utf8InCpp String[] packageNames, in int[] appIds);
addSandboxIds(in int[] appIds, in @utf8InCpp String[] sandboxIds)39     void addSandboxIds(in int[] appIds, in @utf8InCpp String[] sandboxIds);
40 
onSecureKeyguardStateChanged(boolean isShowing)41     void onSecureKeyguardStateChanged(boolean isShowing);
42 
partition(@tf8InCpp String diskId, int partitionType, int ratio)43     void partition(@utf8InCpp String diskId, int partitionType, int ratio);
forgetPartition(@tf8InCpp String partGuid, @utf8InCpp String fsUuid)44     void forgetPartition(@utf8InCpp String partGuid, @utf8InCpp String fsUuid);
45 
mount(@tf8InCpp String volId, int mountFlags, int mountUserId, @nullable IVoldMountCallback callback)46     void mount(@utf8InCpp String volId, int mountFlags, int mountUserId,
47          @nullable IVoldMountCallback callback);
unmount(@tf8InCpp String volId)48     void unmount(@utf8InCpp String volId);
format(@tf8InCpp String volId, @utf8InCpp String fsType)49     void format(@utf8InCpp String volId, @utf8InCpp String fsType);
benchmark(@tf8InCpp String volId, IVoldTaskListener listener)50     void benchmark(@utf8InCpp String volId, IVoldTaskListener listener);
checkEncryption(@tf8InCpp String volId)51     void checkEncryption(@utf8InCpp String volId);
52 
moveStorage(@tf8InCpp String fromVolId, @utf8InCpp String toVolId, IVoldTaskListener listener)53     void moveStorage(@utf8InCpp String fromVolId, @utf8InCpp String toVolId,
54                      IVoldTaskListener listener);
55 
remountUid(int uid, int remountMode)56     void remountUid(int uid, int remountMode);
remountAppStorageDirs(int uid, int pid, in @utf8InCpp String[] packageNames)57     void remountAppStorageDirs(int uid, int pid, in @utf8InCpp String[] packageNames);
58 
setupAppDir(@tf8InCpp String path, int appUid)59     void setupAppDir(@utf8InCpp String path, int appUid);
fixupAppDir(@tf8InCpp String path, int appUid)60     void fixupAppDir(@utf8InCpp String path, int appUid);
61 
createObb(@tf8InCpp String sourcePath, @utf8InCpp String sourceKey, int ownerGid)62     @utf8InCpp String createObb(@utf8InCpp String sourcePath, @utf8InCpp String sourceKey,
63                                 int ownerGid);
destroyObb(@tf8InCpp String volId)64     void destroyObb(@utf8InCpp String volId);
65 
fstrim(int fstrimFlags, IVoldTaskListener listener)66     void fstrim(int fstrimFlags, IVoldTaskListener listener);
runIdleMaint(IVoldTaskListener listener)67     void runIdleMaint(IVoldTaskListener listener);
abortIdleMaint(IVoldTaskListener listener)68     void abortIdleMaint(IVoldTaskListener listener);
69 
mountAppFuse(int uid, int mountId)70     FileDescriptor mountAppFuse(int uid, int mountId);
unmountAppFuse(int uid, int mountId)71     void unmountAppFuse(int uid, int mountId);
72 
fdeCheckPassword(@tf8InCpp String password)73     void fdeCheckPassword(@utf8InCpp String password);
fdeRestart()74     void fdeRestart();
fdeComplete()75     int fdeComplete();
fdeEnable(int passwordType, @utf8InCpp String password, int encryptionFlags)76     void fdeEnable(int passwordType, @utf8InCpp String password, int encryptionFlags);
fdeChangePassword(int passwordType, @utf8InCpp String password)77     void fdeChangePassword(int passwordType, @utf8InCpp String password);
fdeVerifyPassword(@tf8InCpp String password)78     void fdeVerifyPassword(@utf8InCpp String password);
fdeGetField(@tf8InCpp String key)79     @utf8InCpp String fdeGetField(@utf8InCpp String key);
fdeSetField(@tf8InCpp String key, @utf8InCpp String value)80     void fdeSetField(@utf8InCpp String key, @utf8InCpp String value);
fdeGetPasswordType()81     int fdeGetPasswordType();
fdeGetPassword()82     @utf8InCpp String fdeGetPassword();
fdeClearPassword()83     void fdeClearPassword();
84 
fbeEnable()85     void fbeEnable();
86 
mountDefaultEncrypted()87     void mountDefaultEncrypted();
initUser0()88     void initUser0();
isConvertibleToFbe()89     boolean isConvertibleToFbe();
mountFstab(@tf8InCpp String blkDevice, @utf8InCpp String mountPoint)90     void mountFstab(@utf8InCpp String blkDevice, @utf8InCpp String mountPoint);
encryptFstab(@tf8InCpp String blkDevice, @utf8InCpp String mountPoint)91     void encryptFstab(@utf8InCpp String blkDevice, @utf8InCpp String mountPoint);
92 
createUserKey(int userId, int userSerial, boolean ephemeral)93     void createUserKey(int userId, int userSerial, boolean ephemeral);
destroyUserKey(int userId)94     void destroyUserKey(int userId);
95 
addUserKeyAuth(int userId, int userSerial, @utf8InCpp String token, @utf8InCpp String secret)96     void addUserKeyAuth(int userId, int userSerial, @utf8InCpp String token,
97                         @utf8InCpp String secret);
clearUserKeyAuth(int userId, int userSerial, @utf8InCpp String token, @utf8InCpp String secret)98     void clearUserKeyAuth(int userId, int userSerial, @utf8InCpp String token,
99                         @utf8InCpp String secret);
fixateNewestUserKeyAuth(int userId)100     void fixateNewestUserKeyAuth(int userId);
101 
unlockUserKey(int userId, int userSerial, @utf8InCpp String token, @utf8InCpp String secret)102     void unlockUserKey(int userId, int userSerial, @utf8InCpp String token,
103                        @utf8InCpp String secret);
lockUserKey(int userId)104     void lockUserKey(int userId);
105 
prepareUserStorage(@ullable @tf8InCpp String uuid, int userId, int userSerial, int storageFlags)106     void prepareUserStorage(@nullable @utf8InCpp String uuid, int userId, int userSerial,
107                             int storageFlags);
destroyUserStorage(@ullable @tf8InCpp String uuid, int userId, int storageFlags)108     void destroyUserStorage(@nullable @utf8InCpp String uuid, int userId, int storageFlags);
109 
prepareSandboxForApp(in @tf8InCpp String packageName, int appId, in @utf8InCpp String sandboxId, int userId)110     void prepareSandboxForApp(in @utf8InCpp String packageName, int appId,
111                               in @utf8InCpp String sandboxId, int userId);
destroySandboxForApp(in @tf8InCpp String packageName, in @utf8InCpp String sandboxId, int userId)112     void destroySandboxForApp(in @utf8InCpp String packageName,
113                               in @utf8InCpp String sandboxId, int userId);
114 
startCheckpoint(int retry)115     void startCheckpoint(int retry);
needsCheckpoint()116     boolean needsCheckpoint();
needsRollback()117     boolean needsRollback();
isCheckpointing()118     boolean isCheckpointing();
abortChanges(in @tf8InCpp String device, boolean retry)119     void abortChanges(in @utf8InCpp String device, boolean retry);
commitChanges()120     void commitChanges();
prepareCheckpoint()121     void prepareCheckpoint();
restoreCheckpoint(@tf8InCpp String device)122     void restoreCheckpoint(@utf8InCpp String device);
restoreCheckpointPart(@tf8InCpp String device, int count)123     void restoreCheckpointPart(@utf8InCpp String device, int count);
markBootAttempt()124     void markBootAttempt();
supportsCheckpoint()125     boolean supportsCheckpoint();
supportsBlockCheckpoint()126     boolean supportsBlockCheckpoint();
supportsFileCheckpoint()127     boolean supportsFileCheckpoint();
resetCheckpoint()128     void resetCheckpoint();
129 
createStubVolume(@tf8InCpp String sourcePath, @utf8InCpp String mountPath, @utf8InCpp String fsType, @utf8InCpp String fsUuid, @utf8InCpp String fsLabel, int flags)130     @utf8InCpp String createStubVolume(@utf8InCpp String sourcePath,
131             @utf8InCpp String mountPath, @utf8InCpp String fsType,
132             @utf8InCpp String fsUuid, @utf8InCpp String fsLabel, int flags);
destroyStubVolume(@tf8InCpp String volId)133     void destroyStubVolume(@utf8InCpp String volId);
134 
openAppFuseFile(int uid, int mountId, int fileId, int flags)135     FileDescriptor openAppFuseFile(int uid, int mountId, int fileId, int flags);
136 
incFsEnabled()137     boolean incFsEnabled();
mountIncFs(@tf8InCpp String backingPath, @utf8InCpp String targetDir, int flags)138     IncrementalFileSystemControlParcel mountIncFs(@utf8InCpp String backingPath, @utf8InCpp String targetDir, int flags);
unmountIncFs(@tf8InCpp String dir)139     void unmountIncFs(@utf8InCpp String dir);
setIncFsMountOptions(in IncrementalFileSystemControlParcel control, boolean enableReadLogs)140     void setIncFsMountOptions(in IncrementalFileSystemControlParcel control, boolean enableReadLogs);
bindMount(@tf8InCpp String sourceDir, @utf8InCpp String targetDir)141     void bindMount(@utf8InCpp String sourceDir, @utf8InCpp String targetDir);
142 
143     const int ENCRYPTION_FLAG_NO_UI = 4;
144 
145     const int ENCRYPTION_STATE_NONE = 1;
146     const int ENCRYPTION_STATE_OK = 0;
147     const int ENCRYPTION_STATE_ERROR_UNKNOWN = -1;
148     const int ENCRYPTION_STATE_ERROR_INCOMPLETE = -2;
149     const int ENCRYPTION_STATE_ERROR_INCONSISTENT = -3;
150     const int ENCRYPTION_STATE_ERROR_CORRUPT = -4;
151 
152     const int FSTRIM_FLAG_DEEP_TRIM = 1;
153 
154     const int MOUNT_FLAG_PRIMARY = 1;
155     const int MOUNT_FLAG_VISIBLE = 2;
156 
157     const int PARTITION_TYPE_PUBLIC = 0;
158     const int PARTITION_TYPE_PRIVATE = 1;
159     const int PARTITION_TYPE_MIXED = 2;
160 
161     const int PASSWORD_TYPE_PASSWORD = 0;
162     const int PASSWORD_TYPE_DEFAULT = 1;
163     const int PASSWORD_TYPE_PATTERN = 2;
164     const int PASSWORD_TYPE_PIN = 3;
165 
166     const int STORAGE_FLAG_DE = 1;
167     const int STORAGE_FLAG_CE = 2;
168 
169     const int REMOUNT_MODE_NONE = 0;
170     const int REMOUNT_MODE_DEFAULT = 1;
171     const int REMOUNT_MODE_READ = 2;
172     const int REMOUNT_MODE_WRITE = 3;
173     const int REMOUNT_MODE_LEGACY = 4;
174     const int REMOUNT_MODE_INSTALLER = 5;
175     const int REMOUNT_MODE_FULL = 6;
176     const int REMOUNT_MODE_PASS_THROUGH = 7;
177     const int REMOUNT_MODE_ANDROID_WRITABLE = 8;
178 
179     const int VOLUME_STATE_UNMOUNTED = 0;
180     const int VOLUME_STATE_CHECKING = 1;
181     const int VOLUME_STATE_MOUNTED = 2;
182     const int VOLUME_STATE_MOUNTED_READ_ONLY = 3;
183     const int VOLUME_STATE_FORMATTING = 4;
184     const int VOLUME_STATE_EJECTING = 5;
185     const int VOLUME_STATE_UNMOUNTABLE = 6;
186     const int VOLUME_STATE_REMOVED = 7;
187     const int VOLUME_STATE_BAD_REMOVAL = 8;
188 
189     const int VOLUME_TYPE_PUBLIC = 0;
190     const int VOLUME_TYPE_PRIVATE = 1;
191     const int VOLUME_TYPE_EMULATED = 2;
192     const int VOLUME_TYPE_ASEC = 3;
193     const int VOLUME_TYPE_OBB = 4;
194     const int VOLUME_TYPE_STUB = 5;
195 }
196