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