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