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; |
Jeff Sharkey | 52f7a91 | 2017-09-15 12:57:44 -0600 | [diff] [blame] | 20 | import android.os.IVoldTaskListener; |
Jeff Sharkey | 814e9d3 | 2017-09-13 11:49:44 -0600 | [diff] [blame] | 21 | |
Jeff Sharkey | 068c6be | 2017-09-06 13:47:40 -0600 | [diff] [blame] | 22 | /** {@hide} */ |
| 23 | interface IVold { |
Jeff Sharkey | 814e9d3 | 2017-09-13 11:49:44 -0600 | [diff] [blame] | 24 | void setListener(IVoldListener listener); |
| 25 | |
Jeff Sharkey | cbe69fc | 2017-09-15 16:50:28 -0600 | [diff] [blame] | 26 | void monitor(); |
Jeff Sharkey | 068c6be | 2017-09-06 13:47:40 -0600 | [diff] [blame] | 27 | void reset(); |
Jeff Sharkey | 9462bdd | 2017-09-07 15:27:28 -0600 | [diff] [blame] | 28 | void shutdown(); |
Jeff Sharkey | 9462bdd | 2017-09-07 15:27:28 -0600 | [diff] [blame] | 29 | |
| 30 | void onUserAdded(int userId, int userSerial); |
| 31 | void onUserRemoved(int userId); |
Sudheer Shanka | ebaad1c | 2018-07-31 16:39:59 -0700 | [diff] [blame] | 32 | void onUserStarted(int userId, in @utf8InCpp String[] packageNames); |
Jeff Sharkey | 9462bdd | 2017-09-07 15:27:28 -0600 | [diff] [blame] | 33 | void onUserStopped(int userId); |
| 34 | |
Sudheer Shanka | d484aa9 | 2018-07-31 10:07:34 -0700 | [diff] [blame] | 35 | void addAppIds(in @utf8InCpp String[] packageNames, in int[] appIds); |
| 36 | void addSandboxIds(in int[] appIds, in @utf8InCpp String[] sandboxIds); |
| 37 | |
Jeff Sharkey | 401b260 | 2017-12-14 22:15:20 -0700 | [diff] [blame] | 38 | void onSecureKeyguardStateChanged(boolean isShowing); |
| 39 | |
Jeff Sharkey | 9462bdd | 2017-09-07 15:27:28 -0600 | [diff] [blame] | 40 | void partition(@utf8InCpp String diskId, int partitionType, int ratio); |
Jeff Sharkey | 3ce1825 | 2017-10-24 11:08:45 -0600 | [diff] [blame] | 41 | void forgetPartition(@utf8InCpp String partGuid, @utf8InCpp String fsUuid); |
Jeff Sharkey | 9462bdd | 2017-09-07 15:27:28 -0600 | [diff] [blame] | 42 | |
| 43 | void mount(@utf8InCpp String volId, int mountFlags, int mountUserId); |
| 44 | void unmount(@utf8InCpp String volId); |
| 45 | void format(@utf8InCpp String volId, @utf8InCpp String fsType); |
Jeff Sharkey | 52f7a91 | 2017-09-15 12:57:44 -0600 | [diff] [blame] | 46 | void benchmark(@utf8InCpp String volId, IVoldTaskListener listener); |
Jeff Sharkey | 2048a28 | 2017-06-15 09:59:43 -0600 | [diff] [blame] | 47 | void checkEncryption(@utf8InCpp String volId); |
Jeff Sharkey | 9462bdd | 2017-09-07 15:27:28 -0600 | [diff] [blame] | 48 | |
Jeff Sharkey | 52f7a91 | 2017-09-15 12:57:44 -0600 | [diff] [blame] | 49 | void moveStorage(@utf8InCpp String fromVolId, @utf8InCpp String toVolId, |
Paul Crowley | edf7a4e | 2018-09-18 15:14:18 -0700 | [diff] [blame] | 50 | IVoldTaskListener listener); |
Jeff Sharkey | 9462bdd | 2017-09-07 15:27:28 -0600 | [diff] [blame] | 51 | |
| 52 | void remountUid(int uid, int remountMode); |
| 53 | |
| 54 | void mkdirs(@utf8InCpp String path); |
| 55 | |
Paul Crowley | edf7a4e | 2018-09-18 15:14:18 -0700 | [diff] [blame] | 56 | @utf8InCpp String createObb(@utf8InCpp String sourcePath, @utf8InCpp String sourceKey, |
| 57 | int ownerGid); |
Jeff Sharkey | 11c2d38 | 2017-09-11 10:32:01 -0600 | [diff] [blame] | 58 | void destroyObb(@utf8InCpp String volId); |
| 59 | |
Jeff Sharkey | 52f7a91 | 2017-09-15 12:57:44 -0600 | [diff] [blame] | 60 | void fstrim(int fstrimFlags, IVoldTaskListener listener); |
Jin Qian | a370c14 | 2017-10-17 15:41:45 -0700 | [diff] [blame] | 61 | void runIdleMaint(IVoldTaskListener listener); |
| 62 | void abortIdleMaint(IVoldTaskListener listener); |
Jeff Sharkey | 11c2d38 | 2017-09-11 10:32:01 -0600 | [diff] [blame] | 63 | |
| 64 | FileDescriptor mountAppFuse(int uid, int pid, int mountId); |
| 65 | void unmountAppFuse(int uid, int pid, int mountId); |
| 66 | |
Jeff Sharkey | 83b559c | 2017-09-12 16:30:52 -0600 | [diff] [blame] | 67 | void fdeCheckPassword(@utf8InCpp String password); |
| 68 | void fdeRestart(); |
| 69 | int fdeComplete(); |
| 70 | void fdeEnable(int passwordType, @utf8InCpp String password, int encryptionFlags); |
| 71 | void fdeChangePassword(int passwordType, @utf8InCpp String password); |
| 72 | void fdeVerifyPassword(@utf8InCpp String password); |
| 73 | @utf8InCpp String fdeGetField(@utf8InCpp String key); |
| 74 | void fdeSetField(@utf8InCpp String key, @utf8InCpp String value); |
| 75 | int fdeGetPasswordType(); |
| 76 | @utf8InCpp String fdeGetPassword(); |
| 77 | void fdeClearPassword(); |
| 78 | |
| 79 | void fbeEnable(); |
| 80 | |
| 81 | void mountDefaultEncrypted(); |
| 82 | void initUser0(); |
| 83 | boolean isConvertibleToFbe(); |
Paul Crowley | 0fd2626 | 2018-01-30 09:48:19 -0800 | [diff] [blame] | 84 | void mountFstab(@utf8InCpp String mountPoint); |
| 85 | void encryptFstab(@utf8InCpp String mountPoint); |
Jeff Sharkey | 83b559c | 2017-09-12 16:30:52 -0600 | [diff] [blame] | 86 | |
| 87 | void createUserKey(int userId, int userSerial, boolean ephemeral); |
| 88 | void destroyUserKey(int userId); |
| 89 | |
Paul Crowley | edf7a4e | 2018-09-18 15:14:18 -0700 | [diff] [blame] | 90 | void addUserKeyAuth(int userId, int userSerial, @utf8InCpp String token, |
| 91 | @utf8InCpp String secret); |
Jeff Sharkey | 83b559c | 2017-09-12 16:30:52 -0600 | [diff] [blame] | 92 | void fixateNewestUserKeyAuth(int userId); |
| 93 | |
Paul Crowley | edf7a4e | 2018-09-18 15:14:18 -0700 | [diff] [blame] | 94 | void unlockUserKey(int userId, int userSerial, @utf8InCpp String token, |
| 95 | @utf8InCpp String secret); |
Jeff Sharkey | 83b559c | 2017-09-12 16:30:52 -0600 | [diff] [blame] | 96 | void lockUserKey(int userId); |
| 97 | |
Paul Crowley | edf7a4e | 2018-09-18 15:14:18 -0700 | [diff] [blame] | 98 | void prepareUserStorage(@nullable @utf8InCpp String uuid, int userId, int userSerial, |
| 99 | int storageFlags); |
Jeff Sharkey | 83b559c | 2017-09-12 16:30:52 -0600 | [diff] [blame] | 100 | void destroyUserStorage(@nullable @utf8InCpp String uuid, int userId, int storageFlags); |
| 101 | |
Sudheer Shanka | fa6a174 | 2018-10-04 16:26:22 -0700 | [diff] [blame^] | 102 | void prepareSandboxForApp(in @utf8InCpp String packageName, int appId, |
| 103 | in @utf8InCpp String sandboxId, int userId); |
| 104 | void destroySandboxForApp(in @utf8InCpp String packageName, int appId, |
| 105 | in @utf8InCpp String sandboxId, int userId); |
Sudheer Shanka | c756209 | 2018-08-24 10:20:56 -0700 | [diff] [blame] | 106 | |
Daniel Rosenberg | 4f68471 | 2018-08-28 01:58:49 -0700 | [diff] [blame] | 107 | boolean startCheckpoint(int retry); |
| 108 | boolean needsCheckpoint(); |
| 109 | void abortChanges(); |
| 110 | boolean commitChanges(); |
| 111 | boolean prepareDriveForCheckpoint(@utf8InCpp String mountPoint); |
Paul Lawrence | 1abb2fe | 2018-09-21 10:49:57 -0700 | [diff] [blame] | 112 | boolean restoreCheckpoint(@utf8InCpp String device); |
Daniel Rosenberg | 4f68471 | 2018-08-28 01:58:49 -0700 | [diff] [blame] | 113 | boolean markBootAttempt(); |
| 114 | |
Jeff Sharkey | 83b559c | 2017-09-12 16:30:52 -0600 | [diff] [blame] | 115 | const int ENCRYPTION_FLAG_NO_UI = 4; |
| 116 | |
| 117 | const int ENCRYPTION_STATE_NONE = 1; |
| 118 | const int ENCRYPTION_STATE_OK = 0; |
| 119 | const int ENCRYPTION_STATE_ERROR_UNKNOWN = -1; |
| 120 | const int ENCRYPTION_STATE_ERROR_INCOMPLETE = -2; |
| 121 | const int ENCRYPTION_STATE_ERROR_INCONSISTENT = -3; |
| 122 | const int ENCRYPTION_STATE_ERROR_CORRUPT = -4; |
| 123 | |
Jeff Sharkey | 11c2d38 | 2017-09-11 10:32:01 -0600 | [diff] [blame] | 124 | const int FSTRIM_FLAG_DEEP_TRIM = 1; |
Jeff Sharkey | 11c2d38 | 2017-09-11 10:32:01 -0600 | [diff] [blame] | 125 | |
Jeff Sharkey | 9462bdd | 2017-09-07 15:27:28 -0600 | [diff] [blame] | 126 | const int MOUNT_FLAG_PRIMARY = 1; |
| 127 | const int MOUNT_FLAG_VISIBLE = 2; |
| 128 | |
| 129 | const int PARTITION_TYPE_PUBLIC = 0; |
| 130 | const int PARTITION_TYPE_PRIVATE = 1; |
| 131 | const int PARTITION_TYPE_MIXED = 2; |
| 132 | |
Jeff Sharkey | 83b559c | 2017-09-12 16:30:52 -0600 | [diff] [blame] | 133 | const int PASSWORD_TYPE_PASSWORD = 0; |
| 134 | const int PASSWORD_TYPE_DEFAULT = 1; |
Paul Crowley | ca08c0a | 2018-07-03 11:49:00 -0700 | [diff] [blame] | 135 | const int PASSWORD_TYPE_PATTERN = 2; |
| 136 | const int PASSWORD_TYPE_PIN = 3; |
Jeff Sharkey | 83b559c | 2017-09-12 16:30:52 -0600 | [diff] [blame] | 137 | |
| 138 | const int STORAGE_FLAG_DE = 1; |
| 139 | const int STORAGE_FLAG_CE = 2; |
| 140 | |
Jeff Sharkey | 9462bdd | 2017-09-07 15:27:28 -0600 | [diff] [blame] | 141 | const int REMOUNT_MODE_NONE = 0; |
| 142 | const int REMOUNT_MODE_DEFAULT = 1; |
| 143 | const int REMOUNT_MODE_READ = 2; |
| 144 | const int REMOUNT_MODE_WRITE = 3; |
Sudheer Shanka | 70a7828 | 2018-08-21 15:06:23 -0700 | [diff] [blame] | 145 | const int REMOUNT_MODE_FULL = 4; |
Jeff Sharkey | 9462bdd | 2017-09-07 15:27:28 -0600 | [diff] [blame] | 146 | |
Jeff Sharkey | 814e9d3 | 2017-09-13 11:49:44 -0600 | [diff] [blame] | 147 | const int VOLUME_STATE_UNMOUNTED = 0; |
| 148 | const int VOLUME_STATE_CHECKING = 1; |
| 149 | const int VOLUME_STATE_MOUNTED = 2; |
| 150 | const int VOLUME_STATE_MOUNTED_READ_ONLY = 3; |
| 151 | const int VOLUME_STATE_FORMATTING = 4; |
| 152 | const int VOLUME_STATE_EJECTING = 5; |
| 153 | const int VOLUME_STATE_UNMOUNTABLE = 6; |
| 154 | const int VOLUME_STATE_REMOVED = 7; |
| 155 | const int VOLUME_STATE_BAD_REMOVAL = 8; |
Jeff Sharkey | 9462bdd | 2017-09-07 15:27:28 -0600 | [diff] [blame] | 156 | |
Jeff Sharkey | 814e9d3 | 2017-09-13 11:49:44 -0600 | [diff] [blame] | 157 | const int VOLUME_TYPE_PUBLIC = 0; |
| 158 | const int VOLUME_TYPE_PRIVATE = 1; |
| 159 | const int VOLUME_TYPE_EMULATED = 2; |
| 160 | const int VOLUME_TYPE_ASEC = 3; |
| 161 | const int VOLUME_TYPE_OBB = 4; |
Jeff Sharkey | 068c6be | 2017-09-06 13:47:40 -0600 | [diff] [blame] | 162 | } |