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